ARTS  2.3.1285(git:92a29ea9-dirty)
test_quantum.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
4  modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation; either version 2 of the
6  License, or (at your option) any 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 #include <iostream>
19 #include "absorption.h"
20 #include "arts.h"
21 #include "auto_md.h"
22 #include "exceptions.h"
23 #include "m_xml.h"
24 #include "matpackII.h"
25 #include "xml_io.h"
26 
27 int main(int /*argc*/, char * /*argv*/[]) {
28  try {
30  QuantumNumbers q2;
31 
34 
38 
39  cout << "Compare q1==q2: " << q1.Compare(q2) << endl;
40  cout << "Compare q2==q1: " << q2.Compare(q1) << endl;
41 
42  ostringstream os;
43  os << q2;
44  cout << "q1: " << q1 << endl;
45  cout << "q2: " << q2 << endl;
46 
47  WriteXML("ascii", q1, "quantum.xml", 0, "q1", "", "", Verbosity(0, 2, 0));
48 
49  QuantumNumbers q3;
50  ReadXML(q3, "q3", "quantum.xml", "", Verbosity(0, 2, 0));
51  cout << "q3: " << q3 << endl;
52 
53  cout << endl << "========================================" << endl << endl;
54 
57 
58  Verbosity v(2, 2, 2);
59 
60  ArrayOfLineRecord abs_lines;
61  Timer timer;
62 
63  timerStart(timer, v);
64  abs_linesReadFromHitran(
65  abs_lines,
66  "/Users/olemke/Dropbox/Hacking/sat/catalogue/HITRAN2008/HITRAN08.par",
67  1,
68  1.1876e+11,
69  v);
70  // 1, 3e12, v);
71  // 118e9, 119e9, v);
72  timerStop(timer, v);
73 
74  Print(timer, 1, v);
75 
76  SpeciesTag stag("O2-66");
77 
78  } catch (const std::runtime_error &e) {
79  cout << e.what() << endl;
80  }
81 
82  return (0);
83 }
bool Compare(const QuantumNumbers &qn) const
Compare Quantum Numbers Ignores any undefined numbers in the comparison.
Definition: quantum.cc:33
void Print(Workspace &ws, const Agenda &x, const Index &level, const Verbosity &verbosity)
Definition: m_general.cc:76
#define q1
This file contains basic functions to handle XML data files.
void timerStart(Timer &, const Verbosity &)
WORKSPACE METHOD: timerStart.
Definition: m_general.cc:365
void define_species_map()
The global header file for ARTS.
Header file for sparse matrices.
Implements rational numbers to work with other ARTS types.
Definition: rational.h:54
The declarations of all the exception classes.
A tag group can consist of the sum of several of these.
void ReadXML(T &v, const String &v_name, const String &f, const String &f_name, const Verbosity &verbosity)
WORKSPACE METHOD: ReadXML.
Definition: m_xml.h:41
Declarations required for the calculation of absorption coefficients.
int main(int, char *[])
Definition: test_quantum.cc:27
void Set(Index qn, Rational r)
Set quantum number at position.
Definition: quantum.h:310
void define_species_data()
Container class for Quantum Numbers.
Definition: quantum.h:222
This can be used to make arrays out of anything.
Definition: array.h:40
Workspace methods and template functions for supergeneric XML IO.
void WriteXML(const String &file_format, const T &v, const String &f, const Index &no_clobber, const String &v_name, const String &f_name, const String &no_clobber_name, const Verbosity &verbosity)
WORKSPACE METHOD: WriteXML.
Definition: m_xml.h:118
void timerStop(const Timer &, const Verbosity &)
Definition: m_general.cc:389