ARTS  2.3.1285(git:92a29ea9-dirty)
linemixingdata.h
Go to the documentation of this file.
1 /* Copyright (C) 2012
2 Richard Larsson <ric.larsson@gmail.com>
3 
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
7 later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 USA. */
18 
26 #ifndef linemixingdata_h
27 #define linemixingdata_h
28 
29 #include <stdexcept>
30 #include <cmath>
31 #include "interpolation.h"
32 #include "interpolation_poly.h"
33 #include "matpackI.h"
34 #include "array.h"
35 #include "mystring.h"
36 #include "complex.h"
37 #include "jacobian.h"
38 
40 {
41 public:
42 
43  enum LM_Type : Index {
44  LM_NONE, // Reserved for no line mixing
45  LM_LBLRTM, // Reserved for LBLRTM line mixing
46  LM_LBLRTM_O2NonResonant, // Reserved for the non-resonant O2 line in LBLRTM
47  LM_1STORDER, // Reserved for Tretyakov et al. 2005 1st order of line mixing
48  LM_2NDORDER, // Reserved for Makarov et al. 2011 second order of line mixing
49  LM_BYBAND // Reserved for Paris data of relaxation matrix line mixing for band
50  };
51 
52  // Defining an object
54 
55  // Use these to get the raw data from this class
56  const LM_Type& Type() const {return mtype;}
57  const ArrayOfVector& Data() const {return mdata;}
58 
59  // Use these to return data in the format required by the line shape calculator
60  void GetLineMixingParams(Numeric& Y, Numeric& G, Numeric& DV, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit, const Index& order=1) const;
61  void GetLineMixingParams_dT(Numeric& dY_dT, Numeric& dG_dG, Numeric& dDV_dT, const Numeric& Temperature, const Numeric& dt, const Numeric& Pressure, const Numeric& Pressure_Limit, const Index& order=1) const;
62  void GetLineMixingParams_dZerothOrder(Numeric& dY0, Numeric& dG0, Numeric& dDV0, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
63  void GetLineMixingParams_dFirstOrder(Numeric& dY1, Numeric& dG1, Numeric& dDV1, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
64  void GetLineMixingParams_dExponent(Numeric& dYexp, Numeric& dGexp, Numeric& dDVexp, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
65  void Get2ndOrder(Numeric& Y, Numeric& G, Numeric& DV, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
66  void Get2ndOrder_dT(Numeric& dY_dT, Numeric& dG_dT, Numeric& dDV_dT, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
67  void Get2ndOrder_dZerothOrder(Numeric& dY0, Numeric& dG0, Numeric& dDV0, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
68  void Get2ndOrder_dFirstOrder(Numeric& dY1, Numeric& dG1, Numeric& dDV1, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
69  void Get2ndOrder_dExponent(Numeric& dYexp, Numeric& dGexp, Numeric& dDVexp, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
70  void Get1stOrder(Numeric& Y, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
71  void Get1stOrder_dT(Numeric& dY_dT, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
72  void Get1stOrder_dZerothOrder(Numeric& dY0, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
73  void Get1stOrder_dExponent(Numeric& dYexp, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit) const;
74  void GetLBLRTM(Numeric& Y, Numeric& G, const Numeric& Temperature, const Numeric& Pressure, const Numeric& Pressure_Limit, const Index& order) const;
75  void GetLBLRTM_dT(Numeric& dY_dT, Numeric& dG_dT, const Numeric& Temperature, const Numeric& dt, const Numeric& Pressure, const Numeric& Pressure_Limit, const Index& order) const;
76  void GetLBLRTM_O2NonResonant(Numeric& G) const;
77 
78  // Use these to change values
79  void ChangeY0(const Numeric& change, const bool relative=false);
80  void ChangeY1(const Numeric& change, const bool relative=false);
81  void ChangeYexp(const Numeric& change, const bool relative=false);
82  void ChangeG0(const Numeric& change, const bool relative=false);
83  void ChangeG1(const Numeric& change, const bool relative=false);
84  void ChangeGexp(const Numeric& change, const bool relative=false);
85  void ChangeDF0(const Numeric& change, const bool relative=false);
86  void ChangeDF1(const Numeric& change, const bool relative=false);
87  void ChangeDFexp(const Numeric& change, const bool relative=false);
88 
89  // Use these to insert the data in the required format from catalog readings
90  void SetLBLRTMFromTheirCatalog(const Vector& t, const Vector& y, const Vector& g)
91  {
92  mtype = LM_LBLRTM;
93  mdata.resize(3);
94  mdata[0] = t;
95  mdata[1] = y;
96  mdata[2] = g;
97  }
98 
99  void SetLBLRTM_O2NonResonantFromTheirCatalog(const Vector& t, const Vector& gamma1, const Vector& gamma2)
100  {
102  mdata.resize(3);
103  mdata[0] = t;
104  mdata[1] = gamma1;
105  mdata[2] = gamma2;
106  }
107 
110 
111  // Use these to read data from XML-formats
112  void StorageTag2SetType(const String& input);
113  void SetTypeFromIndex(const Index& type) {mtype = LM_Type(type);};
116 
117  // Use these to read data from ARTS catalog
118  void Vector2LBLRTMData(const Vector& input);
119  void Vector2LBLRTM_O2NonResonantData(const Vector& input);
120  void Vector2NoneData(const Vector&);
121  void Vector2SecondOrderData(const Vector& input);
122  void Vector2FirstOrderData(const Vector& input);
123 
124  // Use these to save output vector in ARTS catalog
125  void GetVectorFromData(Vector& output) const;
126  void LBLRTMData2Vector(Vector& output) const;
127  void LBLRTM_O2NonResonantData2Vector(Vector& output) const;
128  String Type2StorageTag() const;
129  void SecondOrderData2Vector(Vector& output) const;
130  void FirstOrderData2Vector(Vector& output) const;
131 
132  void SetInternalDerivatives(ComplexVector& derivatives, const ArrayOfRetrievalQuantity& ppd, const QuantumIdentifier& QI, const Numeric& temperature, const Numeric& pressure, const Numeric& pressure_limit) const;
133 
134 private:
135  // mtype identifies the type of line mixing and mdata should contain the required data
138 };
139 
140 #endif // linemixingdata_h
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
void GetLineMixingParams_dT(Numeric &dY_dT, Numeric &dG_dG, Numeric &dDV_dT, const Numeric &Temperature, const Numeric &dt, const Numeric &Pressure, const Numeric &Pressure_Limit, const Index &order=1) const
void GetVectorFromData(Vector &output) const
void ChangeYexp(const Numeric &change, const bool relative=false)
void Vector2LBLRTMData(const Vector &input)
A class implementing complex numbers for ARTS.
void ChangeG0(const Numeric &change, const bool relative=false)
void ChangeDF1(const Numeric &change, const bool relative=false)
Routines for setting up the jacobian.
The Vector class.
Definition: matpackI.h:860
void GetLBLRTM_O2NonResonant(Numeric &G) const
void GetLBLRTM_dT(Numeric &dY_dT, Numeric &dG_dT, const Numeric &Temperature, const Numeric &dt, const Numeric &Pressure, const Numeric &Pressure_Limit, const Index &order) const
void SecondOrderData2Vector(Vector &output) const
String Type2StorageTag() const
void SetLBLRTM_O2NonResonantFromTheirCatalog(const Vector &t, const Vector &gamma1, const Vector &gamma2)
void LBLRTMData2Vector(Vector &output) const
Header file for interpolation.cc.
void Get1stOrder_dZerothOrder(Numeric &dY0, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void FirstOrderData2Vector(Vector &output) const
void SetInternalDerivatives(ComplexVector &derivatives, const ArrayOfRetrievalQuantity &ppd, const QuantumIdentifier &QI, const Numeric &temperature, const Numeric &pressure, const Numeric &pressure_limit) const
ArrayOfVector mdata
This file contains the definition of Array.
void Vector2NoneData(const Vector &)
const ArrayOfVector & Data() const
void GetLineMixingParams_dZerothOrder(Numeric &dY0, Numeric &dG0, Numeric &dDV0, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void Get2ndOrder_dExponent(Numeric &dYexp, Numeric &dGexp, Numeric &dDVexp, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void ChangeDF0(const Numeric &change, const bool relative=false)
void SetLBLRTMFromTheirCatalog(const Vector &t, const Vector &y, const Vector &g)
void StorageTag2SetType(const String &input)
void SetDataFromVectorWithKnownType(ConstVectorView)
void Get2ndOrder(Numeric &Y, Numeric &G, Numeric &DV, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void ChangeY0(const Numeric &change, const bool relative=false)
Class to identify and match lines by their quantum numbers.
Definition: quantum.h:390
void Vector2SecondOrderData(const Vector &input)
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
void GetLineMixingParams_dFirstOrder(Numeric &dY1, Numeric &dG1, Numeric &dDV1, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void GetLineMixingParams(Numeric &Y, Numeric &G, Numeric &DV, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit, const Index &order=1) const
void Get1stOrder_dT(Numeric &dY_dT, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
Implementation of Matrix, Vector, and such stuff.
The ComplexVector class.
Definition: complex.h:573
void Vector2LBLRTM_O2NonResonantData(const Vector &input)
void Get2ndOrder_dFirstOrder(Numeric &dY1, Numeric &dG1, Numeric &dDV1, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
Header file for interpolation_poly.cc.
void ChangeDFexp(const Numeric &change, const bool relative=false)
void Vector2FirstOrderData(const Vector &input)
void Set2ndOrderType()
void GetLBLRTM(Numeric &Y, Numeric &G, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit, const Index &order) const
void Get2ndOrder_dT(Numeric &dY_dT, Numeric &dG_dT, Numeric &dDV_dT, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void Get1stOrder(Numeric &Y, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
A constant view of a Vector.
Definition: matpackI.h:476
const LM_Type & Type() const
void Get1stOrder_dExponent(Numeric &dYexp, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
Index ExpectedVectorLengthFromType() const
void ChangeY1(const Numeric &change, const bool relative=false)
void LBLRTM_O2NonResonantData2Vector(Vector &output) const
void SetTypeFromIndex(const Index &type)
void GetLineMixingParams_dExponent(Numeric &dYexp, Numeric &dGexp, Numeric &dDVexp, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
void ChangeGexp(const Numeric &change, const bool relative=false)
void ChangeG1(const Numeric &change, const bool relative=false)
void Get2ndOrder_dZerothOrder(Numeric &dY0, Numeric &dG0, Numeric &dDV0, const Numeric &Temperature, const Numeric &Pressure, const Numeric &Pressure_Limit) const
This file contains the definition of String, the ARTS string class.