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 
227 
229 
231  const Index& spec );
232 
234  const Index& spec,
235  const Index& start );
236 
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
SpeciesTag::mline_mixing_type
Index mline_mixing_type
Line Mixing Type of this tag.
Definition: abs_species_tags.h:189
SpeciesTag::SpeciesTag
SpeciesTag()
Default constructor.
Definition: abs_species_tags.h:49
SpeciesTag::CIADataset
Index CIADataset() const
CIA dataset index inside this CIA file.
Definition: abs_species_tags.h:85
check_abs_species
void check_abs_species(const ArrayOfArrayOfSpeciesTag &tags)
Check the correctness of abs_species.
Definition: abs_species_tags.cc:720
SpeciesTag::TYPE_PREDEF
@ TYPE_PREDEF
Definition: abs_species_tags.h:119
SpeciesTag::TYPE_PLAIN
@ TYPE_PLAIN
Definition: abs_species_tags.h:117
ArrayOfArrayOfSpeciesTag
Array< ArrayOfSpeciesTag > ArrayOfArrayOfSpeciesTag
Contains the available tag groups.
Definition: abs_species_tags.h:219
SpeciesTag::LINE_MIXING_TYPE_2NDORDER
@ LINE_MIXING_TYPE_2NDORDER
Definition: abs_species_tags.h:131
SpeciesTag::LINE_MIXING_TYPE_NONE
@ LINE_MIXING_TYPE_NONE
Definition: abs_species_tags.h:130
SpeciesTag::Name
String Name() const
Return the full name of the tag.
Definition: abs_species_tags.cc:397
SpeciesTag::TYPE_ZEEMAN
@ TYPE_ZEEMAN
Definition: abs_species_tags.h:118
ArrayOfSpeciesTag
Array< SpeciesTag > ArrayOfSpeciesTag
A tag group is an array of SpeciesTags.
Definition: abs_species_tags.h:211
SpeciesTag::misotopologue
Index misotopologue
Isotopologue species index.
Definition: abs_species_tags.h:156
array_species_tag_from_string
void array_species_tag_from_string(ArrayOfSpeciesTag &tags, const String &names)
Converts a String to ArrayOfSpeciesTag.
Definition: abs_species_tags.cc:649
SpeciesTag::muf
Numeric muf
The upper line center frequency in Hz.
Definition: abs_species_tags.h:164
SpeciesTag::TYPE_FREE_ELECTRONS
@ TYPE_FREE_ELECTRONS
Definition: abs_species_tags.h:121
array.h
This file contains the definition of Array.
SpeciesTag::operator==
bool operator==(const SpeciesTag &other) const
Comparison operator for species tags.
Definition: abs_species_tags.h:99
matpackI.h
SpeciesTag::TYPE_PARTICLES
@ TYPE_PARTICLES
Definition: abs_species_tags.h:122
find_next_species_tg
Index find_next_species_tg(const ArrayOfArrayOfSpeciesTag &tgs, const Index &spec, const Index &start)
Find next occurrence of species in tag groups.
Definition: abs_species_tags.cc:614
is_zeeman
bool is_zeeman(const ArrayOfSpeciesTag &tg)
Is this a Zeeman tag group?
Definition: abs_species_tags.cc:775
Array
This can be used to make arrays out of anything.
Definition: array.h:107
SpeciesTag
A tag group can consist of the sum of several of these.
Definition: abs_species_tags.h:46
spec
void spec(Array< SpeciesRecord >::iterator &is, Array< IsotopologueRecord >::iterator &ii, String name)
Define partition function coefficients lookup data.
Definition: partition_function_data.cc:925
operator<<
ostream & operator<<(ostream &os, const SpeciesTag &ot)
Output operator for SpeciesTag.
Definition: abs_species_tags.cc:499
get_tag_group_name
String get_tag_group_name(const ArrayOfSpeciesTag &tg)
Return the name of a tag group as a string.
Definition: abs_species_tags.cc:517
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:64
SpeciesTag::Uf
Numeric Uf() const
The upper line center frequency in Hz: If this is <0 it means no upper limit.
Definition: abs_species_tags.h:79
SpeciesTag::mcia_dataset
Index mcia_dataset
CIA dataset index.
Definition: abs_species_tags.h:197
SpeciesTag::TYPE_CIA
@ TYPE_CIA
Definition: abs_species_tags.h:120
SpeciesTag::CIASecond
Index CIASecond() const
Species index of the 2nd CIA species.
Definition: abs_species_tags.h:82
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
make_array.h
Implements the class MakeArray, which is a derived class of Array, allowing explicit initialization.
find_first_species_tg
Index find_first_species_tg(const ArrayOfArrayOfSpeciesTag &tgs, const Index &spec)
Find first occurrence of species in tag groups.
Definition: abs_species_tags.cc:590
SpeciesTag::mlf
Numeric mlf
The lower limit line center frequency in Hz.
Definition: abs_species_tags.h:160
SpeciesTag::mtype
Index mtype
Type of this tag.
Definition: abs_species_tags.h:179
bifstream.h
This file contains the class declaration of bifstream.
SpeciesTag::Lf
Numeric Lf() const
The lower line center frequency in Hz.
Definition: abs_species_tags.h:75
SpeciesTag::mcia_second
Index mcia_second
2nd CIA species index.
Definition: abs_species_tags.h:193
SpeciesTag::LineMixingType
Index LineMixingType() const
Return the line mixing type of this tag.
Definition: abs_species_tags.h:144
get_species_name
String get_species_name(const ArrayOfSpeciesTag &tg)
Return the species of a tag group as a string.
Definition: abs_species_tags.cc:552
SpeciesTag::Isotopologue
Index Isotopologue() const
Isotopologue species index.
Definition: abs_species_tags.h:71
SpeciesTag::mspecies
Index mspecies
Molecular species index.
Definition: abs_species_tags.h:149
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
get_tag_group_index_for_tag_group
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.
Definition: abs_species_tags.cc:796
SpeciesTag::Type
Index Type() const
Return the type of this tag.
Definition: abs_species_tags.h:138
SpeciesTag::Species
Index Species() const
Molecular species index.
Definition: abs_species_tags.h:66
mystring.h
This file contains the definition of String, the ARTS string class.