ARTS  2.2.66
abs_species_tags.h
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012 Stefan Buehler <sbuehler@ltu.se>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
32 #ifndef abs_species_h
33 #define abs_species_h
34 
35 #include <stdexcept>
36 #include "matpackI.h"
37 #include "array.h"
38 #include "mystring.h"
39 #include "make_array.h"
40 #include "bifstream.h"
41 
42 
46 class SpeciesTag {
47 public:
50  misotopologue(-1),
51  mlf(0.),
52  muf(0.),
53  mtype(-1),
55  mcia_second(-1),
56  mcia_dataset(-1)
57  { /* Nothing to be done here. */ }
58 
59  // Documentation is with implementation.
60  SpeciesTag(String def);
61 
62  // Documentation is with implementation.
63  String Name() const;
64 
66  Index Species() const { return mspecies; }
67 
71  Index Isotopologue() const { return misotopologue; }
72 
75  Numeric Lf() const { return mlf; }
76 
79  Numeric Uf() const { return muf; }
80 
82  Index CIASecond() const { return mcia_second; }
83 
85  Index CIADataset() const { return mcia_dataset; }
86 
88 
99  bool operator==(const SpeciesTag& other) const
100  {
101  if ( other.mspecies != mspecies ) return false;
102  if ( other.misotopologue != misotopologue ) return false;
103  if ( other.mlf != mlf ) return false;
104  if ( other.muf != muf ) return false;
105  if ( other.mtype != mtype ) return false;
106  if ( other.mline_mixing_type != mline_mixing_type ) return false;
107  if ( mtype == TYPE_CIA && (other.mcia_second != mcia_second
108  || other.mcia_dataset != mcia_dataset)) return false;
109  return true;
110  }
111 
112 
116  enum {
123  };
124 
125 
129  enum {
132  };
133 
134 
138  Index Type() const { return mtype; }
139 
140 
145 
146 
147 private:
150 
152 
157 
159 
161 
163 
165 
180 
190 
192 
194 
196 
198 };
199 
200 
204 ostream& operator << (ostream& os, const SpeciesTag& ot);
205 
206 
212 
220 
221 
222 //======================================================================
223 // Functions related to species and tags
224 //======================================================================
225 
226 String get_tag_group_name( const ArrayOfSpeciesTag& tg );
227 
228 String get_species_name( const ArrayOfSpeciesTag& tg );
229 
230 Index find_first_species_tg( const ArrayOfArrayOfSpeciesTag& tgs,
231  const Index& spec );
232 
233 Index find_next_species_tg( const ArrayOfArrayOfSpeciesTag& tgs,
234  const Index& spec,
235  const Index& start );
236 
237 void array_species_tag_from_string( ArrayOfSpeciesTag& tags,
238  const String& names );
239 
240 void check_abs_species( const ArrayOfArrayOfSpeciesTag& tags );
241 
242 bool is_zeeman(const ArrayOfSpeciesTag& tg);
243 
244 
245 //--------------------------------------------------------------------------------
246 // Functions from ARTS-1-0. Are they still needed?
247 //--------------------------------------------------------------------------------
248 
250  Index& tags1_index,
251  const ArrayOfArrayOfSpeciesTag& tags1,
252  const Array<SpeciesTag>& tags2 );
253 
254 
255 #endif // abs_species_h
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
Index misotopologue
Isotopologue species index.
bool is_zeeman(const ArrayOfSpeciesTag &tg)
Is this a Zeeman tag group?
Index find_next_species_tg(const ArrayOfArrayOfSpeciesTag &tgs, const Index &spec, const Index &start)
Find next occurrence of species in tag groups.
SpeciesTag()
Default constructor.
Index CIADataset() const
CIA dataset index inside this CIA file.
Index CIASecond() const
Species index of the 2nd CIA species.
String Name() const
Return the full name of the tag.
Index mline_mixing_type
Line Mixing Type of this tag.
Index Species() const
Molecular species index.
Index Type() const
Return the type of this tag.
void get_tag_group_index_for_tag_group(Index &tags1_index, const ArrayOfArrayOfSpeciesTag &tags1, const Array< SpeciesTag > &tags2)
Returns the index of the tag group tg2 within the array of tag groups tgs1.
void spec(Array< SpeciesRecord >::iterator &is, Array< IsotopologueRecord >::iterator &ii, String name)
Define partition function coefficients lookup data.
Numeric Uf() const
The upper line center frequency in Hz: If this is <0 it means no upper limit.
Numeric mlf
The lower limit line center frequency in Hz.
This file contains the definition of Array.
String get_species_name(const ArrayOfSpeciesTag &tg)
Return the species of a tag group as a string.
void check_abs_species(const ArrayOfArrayOfSpeciesTag &tags)
Check the correctness of abs_species.
This file contains the class declaration of bifstream.
Numeric Lf() const
The lower line center frequency in Hz.
Array< ArrayOfSpeciesTag > ArrayOfArrayOfSpeciesTag
Contains the available tag groups.
A tag group can consist of the sum of several of these.
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
Implements the class MakeArray, which is a derived class of Array, allowing explicit initialization...
Index mspecies
Molecular species index.
Numeric muf
The upper line center frequency in Hz.
void array_species_tag_from_string(ArrayOfSpeciesTag &tags, const String &names)
Converts a String to ArrayOfSpeciesTag.
This can be used to make arrays out of anything.
Definition: array.h:40
bool operator==(const SpeciesTag &other) const
Comparison operator for species tags.
Index mcia_dataset
CIA dataset index.
Index mtype
Type of this tag.
ostream & operator<<(ostream &os, const SpeciesTag &ot)
Output operator for SpeciesTag.
Array< SpeciesTag > ArrayOfSpeciesTag
A tag group is an array of SpeciesTags.
Index LineMixingType() const
Return the line mixing type of this tag.
Index Isotopologue() const
Isotopologue species index.
Index find_first_species_tg(const ArrayOfArrayOfSpeciesTag &tgs, const Index &spec)
Find first occurrence of species in tag groups.
String get_tag_group_name(const ArrayOfSpeciesTag &tg)
Return the name of a tag group as a string.
Index mcia_second
2nd CIA species index.
This file contains the definition of String, the ARTS string class.