ARTS
2.2.66
|
Header file for stuff related to absorption species tags. More...
#include <stdexcept>
#include "matpackI.h"
#include "array.h"
#include "mystring.h"
#include "make_array.h"
#include "bifstream.h"
Go to the source code of this file.
Classes | |
class | SpeciesTag |
A tag group can consist of the sum of several of these. More... | |
Typedefs | |
typedef Array< SpeciesTag > | ArrayOfSpeciesTag |
A tag group is an array of SpeciesTags. More... | |
typedef Array< ArrayOfSpeciesTag > | ArrayOfArrayOfSpeciesTag |
Contains the available tag groups. More... | |
Functions | |
ostream & | operator<< (ostream &os, const SpeciesTag &ot) |
Output operator for SpeciesTag. More... | |
String | get_tag_group_name (const ArrayOfSpeciesTag &tg) |
Return the name of a tag group as a string. More... | |
String | get_species_name (const ArrayOfSpeciesTag &tg) |
Return the species of a tag group as a string. More... | |
Index | find_first_species_tg (const ArrayOfArrayOfSpeciesTag &tgs, const Index &spec) |
Find first occurrence of species in tag groups. More... | |
Index | find_next_species_tg (const ArrayOfArrayOfSpeciesTag &tgs, const Index &spec, const Index &start) |
Find next occurrence of species in tag groups. More... | |
void | array_species_tag_from_string (ArrayOfSpeciesTag &tags, const String &names) |
Converts a String to ArrayOfSpeciesTag. More... | |
void | check_abs_species (const ArrayOfArrayOfSpeciesTag &tags) |
Check the correctness of abs_species. More... | |
bool | is_zeeman (const ArrayOfSpeciesTag &tg) |
Is this a Zeeman tag group? More... | |
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. More... | |
Header file for stuff related to absorption species tags.
This file contains class definition and function headers related to SpeciesTags. It is better to separate this from the other absorption functions, since this part was actually improved in arts-1-1 and should be kept, whereas most other absorption stuff is back-ported from arts-1-0.
Definition in file abs_species_tags.h.
Contains the available tag groups.
Contrary to the Bredbeck definition, tag groups may only consist of tags belonging to the same species. The reason for this is that there is one VMR profile associated with each tag group.
Definition at line 219 of file abs_species_tags.h.
typedef Array<SpeciesTag> ArrayOfSpeciesTag |
A tag group is an array of SpeciesTags.
This corresponds to one "species" in the controlfile. Example: "O3-666, O3-668"
Definition at line 211 of file abs_species_tags.h.
void array_species_tag_from_string | ( | ArrayOfSpeciesTag & | tags, |
const String & | names | ||
) |
Converts a String to ArrayOfSpeciesTag.
This function is used when preparing strings read from e.g. control files to be stored as SpeciesTag in abs_species.
Note: This is originally a part of abs_speciesSet.
tags | Array of SpeciesTag. |
names | String with species. |
Definition at line 649 of file abs_species_tags.cc.
References Array< base >::nelem(), my_basic_string< charT >::npos, SpeciesTag::Species(), SpeciesTag::Type(), SpeciesTag::TYPE_PLAIN, and SpeciesTag::TYPE_ZEEMAN.
Referenced by abs_speciesAdd(), abs_speciesAdd2(), abs_speciesSet(), get_pointers_for_analytical_jacobians(), and jacobianCalcAbsSpeciesPerturbations().
void check_abs_species | ( | const ArrayOfArrayOfSpeciesTag & | abs_species | ) |
Check the correctness of abs_species.
Checks on the correctness of the tags will be performed, e.g. free_electrons and particles species are only allowed once in abs_species.
tags | Array of Array of SpeciesTag. |
Definition at line 720 of file abs_species_tags.cc.
References SpeciesTag::LINE_MIXING_TYPE_NONE, Array< base >::nelem(), SpeciesTag::TYPE_FREE_ELECTRONS, and SpeciesTag::TYPE_PARTICLES.
Referenced by abs_speciesAdd(), abs_speciesAdd2(), and abs_speciesSet().
Index find_first_species_tg | ( | const ArrayOfArrayOfSpeciesTag & | tgs, |
const Index & | spec | ||
) |
Find first occurrence of species in tag groups.
The species to look for must be specified by its species index, not by the name. Use the helper function to get the species index from the species name if necessary.
tgs | The species tags to search in. |
spec | The species index of the species to look for. |
Definition at line 590 of file abs_species_tags.cc.
References find_next_species_tg(), and spec().
Referenced by abs_h2oSet(), abs_lookupSetup(), abs_lookupSetupBatch(), abs_lookupSetupWide(), abs_lookupTestAccMC(), abs_lookupTestAccuracy(), abs_n2Set(), abs_o2Set(), abs_xsec_per_speciesAddCIA(), GasAbsLookup::Extract(), find_broad_spec_locations(), refr_index_airMWgeneral(), refr_index_airThayer(), and z_fieldFromHSE().
Index find_next_species_tg | ( | const ArrayOfArrayOfSpeciesTag & | tgs, |
const Index & | spec, | ||
const Index & | start | ||
) |
Find next occurrence of species in tag groups.
The species to look for must be specified by its species index, not by the name. Use the helper function to get the species index from the species name if necessary.
tgs | The species tags to search in. |
spec | The species index of the species to look for. |
start | The index position at which to start the search (0 would be the very beginning). |
Definition at line 614 of file abs_species_tags.cc.
References Array< base >::nelem(), and spec().
Referenced by choose_abs_nls(), and find_first_species_tg().
String get_species_name | ( | const ArrayOfSpeciesTag & | tg | ) |
Return the species of a tag group as a string.
A tag group consists of several elementary SpeciesTags, which must all belong to the same molecular species. This function returns a string with the name of the species. This is nice for informational output messages, for example in the absorption routines.
E.g., if the tag group is: "H2O-161, H2O-181", then the function will return "H2O".
It also does a safety check that really all tags belong to the same species.
tg | The tag group in question. |
Definition at line 552 of file abs_species_tags.cc.
References get_tag_group_name(), Array< base >::nelem(), and species_name_from_species_index().
Referenced by abs_lookupSetupBatch().
void get_tag_group_index_for_tag_group | ( | Index & | tgs1_index, |
const ArrayOfArrayOfSpeciesTag & | tgs1, | ||
const ArrayOfSpeciesTag & | tg2 | ||
) |
Returns the index of the tag group tg2 within the array of tag groups tgs1.
Slightly modified copy of get_tagindex_for_Strings.
runtime_error | Could not find tg2 in tgs1. |
tgs1_index | Index in tgs1 for tg2 |
tgs1 | The tags groups to search in. |
tg2 | The tag group for which the index shall be found. |
Definition at line 796 of file abs_species_tags.cc.
References Array< base >::nelem().
String get_tag_group_name | ( | const ArrayOfSpeciesTag & | tg | ) |
Return the name of a tag group as a string.
A tag group consists of several elementary SpeciesTags. This function returns a String with the name of the entire tag group. This is nice for informational output messages, for example in the absorption routines.
tg | The tag group in question. |
Definition at line 517 of file abs_species_tags.cc.
References Array< base >::nelem().
Referenced by abs_xsec_per_speciesAddLines(), GasAbsLookup::Adapt(), and get_species_name().
bool is_zeeman | ( | const ArrayOfSpeciesTag & | tg | ) |
Is this a Zeeman tag group?
It is not enough to just look at the first tag to find out if this is a Zeeman tag group, since there could be some predefined absorption or CIA tag first.
tg | The tag group to check |
Definition at line 775 of file abs_species_tags.cc.
References Array< base >::nelem(), and SpeciesTag::TYPE_ZEEMAN.
Referenced by abs_xsec_per_speciesAddLines(), GasAbsLookup::Extract(), and propmat_clearskyAddZeeman().
ostream& operator<< | ( | ostream & | os, |
const SpeciesTag & | ot | ||
) |
Output operator for SpeciesTag.
Definition at line 499 of file abs_species_tags.cc.
References SpeciesTag::Name().