123 matrix.
resize(nrows, ncols);
126 for (
Index c = 0; c < ncols; c++) {
128 *pbifs >> matrix(
r, c);
132 <<
"\n Row : " <<
r <<
"\n Column: " << c;
140 <<
"\n Row : " <<
r <<
"\n Column: " << c;
179 *pbofs << matrix(
r, 0);
181 os_xml << matrix(
r, 0);
183 for (
Index c = 1; c < matrix.ncols(); ++c) {
185 *pbofs << matrix(
r, c);
187 os_xml <<
" " << matrix(
r, c);
190 if (!pbofs) os_xml <<
'\n';
340 Index nrows, ncols, nnz;
347 sparse.
resize(nrows, ncols);
362 <<
"\n Row index: " <<
i;
370 <<
"\n Row index: " <<
i;
387 <<
"\n Column index: " <<
i;
395 <<
"\n Column index: " <<
i;
412 <<
"\n Data element: " <<
i;
420 <<
"\n Data element: " <<
i;
481 os_xml << rowind[
i] <<
'\n';
498 os_xml << colind[
i] <<
'\n';
515 os_xml << data[
i] <<
' ';
548 bool string_starts_with_quotes =
true;
559 string_starts_with_quotes =
false;
561 }
while (is_xml.good() && dummy !=
'"' && string_starts_with_quotes);
564 if (!string_starts_with_quotes) {
569 dummy = (char)is_xml.peek();
575 is_xml.get(strbuf,
'"');
610 os_xml <<
'\"' << str <<
'\"';
630 Index npages, nrows, ncols;
638 tensor.
resize(npages, nrows, ncols);
640 for (
Index p = 0; p < npages; p++) {
642 for (
Index c = 0; c < ncols; c++) {
644 *pbifs >> tensor(p,
r, c);
648 <<
"\n Page : " << p <<
"\n Row : " <<
r 649 <<
"\n Column: " << c;
657 <<
"\n Page : " << p <<
"\n Row : " <<
r 658 <<
"\n Column: " << c;
700 *pbofs << tensor(p,
r, 0);
702 os_xml << tensor(p,
r, 0);
703 for (
Index c = 1; c < tensor.ncols(); ++c) {
705 *pbofs << tensor(p,
r, c);
707 os_xml <<
" " << tensor(p,
r, c);
709 if (!pbofs) os_xml <<
'\n';
732 Index nbooks, npages, nrows, ncols;
741 tensor.
resize(nbooks, npages, nrows, ncols);
743 for (
Index b = 0; b < nbooks; b++) {
744 for (
Index p = 0; p < npages; p++) {
746 for (
Index c = 0; c < ncols; c++) {
748 *pbifs >> tensor(b, p,
r, c);
752 <<
"\n Book : " << b <<
"\n Page : " << p
753 <<
"\n Row : " <<
r <<
"\n Column: " << c;
761 <<
"\n Book : " << b <<
"\n Page : " << p
762 <<
"\n Row : " <<
r <<
"\n Column: " << c;
807 *pbofs << tensor(b, p,
r, 0);
809 os_xml << tensor(b, p,
r, 0);
810 for (
Index c = 1; c < tensor.ncols(); ++c) {
812 *pbofs << tensor(b, p,
r, c);
814 os_xml <<
" " << tensor(b, p,
r, c);
816 if (!pbofs) os_xml <<
'\n';
840 Index nshelves, nbooks, npages, nrows, ncols;
850 tensor.
resize(nshelves, nbooks, npages, nrows, ncols);
852 for (
Index s = 0; s < nshelves; s++) {
853 for (
Index b = 0; b < nbooks; b++) {
854 for (
Index p = 0; p < npages; p++) {
856 for (
Index c = 0; c < ncols; c++) {
858 *pbifs >> tensor(s, b, p,
r, c);
862 <<
"\n Shelf : " << s <<
"\n Book : " << b
863 <<
"\n Page : " << p <<
"\n Row : " <<
r 864 <<
"\n Column: " << c;
872 <<
"\n Shelf : " << s <<
"\n Book : " << b
873 <<
"\n Page : " << p <<
"\n Row : " <<
r 874 <<
"\n Column: " << c;
922 *pbofs << tensor(s, b, p,
r, 0);
924 os_xml << tensor(s, b, p,
r, 0);
925 for (
Index c = 1; c < tensor.ncols(); ++c) {
927 *pbofs << tensor(s, b, p,
r, c);
929 os_xml <<
" " << tensor(s, b, p,
r, c);
931 if (!pbofs) os_xml <<
'\n';
956 Index nvitrines, nshelves, nbooks, npages, nrows, ncols;
967 tensor.
resize(nvitrines, nshelves, nbooks, npages, nrows, ncols);
969 for (
Index v = 0; v < nvitrines; v++) {
970 for (
Index s = 0; s < nshelves; s++) {
971 for (
Index b = 0; b < nbooks; b++) {
972 for (
Index p = 0; p < npages; p++) {
974 for (
Index c = 0; c < ncols; c++) {
976 *pbifs >> tensor(v, s, b, p,
r, c);
980 <<
"\n Vitrine: " << v <<
"\n Shelf : " << s
981 <<
"\n Book : " << b <<
"\n Page : " << p
982 <<
"\n Row : " <<
r <<
"\n Column : " << c;
990 <<
"\n Vitrine: " << v <<
"\n Shelf : " << s
991 <<
"\n Book : " << b <<
"\n Page : " << p
992 <<
"\n Row : " <<
r <<
"\n Column : " << c;
1043 *pbofs << tensor(v, s, b, p,
r, 0);
1045 os_xml << tensor(v, s, b, p,
r, 0);
1046 for (
Index c = 1; c < tensor.ncols(); ++c) {
1048 *pbofs << tensor(v, s, b, p,
r, c);
1050 os_xml <<
" " << tensor(v, s, b, p,
r, c);
1052 if (!pbofs) os_xml <<
'\n';
1078 Index nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols;
1090 tensor.
resize(nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols);
1092 for (
Index l = 0; l < nlibraries; l++) {
1093 for (
Index v = 0; v < nvitrines; v++) {
1094 for (
Index s = 0; s < nshelves; s++) {
1095 for (
Index b = 0; b < nbooks; b++) {
1096 for (
Index p = 0; p < npages; p++) {
1097 for (
Index r = 0;
r < nrows;
r++) {
1098 for (
Index c = 0; c < ncols; c++) {
1100 *pbifs >> tensor(l, v, s, b, p,
r, c);
1101 if (pbifs->fail()) {
1104 <<
"\n Library: " << l <<
"\n Vitrine: " << v
1105 <<
"\n Shelf : " << s <<
"\n Book : " << b
1106 <<
"\n Page : " << p <<
"\n Row : " <<
r 1107 <<
"\n Column : " << c;
1112 if (is_xml.fail()) {
1115 <<
"\n Library: " << l <<
"\n Vitrine: " << v
1116 <<
"\n Shelf : " << s <<
"\n Book : " << b
1117 <<
"\n Page : " << p <<
"\n Row : " <<
r 1118 <<
"\n Column : " << c;
1172 *pbofs << tensor(l, v, s, b, p,
r, 0);
1174 os_xml << tensor(l, v, s, b, p,
r, 0);
1175 for (
Index c = 1; c < tensor.ncols(); ++c) {
1177 *pbofs << tensor(l, v, s, b, p,
r, c);
1179 os_xml <<
" " << tensor(l, v, s, b, p,
r, c);
1181 if (!pbofs) os_xml <<
'\n';
1216 *pbifs >> vector[
n];
1217 if (pbifs->fail()) {
1220 <<
"\n Element: " <<
n;
1225 if (is_xml.fail()) {
1228 <<
"\n Element: " <<
n;
1287 *pbofs << vector[
i];
1289 os_xml << vector[
i] <<
'\n';
1310 Index stokes_dim, nf;
1320 if (pbifs->fail()) {
1322 os <<
"TransmissionMatrix has wrong dimensions";
1327 if (is_xml.fail()) {
1329 os <<
"TransmissionMatrix has wrong dimensions";
1353 open_tag.
set_name(
"TransmissionMatrix");
1367 close_tag.
set_name(
"/TransmissionMatrix");
1386 Index stokes_dim, nf;
1396 if (pbifs->fail()) {
1398 os <<
"RadiationVector has wrong dimensions";
1403 if (is_xml.fail()) {
1405 os <<
"RadiationVector has wrong dimensions";
1429 open_tag.
set_name(
"RadiationVector");
1443 close_tag.
set_name(
"/RadiationVector");
1468 if (version == 1) {}
1470 throw std::runtime_error(
"Your version of ARTS can only handle version 1 of Time");
1474 throw std::runtime_error(
"Cannot read binary Time");
1477 if (is_xml.fail()) {
1507 throw std::runtime_error(
"Cannot write binary time");
1509 os_xml <<
' ' << t <<
' ';
1579 std::vector<QuantumNumberType> localquanta;
1590 bool selfbroadening;
1591 bool bathbroadening;
1592 tag.
get_attribute_value(
"broadeningspecies", broadeningspecies, selfbroadening, bathbroadening);
1599 nlines, cutoff, mirroring,
1600 population, normalization,
1601 lineshapetype, T0, cutofffreq,
1603 spec.
Isotopologue(), upperglobalquanta, lowerglobalquanta),
1604 localquanta, broadeningspecies, metamodel);
1608 if (pbifs->fail()) {
1610 os <<
"AbsorptionLines has wrong dimensions";
1615 if (is_xml.fail()) {
1617 os <<
"AbsorptionLines has wrong dimensions";
1640 open_comment_tag.
set_name(
"comment");
1643 close_comment_tag.
set_name(
"/comment");
1650 open_tag.
set_name(
"AbsorptionLines");
1676 close_tag.
set_name(
"/AbsorptionLines");
1693 throw runtime_error(
"Method not implemented!");
1701 throw runtime_error(
"Method not implemented!");
Index npages() const
Returns the number of pages.
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.
Class to keep track of Transmission Matrices for Stokes Dim 1-4.
Index nnz() const
Returns the number of nonzero elements.
Index nrows() const
Returns the number of rows.
Index Frequencies() const
Number of frequencies.
const ArrayOfSpeciesTag & BroadeningSpecies() const noexcept
Returns the broadening species.
Numeric T0() const noexcept
Returns reference temperature.
MirroringType
Describes the type of mirroring line effects.
String LowerQuantumNumbers() const noexcept
Lower quantum numbers string.
bofstream & write(bofstream &os) const
Binary write for Lines.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
void read_from_stream(istream &is)
Reads next XML tag.
NormalizationType
Describes the type of normalization line effects.
void xml_parse_from_stream(istream &is_xml, Vector &vector, bifstream *pbifs, ArtsXMLTag &tag, const Verbosity &)
Parses Vector from XML input stream.
Index Species() const
Molecular species index.
Index nvitrines() const
Returns the number of vitrines.
String UpperQuantumNumbers() const noexcept
Upper quantum numbers string.
Numeric LinemixingLimit() const noexcept
Returns line mixing limit.
Class to handle time in ARTS.
Index nrows() const
Returns the number of rows.
Index npages() const
Returns the number of pages.
String mirroringtype2string(MirroringType in)
Index ncols() const
Returns the number of columns.
MirroringType string2mirroringtype(const String &in)
Index Version() const noexcept
Index NumLines() const noexcept
Number of lines.
This file contains private function declarations and template instantiation to handle XML data files...
This file contains basic functions to handle XML data files.
Index StokesDim() const
Stokes dimensionaility.
This file contains basic functions to handle ASCII files.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Index nrows() const
Returns the number of rows.
PopulationType Population() const noexcept
Returns population style.
Index nelem() const
Returns the number of elements.
bool Self() const noexcept
Returns self broadening status.
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
CutoffType
Describes the type of cutoff calculations.
Index ncols() const
Returns the number of columns.
The global header file for ARTS.
Index nshelves() const
Returns the number of shelves.
void xml_set_stream_precision(ostream &os)
String normalizationtype2string(NormalizationType in)
_CS_string_type str() const
void set_name(const String &new_name)
Index ncols() const
Returns the number of columns.
CutoffType string2cutofftype(const String &in)
const std::vector< QuantumNumberType > & LocalQuanta() const noexcept
Returns local quantum numbers.
String cutofftype2string(CutoffType in)
Binary output file stream class.
Implements rational numbers to work with other ARTS types.
bool Bath() const noexcept
Returns bath broadening status.
void xml_read_from_stream(istream &is_xml, Index &index, bifstream *pbifs, const Verbosity &verbosity)
Reads Index from XML input stream.
Index nrows() const
Returns the number of rows.
A tag group can consist of the sum of several of these.
String populationtype2string(PopulationType in)
Index StokesDim() const
Get Stokes dimension.
Index nrows() const
Returns the number of rows.
Class to identify and match lines by their quantum numbers.
PopulationType string2populationtype(const String &in)
NUMERIC Numeric
The type to use for all floating point numbers.
Index nlibraries() const
Returns the number of libraries.
Index Frequencies() const
Get frequency count.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
PopulationType
Describes the type of population level counter.
Radiation Vector for Stokes dimension 1-4.
String shapetype2string(Type type) noexcept
Turns selected Type into a string.
void resize(Index p, Index r, Index c)
Resize function.
Numeric CutoffFreqValue() const noexcept
Returns internal cutoff frequency value.
Container class for Quantum Numbers.
void check_name(const String &expected_name)
Check tag name.
Index npages() const
Returns the number of pages.
This can be used to make arrays out of anything.
Index nshelves() const
Returns the number of shelves.
Index ncols() const
Returns the number of columns.
NormalizationType Normalization() const noexcept
Returns normalization style.
basic_string< _CS_cT, _CS_traits, _CS_alloc > str() const
NormalizationType string2normalizationtype(const String &in)
void resize(Index n)
Resize function.
Absorption::Lines AbsorptionLines
Index npages() const
Returns the number of pages.
Index nshelves() const
Returns the number of shelves.
Index nelem(const Lines &l)
Number of lines.
MirroringType Mirroring() const noexcept
Returns mirroring style.
Binary output file stream class.
void list_elements(Vector &values, ArrayOfIndex &row_indices, ArrayOfIndex &column_indices) const
List elements in matrix.
void xml_write_to_stream(ostream &os_xml, const Index &index, bofstream *pbofs, const String &name, const Verbosity &verbosity)
Writes Index to XML output stream.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
void resize(Index r, Index c)
Resize function.
Index ncols() const
Returns the number of columns.
Index nvitrines() const
Returns the number of vitrines.
Index ncols() const
Returns the number of columns.
String LineShapeMetaData() const noexcept
Meta data for the line shape if it exists.
Index ncols() const
Returns the number of columns.
bifstream & read(bifstream &is)
Binary read for Lines.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
This file contains private function declarations and template instantiation to handle XML data files...
CutoffType Cutoff() const noexcept
Returns cutoff style.
String SpeciesName() const noexcept
Species Name.
Index Isotopologue() const
Isotopologue species index.
Index nrows() const
Returns the number of rows.
Type string2shapetype(const String &type)
Turns predefined strings into a Type.
Index nbooks() const
Returns the number of books.
void xml_data_parse_error(ArtsXMLTag &tag, String str_error)
Throws XML parser runtime error.
LineShape::Type LineShapeType() const noexcept
Returns lineshapetype style.
Input manipulator class for doubles to enable nan and inf parsing.
void resize(Index b, Index p, Index r, Index c)
Resize function.
void insert_elements(Index nnz, const ArrayOfIndex &rowind, const ArrayOfIndex &colind, ConstVectorView data)
Insert vector of elements with given row and column indices.
void write_to_stream(ostream &os)
Write XML tag.
void resize(Index r, Index c)
Resize function.
String MetaData() const
Returns a printable statement about the lines.
Model MetaData2ModelShape(const String &s)
Index nbooks() const
Returns the number of books.