62 asrecord.resize(nelem);
67 for (n = 0; n < nelem; n++)
72 catch (runtime_error e)
75 os <<
"Error reading SpeciesData: " 76 <<
"\n Element: " << n
78 throw runtime_error(os.str());
145 aastag.resize(nelem);
150 for (n = 0; n < nelem; n++)
155 catch (runtime_error e)
158 os <<
"Error reading ArrayOfArrayOfSpeciesTag: " 159 <<
"\n Element: " << n
161 throw runtime_error(os.str());
229 appath.resize(nelem);
234 for (n = 0; n < nelem; n++)
239 catch (runtime_error e)
242 os <<
"Error reading ArrayOfPpath: " 243 <<
"\n Element: " << n
245 throw runtime_error(os.str());
315 aatensor3.resize(nelem);
320 for (n = 0; n < nelem; n++)
323 catch (runtime_error e)
326 os <<
"Error reading ArrayOfArrayOfTensor3: " 327 <<
"\n Element: " << n
329 throw runtime_error(os.str());
397 aatensor6.resize(nelem);
402 for (n = 0; n < nelem; n++)
405 catch (runtime_error e)
408 os <<
"Error reading ArrayOfArrayOfTensor6: " 409 <<
"\n Element: " << n
411 throw runtime_error(os.str());
481 for (n = 0; n < nelem; n++)
484 catch (runtime_error e)
487 os <<
"Error reading ArrayOfGridPos: " 488 <<
"\n Element: " << n
490 throw runtime_error(os.str());
555 aagpos.resize(nelem);
560 for (n = 0; n < nelem; n++)
563 catch (runtime_error e)
566 os <<
"Error reading ArrayOfArrayOfGridPos: " 567 <<
"\n Element: " << n
569 throw runtime_error(os.str());
634 aaagpos.resize(nelem);
639 for (n = 0; n < nelem; n++)
642 catch (runtime_error e)
645 os <<
"Error reading ArrayOfArrayOfArrayOfGridPos: " 646 <<
"\n Element: " << n
648 throw runtime_error(os.str());
714 aaaagpos.resize(nelem);
719 for (n = 0; n < nelem; n++)
722 catch (runtime_error e)
725 os <<
"Error reading ArrayOfArrayOfArrayOfArrayOfGridPos: " 726 <<
"\n Element: " << n
728 throw runtime_error(os.str());
756 open_tag.
add_attribute(
"type",
"ArrayOfArrayOfArrayOfGridPos");
794 aindex.resize(nelem);
799 for (n = 0; n < nelem; n++)
802 catch (runtime_error e)
805 os <<
"Error reading ArrayOfIndex: " 806 <<
"\n Element: " << n
808 throw runtime_error(os.str());
874 aaindex.resize(nelem);
879 for (n = 0; n < nelem; n++)
882 catch (runtime_error e)
885 os <<
"Error reading ArrayOfArrayOfIndex: " 886 <<
"\n Element: " << n
888 throw runtime_error(os.str());
959 for (n = 0; n < nelem; n++)
962 catch (runtime_error e)
965 os <<
"Error reading ArrayOfCIARecord: " 966 <<
"\n Element: " << n
968 throw runtime_error(os.str());
1035 airecord.resize(nelem);
1040 for (n = 0; n < nelem; n++)
1043 catch (runtime_error e)
1046 os <<
"Error reading ArrayOfIsotopologueRecord: " 1047 <<
"\n Element: " << n
1048 <<
"\n" << e.what();
1049 throw runtime_error(os.str());
1115 amatrix.resize(nelem);
1120 for (n = 0; n < nelem; n++)
1123 catch (runtime_error e)
1126 os <<
"Error reading ArrayOfMatrix: " 1127 <<
"\n Element: " << n
1128 <<
"\n" << e.what();
1129 throw runtime_error(os.str());
1194 aamatrix.resize(nelem);
1199 for (n = 0; n < nelem; n++)
1202 catch (runtime_error e)
1205 os <<
"Error reading ArrayOfArrayOfMatrix: " 1206 <<
"\n Element: " << n
1207 <<
"\n" << e.what();
1208 throw runtime_error(os.str());
1273 aavector.resize(nelem);
1278 for (n = 0; n < nelem; n++)
1281 catch (runtime_error e)
1284 os <<
"Error reading ArrayOfArrayOfVector: " 1285 <<
"\n Element: " << n
1286 <<
"\n" << e.what();
1287 throw runtime_error(os.str());
1352 asparse.resize(nelem);
1357 for (n = 0; n < nelem; n++)
1360 catch (runtime_error e)
1363 os <<
"Error reading ArrayOfSparse: " 1364 <<
"\n Element: " << n
1365 <<
"\n" << e.what();
1366 throw runtime_error(os.str());
1436 for (n = 0; n < nelem; n++)
1439 catch (runtime_error e)
1442 os <<
"Error reading ArrayOfRetrievalQuantity: " 1443 <<
"\n Element: " << n
1444 <<
"\n" << e.what();
1445 throw runtime_error(os.str());
1510 astag.resize(nelem);
1515 for (n = 0; n < nelem; n++)
1518 catch (runtime_error e)
1521 os <<
"Error reading ArrayOfSpeciesTag: " 1522 <<
"\n Element: " << n
1523 <<
"\n" << e.what();
1524 throw runtime_error(os.str());
1589 assdata.resize(nelem);
1594 for (n = 0; n < nelem; n++)
1597 catch (runtime_error e)
1600 os <<
"Error reading ArrayOfSingleScatteringData: " 1601 <<
"\n Element: " << n
1602 <<
"\n" << e.what();
1603 throw runtime_error(os.str());
1668 asmdata.resize(nelem);
1673 for (n = 0; n < nelem; n++)
1676 catch (runtime_error e)
1679 os <<
"Error reading ArrayOfScatteringMetaData: " 1680 <<
"\n Element: " << n
1681 <<
"\n" << e.what();
1682 throw runtime_error(os.str());
1748 agfield.resize(nelem);
1753 for (n = 0; n < nelem; n++)
1756 catch (runtime_error e)
1759 os <<
"Error reading ArrayOfGriddedField1: " 1760 <<
"\n Element: " << n
1761 <<
"\n" << e.what();
1762 throw runtime_error(os.str());
1827 agfield.resize(nelem);
1832 for (n = 0; n < nelem; n++)
1835 catch (runtime_error e)
1838 os <<
"Error reading ArrayOfGriddedField2: " 1839 <<
"\n Element: " << n
1840 <<
"\n" << e.what();
1841 throw runtime_error(os.str());
1906 agfield.resize(nelem);
1911 for (n = 0; n < nelem; n++)
1914 catch (runtime_error e)
1917 os <<
"Error reading ArrayOfGriddedField3: " 1918 <<
"\n Element: " << n
1919 <<
"\n" << e.what();
1920 throw runtime_error(os.str());
1985 aagfield.resize(nelem);
1990 for (n = 0; n < nelem; n++)
1993 catch (runtime_error e)
1996 os <<
"Error reading ArrayOfArrayOfGriddedField1: " 1997 <<
"\n Element: " << n
1998 <<
"\n" << e.what();
1999 throw runtime_error(os.str());
2064 aagfield.resize(nelem);
2069 for (n = 0; n < nelem; n++)
2072 catch (runtime_error e)
2075 os <<
"Error reading ArrayOfArrayOfGriddedField2: " 2076 <<
"\n Element: " << n
2077 <<
"\n" << e.what();
2078 throw runtime_error(os.str());
2143 aagfield.resize(nelem);
2148 for (n = 0; n < nelem; n++)
2151 catch (runtime_error e)
2154 os <<
"Error reading ArrayOfArrayOfGriddedField3: " 2155 <<
"\n Element: " << n
2156 <<
"\n" << e.what();
2157 throw runtime_error(os.str());
2222 agfield.resize(nelem);
2227 for (n = 0; n < nelem; n++)
2230 catch (runtime_error e)
2233 os <<
"Error reading ArrayOfGriddedField4: " 2234 <<
"\n Element: " << n
2235 <<
"\n" << e.what();
2236 throw runtime_error(os.str());
2306 for (n = 0; n < nelem; n++)
2309 catch (runtime_error e)
2312 os <<
"Error reading ArrayOfLineMixingRecord: " 2313 <<
"\n Element: " << n
2314 <<
"\n" << e.what();
2315 throw runtime_error(os.str());
2381 aalmr.resize(nelem);
2386 for (n = 0; n < nelem; n++)
2389 catch (runtime_error e)
2392 os <<
"Error reading ArrayOfArrayOfLineMixingRecord: " 2393 <<
"\n Element: " << n
2394 <<
"\n" << e.what();
2395 throw runtime_error(os.str());
2487 Index artscat_version;
2491 artscat_version = 3;
2493 else if (version.substr(0, 8) !=
"ARTSCAT-")
2496 os <<
"The ARTS line file you are trying to read does not contain a valid version tag.\n" 2497 <<
"Probably it was created with an older version of ARTS that used different units.";
2498 throw runtime_error(os.str());
2502 istringstream is(version.substr(8));
2503 is >> artscat_version;
2506 if (artscat_version < 3 or artscat_version > 4)
2509 os <<
"Unknown ARTS line file version: " << version;
2510 throw runtime_error(os.str());
2518 for (n = 0; n < nelem; n++)
2521 switch (artscat_version)
2525 throw runtime_error(
"Cannot read line from file");
2529 throw runtime_error(
"Cannot read line from file");
2532 throw runtime_error(
"Programmer error. This should never be reached.\n" 2533 "Fix version number check above!");
2537 if ((isnan(fmin) || fmin <= lr.
F()) && (isnan(fmax) || lr.
F() <= fmax))
2538 alrecord.push_back(lr);
2541 catch (runtime_error e)
2544 os <<
"Error reading ArrayOfLineRecord: " 2545 <<
"\n Element: " << n
2546 <<
"\n" << e.what();
2547 throw runtime_error(os.str());
2550 out2 <<
" Read " << alrecord.
nelem() <<
" out of " << nelem <<
" lines.\n";
2576 open_tag.
set_name(
"ArrayOfLineRecord");
2580 if (alrecord.
nelem())
2582 catalog_version = alrecord[0].Version();
2583 open_tag.
add_attribute(
"version", alrecord[0].VersionString());
2595 for (ArrayOfLineRecord::const_iterator it = alrecord.begin();
2596 it != alrecord.end();
2599 if (catalog_version != it->Version())
2602 os <<
"This ArrayOfLineRecords contains a mixture of lines from different\n" 2603 <<
"ARTS catalog versions (writing ARTSCAT-" << catalog_version
2604 <<
", this LineRecord is ARTSCAT-" << it->Version() <<
").\n" 2605 <<
"Writing them to the same catalog file is unsupported." 2606 <<
"The offending LineRecord is: \n" << *it;
2608 throw runtime_error(os.str());
2610 os_xml << *it <<
"\n";
2613 close_tag.
set_name(
"/ArrayOfLineRecord");
2641 aalrecord.resize(nelem);
2646 for (n = 0; n < nelem; n++)
2649 catch (runtime_error e)
2652 os <<
"Error reading ArrayOfArrayOfLineRecord: " 2653 <<
"\n Element: " << n
2654 <<
"\n" << e.what();
2655 throw runtime_error(os.str());
2690 for (
Index n = 0; n < aalrecord.
nelem(); n++)
2714 throw runtime_error(
"Boo. Not yet implemented.");
2733 throw runtime_error(
"Boo. Not yet implemented.");
2758 atensor3.resize(nelem);
2763 for (n = 0; n < nelem; n++)
2766 catch (runtime_error e)
2769 os <<
"Error reading ArrayOfTensor3: " 2770 <<
"\n Element: " << n
2771 <<
"\n" << e.what();
2772 throw runtime_error(os.str());
2839 atensor4.resize(nelem);
2844 for (n = 0; n < nelem; n++)
2847 catch (runtime_error e)
2850 os <<
"Error reading ArrayOfTensor4: " 2851 <<
"\n Element: " << n
2852 <<
"\n" << e.what();
2853 throw runtime_error(os.str());
2920 atensor6.resize(nelem);
2925 for (n = 0; n < nelem; n++)
2928 catch (runtime_error e)
2931 os <<
"Error reading ArrayOfTensor6: " 2932 <<
"\n Element: " << n
2933 <<
"\n" << e.what();
2934 throw runtime_error(os.str());
2999 atensor7.resize(nelem);
3004 for (n = 0; n < nelem; n++)
3007 catch (runtime_error e)
3010 os <<
"Error reading ArrayOfTensor7: " 3011 <<
"\n Element: " << n
3012 <<
"\n" << e.what();
3013 throw runtime_error(os.str());
3077 astring.resize(nelem);
3082 for (n = 0; n < nelem; n++)
3085 catch (runtime_error e)
3088 os <<
"Error reading ArrayOfString: " 3089 <<
"\n Element: " << n
3090 <<
"\n" << e.what();
3091 throw runtime_error(os.str());
3175 avector.resize(nelem);
3180 for (n = 0; n < nelem; n++)
3183 catch (runtime_error e)
3186 os <<
"Error reading ArrayOfVector: " 3187 <<
"\n Element: " << n
3188 <<
"\n" << e.what();
3189 throw runtime_error(os.str());
INDEX Index
The type to use for all integer numbers and indices.
void add_attribute(const String &aname, const String &value)
Adds a String attribute to tag.
Index nelem() const
Number of elements.
void read_from_stream(istream &is)
Reads next XML tag.
bool ReadFromArtscat3Stream(istream &is, const Verbosity &verbosity)
Read one line from a stream associated with an ARTSCAT-3 file.
Declarations required for the calculation of jacobians.
This file contains private function declarations and template instantiation to handle XML data files...
The implementation for String, the ARTS string class.
The global header file for ARTS.
Index Version() const
Return the version number.
void xml_read_from_stream(istream &is_xml, Array< SpeciesRecord > &asrecord, bifstream *pbifs, const Verbosity &verbosity)
Reads SpeciesData from XML input stream.
void xml_write_to_stream(ostream &os_xml, const Array< SpeciesRecord > &asrecord, bofstream *pbofs, const String &name, const Verbosity &verbosity)
Writes SpeciesData to XML output stream.
void set_name(const String &new_name)
Binary output file stream class.
String VersionString() const
Return the version String.
NUMERIC Numeric
The type to use for all floating point numbers.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
void check_name(const String &expected_name)
Check tag name.
This can be used to make arrays out of anything.
bool ReadFromArtscat4Stream(istream &is, const Verbosity &verbosity)
Read one line from a stream associated with an ARTSCAT-4 file.
void check_attribute(const String &aname, const String &value)
Checks whether attribute has the expected value.
void xml_parse_from_stream(istream &is_xml, ArrayOfString &astring, bifstream *pbifs, ArtsXMLTag &tag, const Verbosity &verbosity)
Parse ArrayOfString from XML input stream.
Binary output file stream class.
This file contains private function declarations and template instantiation to handle XML data files...
Numeric F() const
The line center frequency in Hz.
Spectral line catalog data.
void write_to_stream(ostream &os)
Write XML tag.