ARTS  2.2.66
xml_io_compound_types.cc
Go to the documentation of this file.
1 /* Copyright (C) 2003-2012 Oliver Lemke <olemke@core-dump.info>
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 
18 
20 // File description
22 
30 #include "arts.h"
31 #include "xml_io_private.h"
32 #include "xml_io_types.h"
33 #include "matpackI.h"
34 #include "matpackII.h"
35 #include "matpackIII.h"
36 #include "matpackIV.h"
37 #include "matpackV.h"
38 #include "matpackVI.h"
39 #include "matpackVII.h"
40 #include "gridded_fields.h"
41 #include "jacobian.h"
42 #include "global_data.h"
43 
44 
46 // Overloaded functions for reading/writing data from/to XML stream
48 
49 
50 //=== CIARecord ================================================
51 
53 
58 void xml_read_from_stream(istream& is_xml,
59  CIARecord& cr,
60  bifstream* pbifs,
61  const Verbosity& verbosity)
62 {
63  ArtsXMLTag tag(verbosity);
64  String name;
65  String molecule1;
66  String molecule2;
67  Index species1;
68  Index species2;
69 
70  tag.read_from_stream(is_xml);
71  tag.check_name("CIARecord");
72  tag.get_attribute_value("molecule1", molecule1);
73  tag.get_attribute_value("molecule2", molecule2);
74 
75  species1 = species_index_from_species_name(molecule1);
76  species2 = species_index_from_species_name(molecule2);
77 
78  if (species1 == -1)
79  {
80  ostringstream os;
81  os << "Unknown species (1st molecule) in CIARecord: " << molecule1;
82  throw runtime_error(os.str());
83  }
84  if (species2 == -1)
85  {
86  ostringstream os;
87  os << "Unknown species (2nd molecule) in CIARecord: " << molecule2;
88  throw runtime_error(os.str());
89  }
90 
91  cr.SetSpecies(species1, species2);
92 
93  xml_read_from_stream(is_xml, cr.mdata, pbifs, verbosity);
94 
95  tag.read_from_stream(is_xml);
96  tag.check_name("/CIARecord");
97 }
98 
99 
101 
107 void xml_write_to_stream(ostream& os_xml,
108  const CIARecord& cr,
109  bofstream* pbofs,
110  const String& name _U_, const Verbosity& verbosity)
111 {
112  ArtsXMLTag open_tag(verbosity);
113  ArtsXMLTag close_tag(verbosity);
114 
115  open_tag.set_name("CIARecord");
116  open_tag.add_attribute("molecule1", cr.MoleculeName(0));
117  open_tag.add_attribute("molecule2", cr.MoleculeName(1));
118  open_tag.write_to_stream(os_xml);
119  os_xml << '\n';
120 
121  xml_write_to_stream(os_xml, cr.Data(), pbofs, "", verbosity);
122 
123  close_tag.set_name("/CIARecord");
124  close_tag.write_to_stream(os_xml);
125  os_xml << '\n';
126 }
127 
128 
129 
130 //=== GasAbsLookup ===========================================================
131 
133 
138 void xml_read_from_stream(istream& is_xml,
139  GasAbsLookup& gal,
140  bifstream* pbifs, const Verbosity& verbosity)
141 {
142  ArtsXMLTag tag(verbosity);
143 
144  tag.read_from_stream(is_xml);
145  tag.check_name("GasAbsLookup");
146 
147  xml_read_from_stream(is_xml, gal.species, pbifs, verbosity);
148  xml_read_from_stream(is_xml, gal.nonlinear_species, pbifs, verbosity);
149  xml_read_from_stream(is_xml, gal.f_grid, pbifs, verbosity);
150  xml_read_from_stream(is_xml, gal.p_grid, pbifs, verbosity);
151  xml_read_from_stream(is_xml, gal.vmrs_ref, pbifs, verbosity);
152  xml_read_from_stream(is_xml, gal.t_ref, pbifs, verbosity);
153  xml_read_from_stream(is_xml, gal.t_pert, pbifs, verbosity);
154  xml_read_from_stream(is_xml, gal.nls_pert, pbifs, verbosity);
155  xml_read_from_stream(is_xml, gal.xsec, pbifs, verbosity);
156 
157  tag.read_from_stream(is_xml);
158  tag.check_name("/GasAbsLookup");
159 }
160 
161 
163 
169 void xml_write_to_stream(ostream& os_xml,
170  const GasAbsLookup& gal,
171  bofstream* pbofs,
172  const String& name, const Verbosity& verbosity)
173 {
174  ArtsXMLTag open_tag(verbosity);
175  ArtsXMLTag close_tag(verbosity);
176 
177  open_tag.set_name("GasAbsLookup");
178  if (name.length())
179  open_tag.add_attribute("name", name);
180  open_tag.write_to_stream(os_xml);
181 
182  xml_write_to_stream(os_xml, gal.species, pbofs, "", verbosity);
183  xml_write_to_stream(os_xml, gal.nonlinear_species, pbofs,
184  "NonlinearSpecies", verbosity);
185  xml_write_to_stream(os_xml, gal.f_grid, pbofs, "FrequencyGrid", verbosity);
186  xml_write_to_stream(os_xml, gal.p_grid, pbofs, "PressureGrid", verbosity);
187  xml_write_to_stream(os_xml, gal.vmrs_ref, pbofs, "ReferenceVmrProfiles", verbosity);
188  xml_write_to_stream(os_xml, gal.t_ref, pbofs, "ReferenceTemperatureProfile", verbosity);
189  xml_write_to_stream(os_xml, gal.t_pert, pbofs, "TemperaturePertubations", verbosity);
190  xml_write_to_stream(os_xml, gal.nls_pert, pbofs,
191  "NonlinearSpeciesVmrPertubations", verbosity);
192  xml_write_to_stream(os_xml, gal.xsec, pbofs, "AbsorptionCrossSections", verbosity);
193 
194  close_tag.set_name("/GasAbsLookup");
195  close_tag.write_to_stream(os_xml);
196  os_xml << '\n';
197 }
198 
199 
200 //=== GriddedField ===========================================================
201 
203 
208 void xml_read_from_stream(istream& is_xml,
209  GriddedField& gfield,
210  bifstream* pbifs, const Verbosity& verbosity)
211 {
212  ArtsXMLTag tag(verbosity);
213 
214  for (Index i = 0; i < gfield.get_dim(); i++)
215  {
216  tag.read_from_stream(is_xml);
217  if (tag.get_name() == "Vector")
218  {
219  String s;
220  tag.get_attribute_value("name", s);
221  if (s.length())
222  gfield.set_grid_name(i, s);
223 
224  Vector v;
225  xml_parse_from_stream(is_xml, v, pbifs, tag, verbosity);
226  gfield.set_grid(i, v);
227  tag.read_from_stream(is_xml);
228  tag.check_name("/Vector");
229  }
230  else if (tag.get_name() == "Array")
231  {
232  String s;
233  tag.get_attribute_value("name", s);
234  if (s.length())
235  gfield.set_grid_name(i, s);
236 
237  tag.get_attribute_value("type", s);
238  if (s == "String")
239  {
240  ArrayOfString as;
241  xml_parse_from_stream(is_xml, as, pbifs, tag, verbosity);
242  gfield.set_grid(i, as);
243  tag.read_from_stream(is_xml);
244  tag.check_name("/Array");
245 
246  }
247  else
248  {
249  xml_parse_error("Grids must be of type <Vector> or <ArrayOfString> but <ArrayOf"
250  + s + "> found.");
251  }
252  }
253  else
254  {
255  xml_parse_error("Grids must be of type <Vector> or <ArrayOfString> but <"
256  + tag.get_name() + "> found.");
257  }
258  }
259 }
260 
261 
263 
268 void xml_write_to_stream(ostream& os_xml,
269  const GriddedField& gfield,
270  bofstream* pbofs,
271  const String& /* name */,
272  const Verbosity& verbosity)
273 {
274  for (Index i = 0; i < gfield.get_dim(); i++)
275  {
276  switch (gfield.get_grid_type(i))
277  {
278  case GRID_TYPE_NUMERIC:
279  xml_write_to_stream(os_xml, gfield.get_numeric_grid(i),
280  pbofs, gfield.get_grid_name(i), verbosity);
281  break;
282  case GRID_TYPE_STRING:
283  xml_write_to_stream(os_xml, gfield.get_string_grid(i),
284  pbofs, gfield.get_grid_name(i), verbosity);
285  break;
286  }
287  }
288 }
289 
290 
291 //=== GriddedField1 ===========================================================
292 
294 
299 void xml_read_from_stream(istream& is_xml,
300  GriddedField1& gfield,
301  bifstream* pbifs, const Verbosity& verbosity)
302 {
303  ArtsXMLTag tag(verbosity);
304 
305  tag.read_from_stream(is_xml);
306  tag.check_name("GriddedField1");
307 
308  String s;
309  tag.get_attribute_value("name", s);
310  if (s.length())
311  gfield.set_name(s);
312 
313  xml_read_from_stream(is_xml, *((GriddedField*)&gfield), pbifs, verbosity);
314  xml_read_from_stream(is_xml, gfield.data, pbifs, verbosity);
315 
316  tag.read_from_stream(is_xml);
317  tag.check_name("/GriddedField1");
318 
319  gfield.checksize_strict();
320 }
321 
322 
324 
330 void xml_write_to_stream(ostream& os_xml,
331  const GriddedField1& gfield,
332  bofstream* pbofs,
333  const String& name, const Verbosity& verbosity)
334 {
335  ArtsXMLTag open_tag(verbosity);
336  ArtsXMLTag close_tag(verbosity);
337 
338  open_tag.set_name("GriddedField1");
339  if (!name.length() && (gfield.get_name().length()))
340  open_tag.add_attribute("name", gfield.get_name());
341  else if (name.length())
342  open_tag.add_attribute("name", name);
343 
344  open_tag.write_to_stream(os_xml);
345  os_xml << '\n';
346 
347  xml_write_to_stream(os_xml, *((GriddedField*)&gfield), pbofs, "", verbosity);
348  xml_write_to_stream(os_xml, gfield.data, pbofs, "Data", verbosity);
349 
350  close_tag.set_name("/GriddedField1");
351  close_tag.write_to_stream(os_xml);
352  os_xml << '\n';
353 }
354 
355 
356 //=== GriddedField2 ===========================================================
357 
359 
364 void xml_read_from_stream(istream& is_xml,
365  GriddedField2& gfield,
366  bifstream* pbifs, const Verbosity& verbosity)
367 {
368  ArtsXMLTag tag(verbosity);
369 
370  tag.read_from_stream(is_xml);
371  tag.check_name("GriddedField2");
372 
373  String s;
374  tag.get_attribute_value("name", s);
375  if (s.length())
376  gfield.set_name(s);
377 
378  xml_read_from_stream(is_xml, *((GriddedField*)&gfield), pbifs, verbosity);
379  xml_read_from_stream(is_xml, gfield.data, pbifs, verbosity);
380 
381  tag.read_from_stream(is_xml);
382  tag.check_name("/GriddedField2");
383 
384  gfield.checksize_strict();
385 }
386 
387 
389 
395 void xml_write_to_stream(ostream& os_xml,
396  const GriddedField2& gfield,
397  bofstream* pbofs,
398  const String& name, const Verbosity& verbosity)
399 {
400  ArtsXMLTag open_tag(verbosity);
401  ArtsXMLTag close_tag(verbosity);
402 
403  open_tag.set_name("GriddedField2");
404  if (!name.length() && (gfield.get_name().length()))
405  open_tag.add_attribute("name", gfield.get_name());
406  else if (name.length())
407  open_tag.add_attribute("name", name);
408 
409  open_tag.write_to_stream(os_xml);
410  os_xml << '\n';
411 
412  xml_write_to_stream(os_xml, *((GriddedField*)&gfield), pbofs, "", verbosity);
413  xml_write_to_stream(os_xml, gfield.data, pbofs, "Data", verbosity);
414 
415  close_tag.set_name("/GriddedField2");
416  close_tag.write_to_stream(os_xml);
417  os_xml << '\n';
418 }
419 
420 
421 //=== GriddedField3 ===========================================================
422 
424 
429 void xml_read_from_stream(istream& is_xml,
430  GriddedField3& gfield,
431  bifstream* pbifs, const Verbosity& verbosity)
432 {
433  ArtsXMLTag tag(verbosity);
434 
435  tag.read_from_stream(is_xml);
436  tag.check_name("GriddedField3");
437 
438  String s;
439  tag.get_attribute_value("name", s);
440  if (s.length())
441  gfield.set_name(s);
442 
443  xml_read_from_stream(is_xml, *((GriddedField*)&gfield), pbifs, verbosity);
444  xml_read_from_stream(is_xml, gfield.data, pbifs, verbosity);
445 
446  tag.read_from_stream(is_xml);
447  tag.check_name("/GriddedField3");
448 
449  gfield.checksize_strict();
450 }
451 
452 
454 
460 void xml_write_to_stream(ostream& os_xml,
461  const GriddedField3& gfield,
462  bofstream* pbofs,
463  const String& name, const Verbosity& verbosity)
464 {
465  ArtsXMLTag open_tag(verbosity);
466  ArtsXMLTag close_tag(verbosity);
467 
468  open_tag.set_name("GriddedField3");
469  if (!name.length() && (gfield.get_name().length()))
470  open_tag.add_attribute("name", gfield.get_name());
471  else if (name.length())
472  open_tag.add_attribute("name", name);
473 
474  open_tag.write_to_stream(os_xml);
475  os_xml << '\n';
476 
477  xml_write_to_stream(os_xml, *((GriddedField*)&gfield), pbofs, "", verbosity);
478  xml_write_to_stream(os_xml, gfield.data, pbofs, "Data", verbosity);
479 
480  close_tag.set_name("/GriddedField3");
481  close_tag.write_to_stream(os_xml);
482  os_xml << '\n';
483 }
484 
485 
486 //=== GriddedField4 ===========================================================
487 
489 
494 void xml_read_from_stream(istream& is_xml,
495  GriddedField4& gfield,
496  bifstream* pbifs, const Verbosity& verbosity)
497 {
498  ArtsXMLTag tag(verbosity);
499 
500  tag.read_from_stream(is_xml);
501  tag.check_name("GriddedField4");
502 
503  String s;
504  tag.get_attribute_value("name", s);
505  if (s.length())
506  gfield.set_name(s);
507 
508  xml_read_from_stream(is_xml, *((GriddedField*)&gfield), pbifs, verbosity);
509  xml_read_from_stream(is_xml, gfield.data, pbifs, verbosity);
510 
511  tag.read_from_stream(is_xml);
512  tag.check_name("/GriddedField4");
513 
514  gfield.checksize_strict();
515 }
516 
517 
519 
525 void xml_write_to_stream(ostream& os_xml,
526  const GriddedField4& gfield,
527  bofstream* pbofs,
528  const String& name, const Verbosity& verbosity)
529 {
530  ArtsXMLTag open_tag(verbosity);
531  ArtsXMLTag close_tag(verbosity);
532 
533  open_tag.set_name("GriddedField4");
534  if (!name.length() && (gfield.get_name().length()))
535  open_tag.add_attribute("name", gfield.get_name());
536  else if (name.length())
537  open_tag.add_attribute("name", name);
538 
539  open_tag.write_to_stream(os_xml);
540  os_xml << '\n';
541 
542  xml_write_to_stream(os_xml, *((GriddedField*)&gfield), pbofs, "", verbosity);
543  xml_write_to_stream(os_xml, gfield.data, pbofs, "Data", verbosity);
544 
545  close_tag.set_name("/GriddedField4");
546  close_tag.write_to_stream(os_xml);
547  os_xml << '\n';
548 }
549 
550 
551 //=== GriddedField5 ===========================================================
552 
554 
559 void xml_read_from_stream(istream& is_xml,
560  GriddedField5& gfield,
561  bifstream* pbifs, const Verbosity& verbosity)
562 {
563  ArtsXMLTag tag(verbosity);
564 
565  tag.read_from_stream(is_xml);
566  tag.check_name("GriddedField5");
567 
568  String s;
569  tag.get_attribute_value("name", s);
570  if (s.length())
571  gfield.set_name(s);
572 
573  xml_read_from_stream(is_xml, *((GriddedField*)&gfield), pbifs, verbosity);
574  xml_read_from_stream(is_xml, gfield.data, pbifs, verbosity);
575 
576  tag.read_from_stream(is_xml);
577  tag.check_name("/GriddedField5");
578 
579  gfield.checksize_strict();
580 }
581 
582 
584 
590 void xml_write_to_stream(ostream& os_xml,
591  const GriddedField5& gfield,
592  bofstream* pbofs,
593  const String& name, const Verbosity& verbosity)
594 {
595  ArtsXMLTag open_tag(verbosity);
596  ArtsXMLTag close_tag(verbosity);
597 
598  open_tag.set_name("GriddedField5");
599  if (!name.length() && (gfield.get_name().length()))
600  open_tag.add_attribute("name", gfield.get_name());
601  else if (name.length())
602  open_tag.add_attribute("name", name);
603 
604  open_tag.write_to_stream(os_xml);
605  os_xml << '\n';
606 
607  xml_write_to_stream(os_xml, *((GriddedField*)&gfield), pbofs, "", verbosity);
608  xml_write_to_stream(os_xml, gfield.data, pbofs, "Data", verbosity);
609 
610  close_tag.set_name("/GriddedField5");
611  close_tag.write_to_stream(os_xml);
612  os_xml << '\n';
613 }
614 
615 
616 //=== GriddedField6 ===========================================================
617 
619 
624 void xml_read_from_stream(istream& is_xml,
625  GriddedField6& gfield,
626  bifstream* pbifs, const Verbosity& verbosity)
627 {
628  ArtsXMLTag tag(verbosity);
629 
630  tag.read_from_stream(is_xml);
631  tag.check_name("GriddedField6");
632 
633  String s;
634  tag.get_attribute_value("name", s);
635  if (s.length())
636  gfield.set_name(s);
637 
638  xml_read_from_stream(is_xml, *((GriddedField*)&gfield), pbifs, verbosity);
639  xml_read_from_stream(is_xml, gfield.data, pbifs, verbosity);
640 
641  tag.read_from_stream(is_xml);
642  tag.check_name("/GriddedField6");
643 
644  gfield.checksize_strict();
645 }
646 
647 
649 
655 void xml_write_to_stream(ostream& os_xml,
656  const GriddedField6& gfield,
657  bofstream* pbofs,
658  const String& name, const Verbosity& verbosity)
659 {
660  ArtsXMLTag open_tag(verbosity);
661  ArtsXMLTag close_tag(verbosity);
662 
663  open_tag.set_name("GriddedField6");
664  if (!name.length() && (gfield.get_name().length()))
665  open_tag.add_attribute("name", gfield.get_name());
666  else if (name.length())
667  open_tag.add_attribute("name", name);
668 
669  open_tag.write_to_stream(os_xml);
670  os_xml << '\n';
671 
672  xml_write_to_stream(os_xml, *((GriddedField*)&gfield), pbofs, "", verbosity);
673  xml_write_to_stream(os_xml, gfield.data, pbofs, "Data", verbosity);
674 
675  close_tag.set_name("/GriddedField6");
676  close_tag.write_to_stream(os_xml);
677  os_xml << '\n';
678 }
679 
680 
681 //=== GridPos =====================================================
682 
684 
689 void xml_read_from_stream(istream& is_xml,
690  GridPos& gpos,
691  bifstream* pbifs, const Verbosity& verbosity)
692 {
693  ArtsXMLTag tag(verbosity);
694 
695  tag.read_from_stream(is_xml);
696  tag.check_name("GridPos");
697 
698  xml_read_from_stream(is_xml, gpos.idx, pbifs, verbosity);
699  xml_read_from_stream(is_xml, gpos.fd[0], pbifs, verbosity);
700  xml_read_from_stream(is_xml, gpos.fd[1], pbifs, verbosity);
701 
702  tag.read_from_stream(is_xml);
703  tag.check_name("/GridPos");
704 }
705 
706 
708 
714 void xml_write_to_stream(ostream& os_xml,
715  const GridPos& gpos,
716  bofstream* pbofs,
717  const String& name, const Verbosity& verbosity)
718 {
719  ArtsXMLTag open_tag(verbosity);
720  ArtsXMLTag close_tag(verbosity);
721 
722  open_tag.set_name("GridPos");
723  if (name.length())
724  open_tag.add_attribute("name", name);
725  open_tag.write_to_stream(os_xml);
726 
727  xml_write_to_stream(os_xml, gpos.idx, pbofs,
728  "OriginalGridIndexBelowInterpolationPoint", verbosity);
729  xml_write_to_stream(os_xml, gpos.fd[0], pbofs,
730  "FractionalDistanceToNextPoint_1", verbosity);
731  xml_write_to_stream(os_xml, gpos.fd[1], pbofs,
732  "FractionalDistanceToNextPoint_2", verbosity);
733 
734  close_tag.set_name("/GridPos");
735  close_tag.write_to_stream(os_xml);
736  os_xml << '\n';
737 }
738 
739 
740 //=== IsotopologueRecord ================================================
741 
743 
748 void xml_read_from_stream(istream& is_xml,
749  IsotopologueRecord& irecord,
750  bifstream* pbifs, const Verbosity& verbosity)
751 {
752  ArtsXMLTag tag(verbosity);
753  String name;
754  Numeric abundance;
755  Numeric mass;
756  Index mytrantag;
757  Index hitrantag;
758  ArrayOfIndex jpltags;
759 
760  tag.read_from_stream(is_xml);
761  tag.check_name("IsotopologueRecord");
762 
763  xml_read_from_stream(is_xml, name, pbifs, verbosity);
764  xml_read_from_stream(is_xml, abundance, pbifs, verbosity);
765  xml_read_from_stream(is_xml, mass, pbifs, verbosity);
766  xml_read_from_stream(is_xml, mytrantag, pbifs, verbosity);
767  xml_read_from_stream(is_xml, hitrantag, pbifs, verbosity);
768  xml_read_from_stream(is_xml, jpltags, pbifs, verbosity);
769 
770  tag.read_from_stream(is_xml);
771  tag.check_name("/IsotopologueRecord");
772 
773  irecord = IsotopologueRecord(name, abundance, mass, mytrantag, hitrantag,
774  jpltags);
775 }
776 
777 
779 
785 void xml_write_to_stream(ostream& os_xml,
786  const IsotopologueRecord& irecord,
787  bofstream* pbofs,
788  const String& name, const Verbosity& verbosity)
789 {
790  ArtsXMLTag open_tag(verbosity);
791  ArtsXMLTag close_tag(verbosity);
792 
793  open_tag.set_name("IsotopologueRecord");
794  if (name.length())
795  open_tag.add_attribute("name", name);
796  open_tag.write_to_stream(os_xml);
797  os_xml << '\n';
798 
799  xml_write_to_stream(os_xml, irecord.Name(), pbofs, "Name", verbosity);
800  xml_write_to_stream(os_xml, irecord.Abundance(), pbofs, "Abundance", verbosity);
801  xml_write_to_stream(os_xml, irecord.Mass(), pbofs, "Mass", verbosity);
802  xml_write_to_stream(os_xml, irecord.MytranTag(), pbofs, "MytranTag", verbosity);
803  xml_write_to_stream(os_xml, irecord.HitranTag(), pbofs, "HitranTag", verbosity);
804  xml_write_to_stream(os_xml, irecord.JplTags(), pbofs, "JplTags", verbosity);
805 
806  close_tag.set_name("/IsotopologueRecord");
807  close_tag.write_to_stream(os_xml);
808  os_xml << '\n';
809 }
810 
811 
812 //=== LineMixingRecord ================================================
813 
815 
820 void xml_read_from_stream(istream& is_xml,
821  LineMixingRecord& lmr,
822  bifstream* pbifs, const Verbosity& verbosity)
823 {
824  ArtsXMLTag tag(verbosity);
825 
826  tag.read_from_stream(is_xml);
827  tag.check_name("LineMixingRecord");
828 
829  SpeciesTag species_tag;
830 
831  xml_read_from_stream(is_xml, species_tag, pbifs, verbosity);
832  lmr = LineMixingRecord(species_tag.Species(), species_tag.Isotopologue());
833  xml_read_from_stream(is_xml, lmr.Quantum(), pbifs, verbosity);
834  xml_read_from_stream(is_xml, lmr.Data(), pbifs, verbosity);
835 
836  tag.read_from_stream(is_xml);
837  tag.check_name("/LineMixingRecord");
838 }
839 
840 
842 
848 void xml_write_to_stream(ostream& os_xml,
849  const LineMixingRecord& lmr,
850  bofstream* pbofs,
851  const String& name, const Verbosity& verbosity)
852 {
853  ArtsXMLTag open_tag(verbosity);
854  ArtsXMLTag close_tag(verbosity);
855 
856  open_tag.set_name("LineMixingRecord");
857  if (name.length())
858  open_tag.add_attribute("name", name);
859  open_tag.write_to_stream(os_xml);
860  os_xml << '\n';
861 
863  String species_tag = species_name_from_species_index(lmr.Species()) + '-'
864  + species_data[lmr.Species()].Isotopologue()[lmr.Isotopologue()].Name();
865 
866  xml_write_to_stream(os_xml, SpeciesTag(species_tag), pbofs, "", verbosity);
867  xml_write_to_stream(os_xml, lmr.Quantum(), pbofs, "", verbosity);
868  xml_write_to_stream(os_xml, lmr.Data(), pbofs, "", verbosity);
869 
870  close_tag.set_name("/LineMixingRecord");
871  close_tag.write_to_stream(os_xml);
872  os_xml << '\n';
873 }
874 
875 
876 
877 //=== Ppath =====================================================
878 
880 
885 void xml_read_from_stream(istream& is_xml,
886  Ppath& ppath,
887  bifstream* pbifs, const Verbosity& verbosity)
888 {
889  ArtsXMLTag tag(verbosity);
890 
891  tag.read_from_stream(is_xml);
892  tag.check_name("Ppath");
893 
894  xml_read_from_stream(is_xml, ppath.dim, pbifs, verbosity);
895  xml_read_from_stream(is_xml, ppath.np, pbifs, verbosity);
896  xml_read_from_stream(is_xml, ppath.constant, pbifs, verbosity);
897  xml_read_from_stream(is_xml, ppath.background, pbifs, verbosity);
898  xml_read_from_stream(is_xml, ppath.start_pos, pbifs, verbosity);
899  xml_read_from_stream(is_xml, ppath.start_los, pbifs, verbosity);
900  xml_read_from_stream(is_xml, ppath.start_lstep, pbifs, verbosity);
901  xml_read_from_stream(is_xml, ppath.pos, pbifs, verbosity);
902  xml_read_from_stream(is_xml, ppath.los, pbifs, verbosity);
903  xml_read_from_stream(is_xml, ppath.r, pbifs, verbosity);
904  xml_read_from_stream(is_xml, ppath.lstep, pbifs, verbosity);
905  xml_read_from_stream(is_xml, ppath.end_pos, pbifs, verbosity);
906  xml_read_from_stream(is_xml, ppath.end_los, pbifs, verbosity);
907  xml_read_from_stream(is_xml, ppath.end_lstep, pbifs, verbosity);
908  xml_read_from_stream(is_xml, ppath.nreal, pbifs, verbosity);
909  xml_read_from_stream(is_xml, ppath.ngroup, pbifs, verbosity);
910  xml_read_from_stream(is_xml, ppath.gp_p, pbifs, verbosity);
911  xml_read_from_stream(is_xml, ppath.gp_lat, pbifs, verbosity);
912  xml_read_from_stream(is_xml, ppath.gp_lon, pbifs, verbosity);
913 
914  tag.read_from_stream(is_xml);
915  tag.check_name("/Ppath");
916 }
917 
918 
920 
926 void xml_write_to_stream(ostream& os_xml,
927  const Ppath& ppath,
928  bofstream* pbofs,
929  const String& name, const Verbosity& verbosity)
930 {
931  ArtsXMLTag open_tag(verbosity);
932  ArtsXMLTag close_tag(verbosity);
933 
934  open_tag.set_name("Ppath");
935  if (name.length())
936  open_tag.add_attribute("name", name);
937  open_tag.write_to_stream(os_xml);
938 
939  xml_write_to_stream(os_xml, ppath.dim, pbofs, "AtmosphericDimensionality", verbosity);
940  xml_write_to_stream(os_xml, ppath.np, pbofs,
941  "NumberOfPositionInPropagationPath", verbosity);
942  xml_write_to_stream(os_xml, ppath.constant, pbofs,
943  "PropagationPathConstant", verbosity);
944  xml_write_to_stream(os_xml, ppath.background, pbofs, "RadiativeBackground", verbosity);
945  xml_write_to_stream(os_xml, ppath.start_pos, pbofs,
946  "StartPositionOfPropagationPath", verbosity);
947  xml_write_to_stream(os_xml, ppath.start_los, pbofs,
948  "StartLOSOfPropagationPath", verbosity);
949  xml_write_to_stream(os_xml, ppath.start_lstep, pbofs,
950  "StartLstepOfPropagationPath", verbosity);
951  xml_write_to_stream(os_xml, ppath.pos, pbofs,
952  "PropagationPathPointPositions", verbosity);
953  xml_write_to_stream(os_xml, ppath.los, pbofs, "LineOfSight", verbosity);
954  xml_write_to_stream(os_xml, ppath.r, pbofs, "PropagationPathPointRadii", verbosity);
955  xml_write_to_stream(os_xml, ppath.lstep, pbofs,
956  "PropagationPathPositionLength", verbosity);
957  xml_write_to_stream(os_xml, ppath.end_pos, pbofs,
958  "EndPositionOfPropagationPath", verbosity);
959  xml_write_to_stream(os_xml, ppath.end_los, pbofs,
960  "EndLOSOfPropagationPath", verbosity);
961  xml_write_to_stream(os_xml, ppath.end_lstep, pbofs,
962  "EndLstepPropagationPath", verbosity);
963  xml_write_to_stream(os_xml, ppath.nreal, pbofs, "RefractiveIndexRealPart", verbosity);
964  xml_write_to_stream(os_xml, ppath.ngroup, pbofs, "GroupRefractiveIndex", verbosity);
965  xml_write_to_stream(os_xml, ppath.gp_p, pbofs, "PressureGridIndexPosition", verbosity);
966  xml_write_to_stream(os_xml, ppath.gp_lat, pbofs,
967  "LatitudeGridIndexPosition", verbosity);
968  xml_write_to_stream(os_xml, ppath.gp_lon, pbofs,
969  "LongitudeGridIndexPosition", verbosity);
970 
971  close_tag.set_name("/Ppath");
972  close_tag.write_to_stream(os_xml);
973  os_xml << '\n';
974 }
975 
976 
977 //=== QuantumNumberRecord =========================================
978 
980 
985 void xml_read_from_stream(istream& is_xml,
986  QuantumNumberRecord& qnr,
987  bifstream* pbifs _U_,
988  const Verbosity& verbosity)
989 {
990  ArtsXMLTag tag(verbosity);
991 
992  tag.read_from_stream(is_xml);
993  tag.check_name("QuantumNumberRecord");
994 
995  try
996  {
997  tag.read_from_stream(is_xml);
998  tag.check_name("Upper");
999  xml_read_from_stream(is_xml, qnr.Upper(), pbifs, verbosity);
1000  tag.read_from_stream(is_xml);
1001  tag.check_name("/Upper");
1002  }
1003  catch (runtime_error e)
1004  {
1005  ostringstream os;
1006  os << "Error in upper quantum numbers while reading QuantumNumberRecord: "
1007  << "\n" << e.what();
1008  throw runtime_error(os.str());
1009  }
1010 
1011  try
1012  {
1013  tag.read_from_stream(is_xml);
1014  tag.check_name("Lower");
1015  xml_read_from_stream(is_xml, qnr.Lower(), pbifs, verbosity);
1016  tag.read_from_stream(is_xml);
1017  tag.check_name("/Lower");
1018  }
1019  catch (runtime_error e)
1020  {
1021  ostringstream os;
1022  os << "Error in lower quantum numbers while reading QuantumNumberRecord: "
1023  << "\n" << e.what();
1024  throw runtime_error(os.str());
1025  }
1026 
1027  tag.read_from_stream(is_xml);
1028  tag.check_name("/QuantumNumberRecord");
1029 }
1030 
1031 
1033 
1039 void xml_write_to_stream(ostream& os_xml,
1040  const QuantumNumberRecord& qnr,
1041  bofstream* pbofs _U_,
1042  const String& name, const Verbosity& verbosity)
1043 {
1044  ArtsXMLTag open_tag(verbosity);
1045  ArtsXMLTag close_tag(verbosity);
1046 
1047  open_tag.set_name("QuantumNumberRecord");
1048  if (name.length())
1049  open_tag.add_attribute("name", name);
1050  open_tag.write_to_stream(os_xml);
1051 
1052  os_xml << '\n';
1053  open_tag.set_name("Upper");
1054  open_tag.write_to_stream(os_xml);
1055  xml_write_to_stream(os_xml, qnr.Upper(), pbofs, "", verbosity);
1056  close_tag.set_name("/Upper");
1057  close_tag.write_to_stream(os_xml);
1058  os_xml << '\n';
1059 
1060  open_tag.set_name("Lower");
1061  open_tag.write_to_stream(os_xml);
1062  xml_write_to_stream(os_xml, qnr.Lower(), pbofs, "", verbosity);
1063  close_tag.set_name("/Lower");
1064  close_tag.write_to_stream(os_xml);
1065  os_xml << '\n';
1066 
1067  close_tag.set_name("/QuantumNumberRecord");
1068  close_tag.write_to_stream(os_xml);
1069  os_xml << '\n';
1070 }
1071 
1072 
1073 //=== QuantumNumbers =========================================
1074 
1076 
1081 void xml_read_from_stream(istream& is_xml,
1082  QuantumNumbers& qn,
1083  bifstream* pbifs _U_,
1084  const Verbosity& verbosity)
1085 {
1086  ArtsXMLTag tag(verbosity);
1087  Index nelem;
1088 
1089  tag.read_from_stream(is_xml);
1090  tag.check_name("QuantumNumbers");
1091 
1092  tag.get_attribute_value("nelem", nelem);
1093 
1094  Index n;
1095  try
1096  {
1097  for (n = 0; n < nelem; n++)
1098  is_xml >> qn;
1099  }
1100  catch (runtime_error e)
1101  {
1102  ostringstream os;
1103  os << "Error reading QuantumNumbers: "
1104  << "\n Element: " << n
1105  << "\n" << e.what();
1106  throw runtime_error(os.str());
1107  }
1108 
1109  tag.read_from_stream(is_xml);
1110  tag.check_name("/QuantumNumbers");
1111 }
1112 
1113 
1115 
1121 void xml_write_to_stream(ostream& os_xml,
1122  const QuantumNumbers& qn,
1123  bofstream* pbofs _U_,
1124  const String& name, const Verbosity& verbosity)
1125 {
1126  ArtsXMLTag open_tag(verbosity);
1127  ArtsXMLTag close_tag(verbosity);
1128 
1129  open_tag.set_name("QuantumNumbers");
1130  if (name.length())
1131  open_tag.add_attribute("name", name);
1132  open_tag.add_attribute("nelem", qn.GetNumbers().size());
1133  open_tag.write_to_stream(os_xml);
1134 
1135  os_xml << " " << qn << " ";
1136 
1137  close_tag.set_name("/QuantumNumbers");
1138  close_tag.write_to_stream(os_xml);
1139 }
1140 
1141 
1142 //=== RetrievalQuantity =========================================
1143 
1145 
1150 void xml_read_from_stream(istream& is_xml,
1151  RetrievalQuantity& rq,
1152  bifstream* pbifs, const Verbosity& verbosity)
1153 {
1154  ArtsXMLTag tag(verbosity);
1155  String maintag;
1156  String subtag;
1157  String mode;
1158  Index analytical;
1159  Numeric perturbation;
1160  ArrayOfVector grids;
1161 
1162  tag.read_from_stream(is_xml);
1163  tag.check_name("RetrievalQuantity");
1164 
1165  xml_read_from_stream(is_xml, maintag, pbifs, verbosity);
1166  xml_read_from_stream(is_xml, subtag, pbifs, verbosity);
1167  xml_read_from_stream(is_xml, mode, pbifs, verbosity);
1168  xml_read_from_stream(is_xml, analytical, pbifs, verbosity);
1169  xml_read_from_stream(is_xml, perturbation, pbifs, verbosity);
1170  xml_read_from_stream(is_xml, grids, pbifs, verbosity);
1171 
1172  tag.read_from_stream(is_xml);
1173  tag.check_name("/RetrievalQuantity");
1174 
1175  rq = RetrievalQuantity(maintag, subtag, mode, analytical, perturbation,
1176  grids);
1177 }
1178 
1179 
1181 
1187 void xml_write_to_stream(ostream& os_xml,
1188  const RetrievalQuantity& rq,
1189  bofstream* pbofs,
1190  const String& name, const Verbosity& verbosity)
1191 {
1192  ArtsXMLTag open_tag(verbosity);
1193  ArtsXMLTag close_tag(verbosity);
1194 
1195  open_tag.set_name("RetrievalQuantity");
1196  if (name.length())
1197  open_tag.add_attribute("name", name);
1198  open_tag.write_to_stream(os_xml);
1199 
1200  xml_write_to_stream(os_xml, rq.MainTag(), pbofs, "MainTag", verbosity);
1201  xml_write_to_stream(os_xml, rq.Subtag(), pbofs, "Subtag", verbosity);
1202  xml_write_to_stream(os_xml, rq.Mode(), pbofs, "Mode", verbosity);
1203  xml_write_to_stream(os_xml, rq.Analytical(), pbofs, "Analytical", verbosity);
1204  xml_write_to_stream(os_xml, rq.Perturbation(), pbofs, "Perturbation", verbosity);
1205  xml_write_to_stream(os_xml, rq.Grids(), pbofs, "Grids", verbosity);
1206 
1207  close_tag.set_name("/RetrievalQuantity");
1208  close_tag.write_to_stream(os_xml);
1209  os_xml << '\n';
1210 }
1211 
1212 
1213 //=== SingleScatteringData ======================================
1214 
1216 
1221 void xml_read_from_stream(istream& is_xml,
1222  SingleScatteringData& ssdata,
1223  bifstream* pbifs, const Verbosity& verbosity)
1224 {
1225  ArtsXMLTag tag(verbosity);
1226  String version;
1227 
1228  tag.read_from_stream(is_xml);
1229  tag.check_name("SingleScatteringData");
1230  tag.get_attribute_value("version", version);
1231 
1232  if (version == "2")
1233  {
1234  String particle_type_string;
1235  xml_read_from_stream(is_xml, particle_type_string, pbifs, verbosity);
1236  ssdata.particle_type = ParticleTypeFromString(particle_type_string);
1237  }
1238  else
1239  {
1240  Index particle_type;
1241  xml_read_from_stream(is_xml, particle_type, pbifs, verbosity);
1242  ssdata.particle_type = ParticleType(particle_type);
1243  }
1244  xml_read_from_stream(is_xml, ssdata.description, pbifs, verbosity);
1245  xml_read_from_stream(is_xml, ssdata.f_grid, pbifs, verbosity);
1246  xml_read_from_stream(is_xml, ssdata.T_grid, pbifs, verbosity);
1247  xml_read_from_stream(is_xml, ssdata.za_grid, pbifs, verbosity);
1248  /* Verify that we have a good coverage for the za grid */
1249  if ((ssdata.za_grid[0] > 1) || ssdata.za_grid[ssdata.za_grid.nelem()-1] < 179)
1250  {
1251  ostringstream os;
1252  os << "Missing data in xml-stream. Expected za_grid: [0, 180]. "
1253  << "Found za_grid: [" << ssdata.za_grid[0]
1254  << ", "
1255  << ssdata.za_grid[ssdata.za_grid.nelem()-1]
1256  << "]";
1257  throw runtime_error(os.str());
1258  }
1259  xml_read_from_stream(is_xml, ssdata.aa_grid, pbifs, verbosity);
1260 
1261  xml_read_from_stream(is_xml, ssdata.pha_mat_data, pbifs, verbosity);
1262  if (ssdata.pha_mat_data.nlibraries() != ssdata.f_grid.nelem())
1263  {
1264  throw runtime_error("Number of frequencies in f_grid and pha_mat_data "
1265  "not matching!!!");
1266  }
1267 
1268  xml_read_from_stream(is_xml, ssdata.ext_mat_data, pbifs, verbosity);
1269  xml_read_from_stream(is_xml, ssdata.abs_vec_data, pbifs, verbosity);
1270 
1271  tag.read_from_stream(is_xml);
1272  tag.check_name("/SingleScatteringData");
1273 }
1274 
1275 
1277 
1283 void xml_write_to_stream(ostream& os_xml,
1284  const SingleScatteringData& ssdata,
1285  bofstream* pbofs,
1286  const String& name, const Verbosity& verbosity)
1287 {
1288  ArtsXMLTag open_tag(verbosity);
1289  ArtsXMLTag close_tag(verbosity);
1290 
1291  open_tag.set_name("SingleScatteringData");
1292  if (name.length())
1293  open_tag.add_attribute("name", name);
1294  open_tag.add_attribute("version", "2");
1295  open_tag.write_to_stream(os_xml);
1296 
1298  pbofs, "", verbosity);
1299  xml_write_to_stream(os_xml, ssdata.description, pbofs, "", verbosity);
1300  xml_write_to_stream(os_xml, ssdata.f_grid, pbofs, "", verbosity);
1301  xml_write_to_stream(os_xml, ssdata.T_grid, pbofs, "", verbosity);
1302  xml_write_to_stream(os_xml, ssdata.za_grid, pbofs, "", verbosity);
1303  xml_write_to_stream(os_xml, ssdata.aa_grid, pbofs, "", verbosity);
1304  xml_write_to_stream(os_xml, ssdata.pha_mat_data, pbofs, "", verbosity);
1305  xml_write_to_stream(os_xml, ssdata.ext_mat_data, pbofs, "", verbosity);
1306  xml_write_to_stream(os_xml, ssdata.abs_vec_data, pbofs, "", verbosity);
1307 
1308  close_tag.set_name("/SingleScatteringData");
1309  close_tag.write_to_stream(os_xml);
1310  os_xml << '\n';
1311 }
1312 
1313 
1314 //=== ScatteringMetaData ======================================
1315 
1317 
1322 void xml_read_from_stream(istream& is_xml,
1323  ScatteringMetaData& smdata,
1324  bifstream* pbifs, const Verbosity& verbosity)
1325 {
1326  ArtsXMLTag tag(verbosity);
1327  String version;
1328 
1329  tag.read_from_stream(is_xml);
1330  tag.check_name("ScatteringMetaData");
1331  tag.get_attribute_value("version", version);
1332 
1333  xml_read_from_stream(is_xml, smdata.description, pbifs, verbosity);
1334  xml_read_from_stream(is_xml, smdata.material, pbifs, verbosity);
1335  xml_read_from_stream(is_xml, smdata.shape, pbifs, verbosity);
1336  xml_read_from_stream(is_xml, smdata.density, pbifs, verbosity);
1337  xml_read_from_stream(is_xml, smdata.diameter_max, pbifs, verbosity);
1338  xml_read_from_stream(is_xml, smdata.volume, pbifs, verbosity);
1339  xml_read_from_stream(is_xml, smdata.area_projected, pbifs, verbosity);
1340  xml_read_from_stream(is_xml, smdata.aspect_ratio, pbifs, verbosity);
1341 
1342  if (version == "2")
1343  {
1344  String particle_type;
1345  xml_read_from_stream(is_xml, smdata.scat_f_grid, pbifs, verbosity);
1346  xml_read_from_stream(is_xml, smdata.scat_T_grid, pbifs, verbosity);
1347  xml_read_from_stream(is_xml, particle_type, pbifs, verbosity);
1348  xml_read_from_stream(is_xml, smdata.complex_refr_index, pbifs, verbosity);
1349  smdata.particle_type = ParticleTypeFromString(particle_type);
1350  }
1351 
1352  tag.read_from_stream(is_xml);
1353  tag.check_name("/ScatteringMetaData");
1354 }
1355 
1356 
1358 
1364 void xml_write_to_stream(ostream& os_xml,
1365  const ScatteringMetaData& smdata,
1366  bofstream* pbofs,
1367  const String& name, const Verbosity& verbosity)
1368 {
1369  ArtsXMLTag open_tag(verbosity);
1370  ArtsXMLTag close_tag(verbosity);
1371 
1372  open_tag.set_name("ScatteringMetaData");
1373  if (name.length())
1374  open_tag.add_attribute("name", name);
1375  open_tag.add_attribute("version", "2");
1376  open_tag.write_to_stream(os_xml);
1377 
1378  xml_write_to_stream(os_xml, smdata.description, pbofs, "", verbosity);
1379  xml_write_to_stream(os_xml, smdata.material, pbofs, "", verbosity);
1380  xml_write_to_stream(os_xml, smdata.shape, pbofs, "", verbosity);
1381  xml_write_to_stream(os_xml, smdata.density, pbofs, "", verbosity);
1382  xml_write_to_stream(os_xml, smdata.diameter_max, pbofs, "", verbosity);
1383  xml_write_to_stream(os_xml, smdata.volume, pbofs, "", verbosity);
1384  xml_write_to_stream(os_xml, smdata.area_projected, pbofs, "", verbosity);
1385  xml_write_to_stream(os_xml, smdata.aspect_ratio, pbofs, "", verbosity);
1386  xml_write_to_stream(os_xml, smdata.scat_f_grid, pbofs, "", verbosity);
1387  xml_write_to_stream(os_xml, smdata.scat_T_grid, pbofs, "", verbosity);
1389  pbofs, "", verbosity);
1390  xml_write_to_stream(os_xml, smdata.complex_refr_index, pbofs, "", verbosity);
1391 
1392  close_tag.set_name("/ScatteringMetaData");
1393  close_tag.write_to_stream(os_xml);
1394  os_xml << '\n';
1395 }
1396 
1397 
1398 
1399 //=== SLIData2 =====================================================
1401 
1407 void xml_read_from_stream(istream& is_xml,
1408  SLIData2& slidata,
1409  bifstream* pbifs, const Verbosity& verbosity)
1410 {
1411  ArtsXMLTag tag(verbosity);
1412 
1413  tag.read_from_stream(is_xml);
1414  tag.check_name("SLIData2");
1415 
1416  xml_read_from_stream(is_xml, slidata.x1a, pbifs, verbosity);
1417  xml_read_from_stream(is_xml, slidata.x2a, pbifs, verbosity);
1418  xml_read_from_stream(is_xml, slidata.ya, pbifs, verbosity);
1419 
1420  tag.read_from_stream(is_xml);
1421  tag.check_name("/SLIData2");
1422 }
1423 
1424 
1425 void xml_write_to_stream(ostream& os_xml,
1426  const SLIData2& slidata,
1427  bofstream* pbofs,
1428  const String& name, const Verbosity& verbosity)
1429 {
1430  ArtsXMLTag open_tag(verbosity);
1431  ArtsXMLTag close_tag(verbosity);
1432 
1433  open_tag.set_name("SLIData2");
1434  if (name.length())
1435  open_tag.add_attribute("name", name);
1436  open_tag.write_to_stream(os_xml);
1437 
1438  xml_write_to_stream(os_xml, slidata.x1a, pbofs, "", verbosity);
1439  xml_write_to_stream(os_xml, slidata.x2a, pbofs, "", verbosity);
1440  xml_write_to_stream(os_xml, slidata.ya, pbofs, "", verbosity);
1441 
1442  close_tag.set_name("/SLIData2");
1443  close_tag.write_to_stream(os_xml);
1444  os_xml << '\n';
1445 }
1446 
1447 
1448 //=== SpeciesAuxData ===========================================
1449 
1451 
1456 void xml_read_from_stream(istream& is_xml,
1457  SpeciesAuxData& sad,
1458  bifstream* pbifs _U_,
1459  const Verbosity& verbosity)
1460 {
1461  CREATE_OUT2;
1462 
1463  ArtsXMLTag tag(verbosity);
1464  Index nelem;
1465  Index nparam;
1466 
1467  tag.read_from_stream(is_xml);
1468  tag.check_name("SpeciesAuxData");
1469 
1470  tag.get_attribute_value("nelem", nelem);
1471  tag.get_attribute_value("nparam", nparam);
1472 
1473  Index version;
1474  tag.get_attribute_value("version", version);
1475 
1476  if (version != 1)
1477  {
1478  ostringstream os;
1479  os << "Unknown SpeciesAuxData version " << version;
1480  throw runtime_error(os.str());
1481  }
1482 
1483  Index n = 0;
1484  try
1485  {
1486  ArrayOfString artstags;
1487  sad.initParams(nparam);
1488  for (n = 0; n < nelem; n++)
1489  {
1490  String artstag;
1491  sad.ReadFromStream(artstag, is_xml, nparam, verbosity);
1492 
1493  if (find_first(artstags, artstag) == -1)
1494  artstags.push_back(artstag);
1495  else
1496  {
1497  ostringstream os;
1498  os << "SpeciesAuxData for " << artstag << " already defined.\n"
1499  << "Duplicates are not allowed in input file.";
1500  throw runtime_error(os.str());
1501  }
1502  }
1503  }
1504  catch (runtime_error e)
1505  {
1506  ostringstream os;
1507  os << "Error reading SpeciesAuxData: "
1508  << "\n Element: " << n
1509  << "\n" << e.what();
1510  throw runtime_error(os.str());
1511  }
1512 
1513  tag.read_from_stream(is_xml);
1514  tag.check_name("/SpeciesAuxData");
1515 }
1516 
1517 
1519 
1525 void xml_write_to_stream(ostream& os_xml,
1526  const SpeciesAuxData& sad,
1527  bofstream* pbofs _U_,
1528  const String& name,
1529  const Verbosity& verbosity)
1530 
1531 {
1533 
1534  ArtsXMLTag open_tag(verbosity);
1535  ArtsXMLTag close_tag(verbosity);
1536 
1537  Index nelem = 0;
1538  for (ArrayOfMatrix::const_iterator isp = sad.getParams().begin();
1539  isp != sad.getParams().end();
1540  isp++)
1541  nelem += isp->nrows();
1542 
1543  open_tag.set_name("SpeciesAuxData");
1544  if (name.length())
1545  open_tag.add_attribute("name", name);
1546  if (sad.getParams().nelem() && sad.getParams()[0].nrows())
1547  {
1548  open_tag.add_attribute("version", 1);
1549  open_tag.add_attribute("nelem", nelem);
1550  open_tag.add_attribute("nparam", sad.getParams()[0].ncols());
1551  }
1552  open_tag.write_to_stream(os_xml);
1553  os_xml << '\n';
1554 
1555  xml_set_stream_precision(os_xml);
1556  const ArrayOfMatrix& params = sad.getParams();
1557  for (Index isp = 0; isp < params.nelem(); isp++)
1558  {
1559  String species = species_data[isp].Name();
1560  for (Index iiso = 0; iiso < params[isp].nrows(); iiso++)
1561  {
1562  os_xml << "@ " << species << "-" << species_data[isp].Isotopologue()[iiso].Name();
1563  for (Index ip = 0; ip < params[isp].ncols(); ip++)
1564  os_xml << " " << params[isp](iiso, ip);
1565  os_xml << '\n';
1566  }
1567  }
1568 
1569  close_tag.set_name("/SpeciesAuxData");
1570  close_tag.write_to_stream(os_xml);
1571 
1572  os_xml << '\n';
1573 }
1574 
1575 
1576 //=== SpeciesRecord ================================================
1577 
1579 
1584 void xml_read_from_stream(istream& is_xml,
1585  SpeciesRecord& srecord,
1586  bifstream* pbifs, const Verbosity& verbosity)
1587 {
1588  ArtsXMLTag tag(verbosity);
1589  String sname;
1590  Index degfr;
1591  Array<IsotopologueRecord> airecord;
1592 
1593  tag.read_from_stream(is_xml);
1594  tag.check_name("SpeciesRecord");
1595 
1596  xml_read_from_stream(is_xml, sname, pbifs, verbosity);
1597  xml_read_from_stream(is_xml, degfr, pbifs, verbosity);
1598  xml_read_from_stream(is_xml, airecord, pbifs, verbosity);
1599 
1600  srecord = SpeciesRecord(sname.c_str(), degfr, airecord);
1601 
1602  tag.read_from_stream(is_xml);
1603  tag.check_name("/SpeciesRecord");
1604 }
1605 
1606 
1608 
1614 void xml_write_to_stream(ostream& os_xml,
1615  const SpeciesRecord& srecord,
1616  bofstream* pbofs,
1617  const String& name, const Verbosity& verbosity)
1618 {
1619  ArtsXMLTag open_tag(verbosity);
1620  ArtsXMLTag close_tag(verbosity);
1621 
1622  open_tag.set_name("SpeciesRecord");
1623  if (name.length())
1624  open_tag.add_attribute("name", name);
1625  open_tag.write_to_stream(os_xml);
1626  os_xml << '\n';
1627 
1628  xml_write_to_stream(os_xml, srecord.Name(), pbofs, "", verbosity);
1629  xml_write_to_stream(os_xml, srecord.Degfr(), pbofs, "", verbosity);
1630  xml_write_to_stream(os_xml, srecord.Isotopologue(), pbofs, "", verbosity);
1631 
1632  close_tag.set_name("/SpeciesRecord");
1633  close_tag.write_to_stream(os_xml);
1634  os_xml << '\n';
1635 }
1636 
1637 
1638 //=== SpeciesTag ================================================
1639 
1641 
1645 /* param pbifs Pointer to binary input stream. NULL in case of ASCII file.
1646  Ignored because SpeciesTag is always stored in ASCII format.*/
1647 void xml_read_from_stream(istream& is_xml,
1648  SpeciesTag& stag,
1649  bifstream* /* pbifs */, const Verbosity& verbosity)
1650 {
1651  ArtsXMLTag tag(verbosity);
1652  stringbuf strbuf;
1653  char dummy;
1654 
1655  tag.read_from_stream(is_xml);
1656  tag.check_name("SpeciesTag");
1657 
1658  // Skip whitespaces
1659  bool string_starts_with_quotes = true;
1660  do {
1661  is_xml >> dummy;
1662  switch (dummy)
1663  {
1664  case ' ':
1665  case '\"':
1666  case '\n':
1667  case '\r':
1668  case '\t':
1669  break;
1670  default:
1671  string_starts_with_quotes = false;
1672  }
1673  } while (is_xml.good() && dummy != '"' && string_starts_with_quotes);
1674 
1675  // Throw exception if first char after whitespaces is not a quote
1676  if (!string_starts_with_quotes)
1677  {
1678  xml_parse_error("SpeciesTag must begin with \"");
1679  }
1680 
1681  is_xml.get(strbuf, '"');
1682  if (is_xml.fail())
1683  {
1684  xml_parse_error("SpeciesTag must end with \"");
1685  }
1686 
1687  stag = SpeciesTag(strbuf.str());
1688 
1689  // Ignore quote
1690  is_xml >> dummy;
1691 
1692  tag.read_from_stream(is_xml);
1693  tag.check_name("/SpeciesTag");
1694 }
1695 
1696 
1698 
1703 /* param pbofs Pointer to binary file stream. NULL for ASCII output.
1704  Ignore because SpeciesTag is always stored in ASCII format. */
1705 void xml_write_to_stream(ostream& os_xml,
1706  const SpeciesTag& stag,
1707  bofstream* /* pbofs */,
1708  const String& name, const Verbosity& verbosity)
1709 {
1710  ArtsXMLTag open_tag(verbosity);
1711  ArtsXMLTag close_tag(verbosity);
1712 
1713  open_tag.set_name("SpeciesTag");
1714  if (name.length())
1715  open_tag.add_attribute("name", name);
1716  open_tag.write_to_stream(os_xml);
1717 
1718  os_xml << '\"' << stag.Name() << '\"';
1719 
1720  close_tag.set_name("/SpeciesTag");
1721  close_tag.write_to_stream(os_xml);
1722  os_xml << '\n';
1723 }
1724 
1725 
1727 // Dummy funtion for groups for which
1728 // IO function have not yet been implemented
1730 
1731 // FIXME: These should be implemented, sooner or later...
1732 
1733 void xml_read_from_stream(istream&,
1734  Agenda&,
1735  bifstream* /* pbifs */, const Verbosity&)
1736 {
1737  throw runtime_error("Method not implemented!");
1738 }
1739 
1740 
1741 void xml_write_to_stream(ostream&,
1742  const Agenda&,
1743  bofstream* /* pbofs */,
1744  const String& /* name */, const Verbosity&)
1745 {
1746  throw runtime_error("Method not implemented!");
1747 }
1748 
1749 
1750 //=== MCAntenna ================================================
1751 
1752 void xml_read_from_stream(istream&,
1753  MCAntenna&,
1754  bifstream* /* pbifs */, const Verbosity&)
1755 {
1756  throw runtime_error("Method not implemented!");
1757 }
1758 
1759 
1760 void xml_write_to_stream(ostream&,
1761  const MCAntenna&,
1762  bofstream* /* pbofs */,
1763  const String& /* name */, const Verbosity&)
1764 {
1765  throw runtime_error("Method not implemented!");
1766 }
1767 
1768 
1769 //=== Verbosity ================================================
1770 
1771 void xml_read_from_stream(istream&,
1772  Verbosity&,
1773  bifstream* /* pbifs */, const Verbosity&)
1774 {
1775  throw runtime_error("Method not implemented!");
1776 }
1777 
1778 
1779 void xml_write_to_stream(ostream&,
1780  const Verbosity&,
1781  bofstream* /* pbofs */,
1782  const String& /* name */, const Verbosity&)
1783 {
1784  throw runtime_error("Method not implemented!");
1785 }
1786 
GriddedField2
Definition: gridded_fields.h:250
gridded_fields.h
Implementation of gridded fields.
ScatteringMetaData::material
String material
Definition: optproperties.h:111
SLIData2::x1a
Vector x1a
Definition: mc_interp.h:61
GriddedField::get_string_grid
const ArrayOfString & get_string_grid(Index i) const
Get a string grid.
Definition: gridded_fields.cc:159
GriddedField::checksize_strict
virtual void checksize_strict() const =0
Strict consistency check.
GriddedField::set_grid_name
void set_grid_name(Index i, const String &s)
Set grid name.
Definition: gridded_fields.h:166
IsotopologueRecord::Mass
const Numeric & Mass() const
Mass of the isotopologue.
Definition: absorption.h:260
SpeciesRecord::Degfr
Index Degfr() const
Definition: absorption.h:424
QuantumNumbers
Container class for Quantum Numbers.
Definition: quantum.h:58
RetrievalQuantity::Analytical
const Index & Analytical() const
Boolean to make analytical calculations (if possible).
Definition: jacobian.h:85
SingleScatteringData::za_grid
Vector za_grid
Definition: optproperties.h:89
ParticleTypeToString
String ParticleTypeToString(const ParticleType &particle_type)
Convert particle type enum value to String.
Definition: optproperties.cc:1059
ArtsXMLTag::check_name
void check_name(const String &expected_name)
Check tag name.
Definition: xml_io.cc:56
SingleScatteringData::f_grid
Vector f_grid
Definition: optproperties.h:87
LineMixingRecord::Data
Vector & Data()
Definition: linemixingrecord.h:45
GasAbsLookup::nonlinear_species
ArrayOfIndex nonlinear_species
The species tags with non-linear treatment.
Definition: gas_abs_lookup.h:165
GriddedField
Definition: gridded_fields.h:55
QuantumNumbers::GetNumbers
const QuantumContainer & GetNumbers() const
Definition: quantum.h:75
RetrievalQuantity::Grids
const ArrayOfVector & Grids() const
Grids.
Definition: jacobian.h:91
GriddedField6
Definition: gridded_fields.h:505
SingleScatteringData::description
String description
Definition: optproperties.h:86
ScatteringMetaData::diameter_max
Numeric diameter_max
Definition: optproperties.h:116
QuantumNumberRecord::Upper
Rational Upper(Index i) const
Get upper quantum number.
Definition: quantum.h:106
SpeciesTag::Name
String Name() const
Return the full name of the tag.
Definition: abs_species_tags.cc:397
Ppath::background
String background
Definition: ppath.h:63
ParticleType
ParticleType
An attribute to classify the particle type in a SingleScatteringData structure.
Definition: optproperties.h:55
SingleScatteringData::aa_grid
Vector aa_grid
Definition: optproperties.h:90
GRID_TYPE_NUMERIC
@ GRID_TYPE_NUMERIC
Definition: gridded_fields.h:43
Ppath::end_lstep
Numeric end_lstep
Definition: ppath.h:73
GriddedField::get_dim
Index get_dim() const
Get the dimension of this gridded field.
Definition: gridded_fields.h:100
SLIData2::x2a
ArrayOfVector x2a
Definition: mc_interp.h:63
xml_parse_from_stream
void xml_parse_from_stream(istream &is_xml, ArrayOfString &astring, bifstream *pbifs, ArtsXMLTag &tag, const Verbosity &verbosity)
Parse ArrayOfString from XML input stream.
Definition: xml_io_array_types.cc:3066
Ppath::start_lstep
Numeric start_lstep
Definition: ppath.h:66
ArtsXMLTag::get_attribute_value
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
Definition: xml_io.cc:131
SpeciesAuxData::ReadFromStream
bool ReadFromStream(String &artsid, istream &is, Index nparams, const Verbosity &verbosity)
Read parameters from input stream.
Definition: absorption.cc:104
MCAntenna
An Antenna object used by MCGeneral.
Definition: mc_antenna.h:56
xml_set_stream_precision
void xml_set_stream_precision(ostream &os)
Definition: xml_io.cc:799
LineMixingRecord::Species
Index Species() const
Definition: linemixingrecord.h:39
global_data::species_data
const Array< SpeciesRecord > species_data
Species Data.
Definition: partition_function_data.cc:43
CREATE_OUT2
#define CREATE_OUT2
Definition: messages.h:213
GriddedField::get_numeric_grid
ConstVectorView get_numeric_grid(Index i) const
Get a numeric grid.
Definition: gridded_fields.cc:93
GridPos::fd
Numeric fd[2]
Definition: interpolation.h:76
ArtsXMLTag::write_to_stream
void write_to_stream(ostream &os)
Write XML tag.
Definition: xml_io.cc:321
LineMixingRecord
Definition: linemixingrecord.h:34
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:59
SpeciesAuxData
Auxiliary data for isotopologues.
Definition: absorption.h:440
Ppath::gp_p
ArrayOfGridPos gp_p
Definition: ppath.h:76
Agenda
The Agenda class.
Definition: agenda_class.h:44
Ppath::end_pos
Vector end_pos
Definition: ppath.h:71
GriddedField3
Definition: gridded_fields.h:307
SingleScatteringData
Structure which describes the single scattering properties of a particle or a particle distribution.
Definition: optproperties.h:84
GasAbsLookup
An absorption lookup table.
Definition: gas_abs_lookup.h:46
matpackIV.h
ConstTensor7View::nlibraries
Index nlibraries() const
Returns the number of libraries.
Definition: matpackVII.cc:32
LineMixingRecord::Quantum
QuantumNumberRecord & Quantum()
Definition: linemixingrecord.h:42
matpackI.h
IsotopologueRecord::HitranTag
const Index & HitranTag() const
HITRAN-96 tag numbers for all isotopologues.
Definition: absorption.h:264
GriddedField::get_grid_type
GridType get_grid_type(Index i) const
Get grid type.
Definition: gridded_fields.h:141
Array
This can be used to make arrays out of anything.
Definition: array.h:107
xml_io_private.h
This file contains private function declarations and template instantiation to handle XML data files.
SpeciesTag
A tag group can consist of the sum of several of these.
Definition: abs_species_tags.h:46
species_index_from_species_name
Index species_index_from_species_name(String name)
Return species index for given species name.
Definition: absorption.cc:1260
LineMixingRecord::Isotopologue
Index Isotopologue() const
Definition: linemixingrecord.h:40
SpeciesAuxData::getParams
const ArrayOfMatrix & getParams() const
Return a constant reference to the parameters.
Definition: absorption.h:461
species_name_from_species_index
String species_name_from_species_index(const Index spec_ind)
Return species name for given species index.
Definition: absorption.cc:1301
Ppath::gp_lat
ArrayOfGridPos gp_lat
Definition: ppath.h:77
ScatteringMetaData::density
Numeric density
Definition: optproperties.h:115
Ppath::ngroup
Vector ngroup
Definition: ppath.h:75
QuantumNumberRecord::Lower
Rational Lower(Index i) const
Get lower quantum number.
Definition: quantum.h:103
_U_
#define _U_
Definition: config.h:167
ArtsXMLTag::read_from_stream
void read_from_stream(istream &is)
Reads next XML tag.
Definition: xml_io.cc:183
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:64
SpeciesAuxData::initParams
void initParams(Index nparams)
Resize according to builtin isotopologues in species data.
Definition: absorption.cc:90
Ppath::los
Matrix los
Definition: ppath.h:68
Ppath::start_pos
Vector start_pos
Definition: ppath.h:64
ScatteringMetaData
Definition: optproperties.h:109
SingleScatteringData::ext_mat_data
Tensor5 ext_mat_data
Definition: optproperties.h:92
RetrievalQuantity::MainTag
const String & MainTag() const
Main tag.
Definition: jacobian.h:76
Ppath::gp_lon
ArrayOfGridPos gp_lon
Definition: ppath.h:78
ScatteringMetaData::area_projected
Numeric area_projected
Definition: optproperties.h:118
Ppath::np
Index np
Definition: ppath.h:61
xml_parse_error
void xml_parse_error(const String &str_error)
Throws XML parser runtime error.
Definition: xml_io.cc:605
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:180
IsotopologueRecord::Abundance
const Numeric & Abundance() const
Normal abundance ( = isotopologue ratio).
Definition: absorption.h:257
GasAbsLookup::t_ref
Vector t_ref
The reference temperature profile [K].
Definition: gas_abs_lookup.h:206
xml_io_types.h
This file contains private function declarations and template instantiation to handle XML data files.
GasAbsLookup::f_grid
Vector f_grid
The frequency grid [Hz].
Definition: gas_abs_lookup.h:169
GasAbsLookup::p_grid
Vector p_grid
The pressure grid for the table [Pa].
Definition: gas_abs_lookup.h:183
ScatteringMetaData::aspect_ratio
Numeric aspect_ratio
Definition: optproperties.h:119
RetrievalQuantity::Mode
const String & Mode() const
Calculation mode.
Definition: jacobian.h:82
GRID_TYPE_STRING
@ GRID_TYPE_STRING
Definition: gridded_fields.h:44
IsotopologueRecord::JplTags
const ArrayOfIndex & JplTags() const
JPL tag numbers for all isotopologues.
Definition: absorption.h:268
jacobian.h
Declarations required for the calculation of jacobians.
ScatteringMetaData::scat_T_grid
Vector scat_T_grid
Definition: optproperties.h:121
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
Verbosity
Definition: messages.h:50
ArtsXMLTag::add_attribute
void add_attribute(const String &aname, const String &value)
Adds a String attribute to tag.
Definition: xml_io.cc:69
bifstream
Binary output file stream class.
Definition: bifstream.h:45
ArtsXMLTag::get_name
String & get_name()
Definition: xml_io_private.h:83
GriddedField4
Definition: gridded_fields.h:374
matpackIII.h
ScatteringMetaData::complex_refr_index
GriddedField3 complex_refr_index
Definition: optproperties.h:122
GriddedField::set_name
void set_name(const String &s)
Set name of this gridded field.
Definition: gridded_fields.h:174
GasAbsLookup::nls_pert
Vector nls_pert
The vector of perturbations for the VMRs of the nonlinear species.
Definition: gas_abs_lookup.h:235
SLIData2::ya
ArrayOfVector ya
Definition: mc_interp.h:65
GriddedField::get_name
const String & get_name() const
Get the name of this gridded field.
Definition: gridded_fields.h:153
global_data.h
Ppath::lstep
Vector lstep
Definition: ppath.h:70
Ppath::start_los
Vector start_los
Definition: ppath.h:65
GasAbsLookup::xsec
Tensor4 xsec
Absorption cross sections.
Definition: gas_abs_lookup.h:269
ScatteringMetaData::shape
String shape
Definition: optproperties.h:112
ScatteringMetaData::volume
Numeric volume
Definition: optproperties.h:117
CIARecord::mdata
ArrayOfGriddedField2 mdata
The data itself, directly from the HITRAN file.
Definition: cia.h:246
SpeciesRecord
Contains the lookup data for one species.
Definition: absorption.h:367
Ppath::nreal
Vector nreal
Definition: ppath.h:74
Ppath::end_los
Vector end_los
Definition: ppath.h:72
SingleScatteringData::particle_type
ParticleType particle_type
Definition: optproperties.h:85
xml_read_from_stream
void xml_read_from_stream(istream &is_xml, CIARecord &cr, bifstream *pbifs, const Verbosity &verbosity)
Reads CIARecord from XML input stream.
Definition: xml_io_compound_types.cc:58
GasAbsLookup::species
ArrayOfArrayOfSpeciesTag species
The species tags for which the table is valid.
Definition: gas_abs_lookup.h:156
ScatteringMetaData::description
String description
Definition: optproperties.h:110
IsotopologueRecord::Name
const String & Name() const
Isotopologue name.
Definition: absorption.h:255
GridPos
Structure to store a grid position.
Definition: interpolation.h:74
SpeciesRecord::Isotopologue
const Array< IsotopologueRecord > & Isotopologue() const
Definition: absorption.h:425
GriddedField::set_grid
void set_grid(Index i, const Vector &g)
Set a numeric grid.
Definition: gridded_fields.cc:225
matpackV.h
Ppath::constant
Numeric constant
Definition: ppath.h:62
IsotopologueRecord
Contains the lookup data for one isotopologue.
Definition: absorption.h:191
IsotopologueRecord::MytranTag
const Index & MytranTag() const
MYTRAN2 tag numbers for all isotopologues.
Definition: absorption.h:262
CIARecord::Data
const ArrayOfGriddedField2 & Data() const
Return CIA data.
Definition: cia.h:151
SpeciesRecord::Name
const String & Name() const
Definition: absorption.h:423
SLIData2
A 2D sequential linear interpolation (SLI) lookup table.
Definition: mc_interp.h:58
CIARecord
CIA data for a single pair of molecules.
Definition: cia.h:68
GriddedField1
Definition: gridded_fields.h:199
Ppath::r
Vector r
Definition: ppath.h:69
matpackII.h
Header file for sparse matrices.
QuantumNumberRecord
Record containing upper and lower quantum numbers.
Definition: quantum.h:94
ScatteringMetaData::particle_type
ParticleType particle_type
Definition: optproperties.h:113
ScatteringMetaData::scat_f_grid
Vector scat_f_grid
Definition: optproperties.h:120
SingleScatteringData::abs_vec_data
Tensor5 abs_vec_data
Definition: optproperties.h:93
ParticleTypeFromString
ParticleType ParticleTypeFromString(const String &particle_type_string)
Convert particle name to enum value.
Definition: optproperties.cc:1026
SpeciesTag::Isotopologue
Index Isotopologue() const
Isotopologue species index.
Definition: abs_species_tags.h:71
ArtsXMLTag
The ARTS XML tag class.
Definition: xml_io_private.h:79
xml_write_to_stream
void xml_write_to_stream(ostream &os_xml, const CIARecord &cr, bofstream *pbofs, const String &name, const Verbosity &verbosity)
Writes CIARecord to XML output stream.
Definition: xml_io_compound_types.cc:107
CIARecord::SetSpecies
void SetSpecies(const Index first, const Index second)
Set CIA species.
Definition: cia.h:161
GridPos::idx
Index idx
Definition: interpolation.h:75
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
GriddedField::get_grid_name
const String & get_grid_name(Index i) const
Get grid name.
Definition: gridded_fields.h:111
RetrievalQuantity
Contains the data for one retrieval quantity.
Definition: jacobian.h:45
find_first
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
Definition: array.h:281
GasAbsLookup::vmrs_ref
Matrix vmrs_ref
The reference VMR profiles.
Definition: gas_abs_lookup.h:201
Ppath::dim
Index dim
Definition: ppath.h:60
CIARecord::MoleculeName
String MoleculeName(const Index i) const
Return each molecule name (as a string) that is associated with this CIARecord.
Definition: cia.cc:301
GasAbsLookup::t_pert
Vector t_pert
The vector of temperature perturbations [K].
Definition: gas_abs_lookup.h:220
Vector
The Vector class.
Definition: matpackI.h:556
SingleScatteringData::pha_mat_data
Tensor7 pha_mat_data
Definition: optproperties.h:91
ArtsXMLTag::set_name
void set_name(const String &new_name)
Definition: xml_io_private.h:87
GriddedField5
Definition: gridded_fields.h:438
Ppath::pos
Matrix pos
Definition: ppath.h:67
SingleScatteringData::T_grid
Vector T_grid
Definition: optproperties.h:88
SpeciesTag::Species
Index Species() const
Molecular species index.
Definition: abs_species_tags.h:66
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:176
RetrievalQuantity::Subtag
const String & Subtag() const
Subtag.
Definition: jacobian.h:79
matpackVI.h
matpackVII.h
arts.h
The global header file for ARTS.
bofstream
Binary output file stream class.
Definition: bofstream.h:45
RetrievalQuantity::Perturbation
const Numeric & Perturbation() const
Size of perturbation used for perturbation calculations.
Definition: jacobian.h:88