ARTS  2.4.0(git:4fb77825)
jacobian.h
Go to the documentation of this file.
1 /* Copyright (C) 2004-2012 Mattias Ekstrom <ekstrom@rss.chalmers.se>
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 
26 #ifndef jacobian_h
27 #define jacobian_h
28 
29 #include <iostream>
30 #include <map>
31 #include <stdexcept>
32 #include "abs_species_tags.h"
33 #include "agenda_class.h"
34 #include "array.h"
35 #include "bifstream.h"
36 #include "interpolation.h"
37 #include "logic.h"
38 #include "matpackI.h"
39 #include "methods.h"
40 #include "mystring.h"
41 #include "ppath.h"
42 
43 #include "quantum.h"
44 
46 enum class JacPropMatType : Index {
47  VMR,
48  Electrons,
49  Particulates,
50  Temperature,
51 
52  MagneticMagnitude,
53  MagneticU,
54  MagneticV,
55  MagneticW,
56 
57  WindMagnitude,
58  WindU,
59  WindV,
60  WindW,
61  Frequency, // Note: This is how wind is done internal to propmat agenda
62 
63  LineStrength,
64  LineCenter,
65 
66  LineSpecialParameter1,
67 
68  LineShapeG0X0,
69  LineShapeG0X1,
70  LineShapeG0X2,
71  LineShapeG0X3,
72 
73  LineShapeD0X0,
74  LineShapeD0X1,
75  LineShapeD0X2,
76  LineShapeD0X3,
77 
78  LineShapeG2X0,
79  LineShapeG2X1,
80  LineShapeG2X2,
81  LineShapeG2X3,
82 
83  LineShapeD2X0,
84  LineShapeD2X1,
85  LineShapeD2X2,
86  LineShapeD2X3,
87 
88  LineShapeFVCX0,
89  LineShapeFVCX1,
90  LineShapeFVCX2,
91  LineShapeFVCX3,
92 
93  LineShapeETAX0,
94  LineShapeETAX1,
95  LineShapeETAX2,
96  LineShapeETAX3,
97 
98  LineShapeYX0,
99  LineShapeYX1,
100  LineShapeYX2,
101  LineShapeYX3,
102 
103  LineShapeGX0,
104  LineShapeGX1,
105  LineShapeGX2,
106  LineShapeGX3,
107 
108  LineShapeDVX0,
109  LineShapeDVX1,
110  LineShapeDVX2,
111  LineShapeDVX3,
112 
113  NLTE,
114 
116 };
117 
118 
121  public:
124  : mmaintag(),
125  msubtag(),
126  msubsubtag(),
127  mmode(),
128  manalytical(-1),
129  mperturbation(0.),
130  mgrids(),
133  mintegration_flag(false) { /* Nothing to do here. */
134  }
135 
146  RetrievalQuantity(const String& maintag,
147  const String& subtag,
148  const String& subsubtag,
149  const String& mode,
150  const Index& analytical,
151  const Numeric& perturbation,
152  const ArrayOfVector& grids)
153  : mmaintag(maintag),
154  msubtag(subtag),
155  msubsubtag(subsubtag),
156  mmode(mode),
157  manalytical(analytical),
158  mperturbation(perturbation),
159  mgrids(grids),
162  mintegration_flag(false) {
163  // With Matpack, initialization of mgrids from grids should work correctly.
164  }
165 
170  const String& MainTag() const { return mmaintag; }
171 
176  void MainTag(const String& mt) { mmaintag = mt; }
177 
184  const String& Subtag() const { return msubtag; }
185 
190  void Subtag(const String& st) { msubtag = st; }
191 
198  const String& SubSubtag() const { return msubsubtag; }
199 
204  void SubSubtag(const String& sst) { msubsubtag = sst; }
205 
213  const String& Mode() const { return mmode; }
214 
219  void Mode(const String& m) { mmode = m; }
220 
227  const Index& Analytical() const { return manalytical; }
228 
233  void Analytical(const Index& m) { manalytical = m; }
234 
241  const Numeric& Perturbation() const { return mperturbation; }
242 
247  void Perturbation(const Numeric& p) { mperturbation = p; }
248 
255  const ArrayOfVector& Grids() const { return mgrids; }
256 
261  void Grids(const ArrayOfVector& g) { mgrids = g; }
262 
268 
273  void PropType(const JacPropMatType t) { mproptype = t; }
274 
281  bool operator==(const JacPropMatType t) const { return t == mproptype; }
282 
289  bool operator!=(const JacPropMatType t) const { return not operator==(t); }
290 
297  Index nelem() const {
298  Index i = 1;
299  for (Index j = 0; j < mgrids.nelem(); ++j) {
300  i *= mgrids[j].nelem();
301  }
302  return i;
303  }
304 
312  return mquantumidentifier;
313  }
314 
320 
326  bool Integration() const { return mintegration_flag; }
327 
329  void IntegrationOn() { mintegration_flag = true; }
330 
332  void IntegrationOff() { mintegration_flag = false; }
333 
342  void SetOffsetVector(const Vector& b) { offset_vector = b; }
343  bool HasAffine() const { return !transformation_matrix.empty(); }
344  const String& TransformationFunc() const { return transformation_func; }
345  const Vector& TFuncParameters() const { return tfunc_parameters; }
347  const Vector& OffsetVector() const { return offset_vector; }
348 
355  bool HasSameInternalsAs(const RetrievalQuantity& a) const {
356  return a.mmaintag == mmaintag and a.msubtag == msubtag and
357  a.msubsubtag == msubsubtag and a.mmode == mmode and
358  a.manalytical == manalytical and
360  a.mproptype == mproptype;
361  }
362 
363  String& MainTag() {return mmaintag;}
364  String& SubTag() {return msubtag;}
366  String& Mode() {return mmode;}
372  Index Proptype(JacPropMatType x) {if (validProptype(x)) {mproptype = x; return EXIT_SUCCESS;} else return EXIT_FAILURE;}
379 
380  private:
391 
394 
397 };
398 
400 ostream& operator<<(ostream& os, const RetrievalQuantity& ot);
401 
403 
404 // A macro to loop analytical jacobian quantities
405 #define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do) \
406  for (Index iq = 0; iq < jacobian_quantities.nelem(); iq++) { \
407  if (jacobian_quantities[iq].Analytical()) { \
408  what_to_do \
409  } \
410  }
411 // A macro to loop analytical jacobian quantities
412 #define FOR_ANALYTICAL_JACOBIANS_DO2(what_to_do) \
413  for (Index iq = 0; iq < jacobian_quantities.nelem(); iq++) { \
414  if (jacobian_quantities[iq].Analytical() || \
415  jacobian_quantities[iq].MainTag() == SURFACE_MAINTAG) { \
416  what_to_do \
417  } \
418  }
419 
420 //======================================================================
421 // Index ranges and transformation functions
422 //======================================================================
423 
442  bool& any_affine,
443  const ArrayOfRetrievalQuantity& jqs,
444  const bool& before_affine = false);
445 
455  const Vector x,
456  const ArrayOfRetrievalQuantity& jqs);
457 
468 void transform_x(Vector& x, const ArrayOfRetrievalQuantity& jqs);
469 
480 void transform_x_back(Vector& x_t,
481  const ArrayOfRetrievalQuantity& jqs,
482  bool revert_functional_transforms = true);
483 
484 //======================================================================
485 // Functions related to calculation of Jacobian
486 //======================================================================
487 
518  ostringstream& os,
519  const Vector& p_grid,
520  const Vector& lat_grid,
521  const Vector& lon_grid,
522  const Vector& p_retr,
523  const Vector& lat_retr,
524  const Vector& lon_retr,
525  const String& p_retr_name,
526  const String& lat_retr_name,
527  const String& lon_retr_name,
528  const Index& dim);
529 
530 
557  ostringstream& os,
558  const Vector& lat_grid,
559  const Vector& lon_grid,
560  const Vector& lat_retr,
561  const Vector& lon_retr,
562  const String& lat_retr_name,
563  const String& lon_retr_name,
564  const Index& dim);
565 
580  const RetrievalQuantity& jacobian_quantity,
581  ConstTensor3View diy_dpath,
582  const Index& atmosphere_dim,
583  const Ppath& ppath,
584  ConstVectorView ppath_p);
585 
600  const RetrievalQuantity& jacobian_quantity,
601  ConstMatrixView diy_dpos,
602  const Index& atmosphere_dim,
604 
628  ArrayOfIndex& abs_species_i,
629  ArrayOfIndex& scat_species_i,
630  ArrayOfIndex& is_t,
631  ArrayOfIndex& wind_i,
632  ArrayOfIndex& magfield_i,
635  const Index& cloudbox_on,
636  const ArrayOfString& scat_species);
637 
655 
670 void polynomial_basis_func(Vector& b, const Vector& x, const Index& poly_coeff);
671 
693  const Vector& x,
694  const Index& mblock_index,
695  const Sparse& sensor_response,
699  const RetrievalQuantity& rq,
700  const Index rq_index,
701  const ArrayOfArrayOfIndex& jacobian_indices);
702 
718 void vmrunitscf(Numeric& x,
719  const String& unit,
720  const Numeric& vmr,
721  const Numeric& p,
722  const Numeric& t);
723 
740 void dxdvmrscf(Numeric& x,
741  const String& unit,
742  const Numeric& vmr,
743  const Numeric& p,
744  const Numeric& t);
745 
747 enum class JacobianType : Index {
748  None = 0, // Setting to nil means that (bool)0 and (bool)N still works.
749  Temperature,
750  WindFieldU,
751  WindFieldV,
752  WindFieldW,
753  AbsWind,
754  MagFieldU,
755  MagFieldV,
756  MagFieldW,
757  AbsMag,
758  Other
759 };
760 
785 void get_diydx(VectorView diy1,
786  VectorView diy2,
787  ConstMatrixView ImT,
789  ConstMatrixView dT1,
790  ConstMatrixView dT2,
791  ConstVectorView iYmJ,
792  ConstVectorView dJ1,
793  ConstVectorView dJ2,
794  const Index stokes_dim,
795  const bool transmission_only = false);
796 
797 //======================================================================
798 // Propmat partials descriptions
799 //======================================================================
800 
807 
815  const Index i) noexcept;
816 
823 
830 
837  const ArrayOfRetrievalQuantity& js) noexcept;
838 
847 
848 //======================================================================
849 // Propmat partials boolean functions
850 //======================================================================
851 
858 bool is_wind_parameter(const RetrievalQuantity& t) noexcept;
859 
866 bool is_frequency_parameter(const RetrievalQuantity& t) noexcept;
867 
874 bool is_derived_magnetic_parameter(const RetrievalQuantity& t) noexcept;
875 
882 bool is_magnetic_parameter(const RetrievalQuantity& t) noexcept;
883 
890 bool is_nlte_parameter(const RetrievalQuantity& t) noexcept;
891 
899 
909 
917 
927 
937 
947 
957 
967 
977 
986 bool is_lineshape_parameter_X0(const RetrievalQuantity& t) noexcept;
987 
996 bool is_lineshape_parameter_X1(const RetrievalQuantity& t) noexcept;
997 
1006 bool is_lineshape_parameter_X2(const RetrievalQuantity& t) noexcept;
1007 
1017 
1026 bool is_lineshape_parameter(const RetrievalQuantity& t) noexcept;
1027 
1034 bool is_line_parameter(const RetrievalQuantity& t) noexcept;
1035 
1042 bool supports_CIA(const ArrayOfRetrievalQuantity& js);
1043 
1051 
1052 
1060 
1070 
1078 
1086 
1094 
1102 
1110 
1118 
1128 bool species_match(const RetrievalQuantity& rq, const ArrayOfSpeciesTag& ast);
1129 
1137 bool species_match(const RetrievalQuantity& rq, const Index species);
1138 
1147 bool species_iso_match(const RetrievalQuantity& rq,
1148  const Index species,
1149  const Index iso);
1150 
1157 bool do_temperature_jacobian(const ArrayOfRetrievalQuantity& js) noexcept;
1158 
1161  bool test;
1163 };
1164 
1173  const QuantumIdentifier& line_qid) noexcept;
1174 
1181 bool do_line_center_jacobian(const ArrayOfRetrievalQuantity& js) noexcept;
1182 
1189 bool do_frequency_jacobian(const ArrayOfRetrievalQuantity& js) noexcept;
1190 
1197 bool do_magnetic_jacobian(const ArrayOfRetrievalQuantity& js) noexcept;
1198 
1199 #endif // jacobian_h
Matrix
The Matrix class.
Definition: matpackI.h:1193
RetrievalQuantity::SetTransformationFunc
void SetTransformationFunc(const String &s)
Transformation.
Definition: jacobian.h:339
ARTS::Var::atmosphere_dim
Index atmosphere_dim(Workspace &ws) noexcept
Definition: autoarts.h:2510
RetrievalQuantity::mproptype
JacPropMatType mproptype
Definition: jacobian.h:389
is_lineshape_parameter_X0
bool is_lineshape_parameter_X0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X0 derivative.
Definition: jacobian.cc:1155
is_lineshape_parameter_bar_linemixing
bool is_lineshape_parameter_bar_linemixing(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC derivative.
Definition: jacobian.cc:1180
ARTS::Var::sensor_response_dlos_grid
Matrix sensor_response_dlos_grid(Workspace &ws) noexcept
Definition: autoarts.h:6356
is_derived_magnetic_parameter
bool is_derived_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a derived magnetic parameter.
Definition: jacobian.cc:1124
supports_particles
bool supports_particles(const ArrayOfRetrievalQuantity &js)
Returns if the array supports particulate derivatives.
Definition: jacobian.cc:1236
RetrievalQuantity::transformation_func
String transformation_func
Definition: jacobian.h:392
RetrievalQuantity::Analytical
const Index & Analytical() const
Returns the analytical tag.
Definition: jacobian.h:227
is_pressure_broadening_Y
bool is_pressure_broadening_Y(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a Y derivative.
QuantumIdentifier
Class to identify and match lines by their quantum numbers.
Definition: quantum.h:390
ARTS::Var::jacobian_quantities
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Definition: autoarts.h:3924
get_pointers_for_analytical_jacobians
void get_pointers_for_analytical_jacobians(ArrayOfIndex &abs_species_i, ArrayOfIndex &scat_species_i, ArrayOfIndex &is_t, ArrayOfIndex &wind_i, ArrayOfIndex &magfield_i, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const ArrayOfString &scat_species)
Help function for analytical jacobian calculations.
Definition: jacobian.cc:596
RetrievalQuantity::Grids
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
Definition: jacobian.h:255
check_retrieval_grids
bool check_retrieval_grids(ArrayOfVector &grids, ostringstream &os, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &p_retr, const Vector &lat_retr, const Vector &lon_retr, const String &p_retr_name, const String &lat_retr_name, const String &lon_retr_name, const Index &dim)
Check that the retrieval grids are defined for each atmosphere dim.
Definition: jacobian.cc:690
RetrievalQuantity::Mode
String & Mode()
Definition: jacobian.h:366
iso
void iso(Array< IsotopologueRecord >::iterator &ii, String name, const ArrayOfNumeric &coeff, const ArrayOfNumeric &temp_range, const Index &coefftype)
Initialize isotopologue and move iterator to next one.
Definition: partition_function_data.cc:1732
RetrievalQuantity::Transformation
Matrix & Transformation()
Definition: jacobian.h:377
RetrievalQuantity::Integration
void Integration(bool x)
Definition: jacobian.h:374
RetrievalQuantity::TransformationFunc
String & TransformationFunc()
Definition: jacobian.h:375
ARTS::Var::sensor_response
Sparse sensor_response(Workspace &ws) noexcept
Definition: autoarts.h:6300
RetrievalQuantity::MainTag
String & MainTag()
Definition: jacobian.h:363
RetrievalQuantity::IntegrationOff
void IntegrationOff()
Sets the integration flag to false.
Definition: jacobian.h:332
ARTS::Var::lat_grid
Vector lat_grid(Workspace &ws) noexcept
Definition: autoarts.h:3962
RetrievalQuantity::QuantumIdentity
const QuantumIdentifier & QuantumIdentity() const
Returns the identity of this Jacobian.
Definition: jacobian.h:311
RetrievalQuantity::SubSubtag
const String & SubSubtag() const
Returns the sub-sub-tag.
Definition: jacobian.h:198
species_match
bool species_match(const RetrievalQuantity &rq, const ArrayOfSpeciesTag &ast)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags.
Definition: jacobian.cc:1244
interpolation.h
Header file for interpolation.cc.
is_lineshape_parameter_X2
bool is_lineshape_parameter_X2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X2 derivative.
Definition: jacobian.cc:1171
ARTS::Var::y_baseline
Vector y_baseline(Workspace &ws) noexcept
Definition: autoarts.h:7447
jacobianVMRcheck::qid
const QuantumIdentifier & qid
Definition: jacobian.h:1162
RetrievalQuantity::msubsubtag
String msubsubtag
Definition: jacobian.h:383
Sparse
The Sparse class.
Definition: matpackII.h:60
RetrievalQuantity::mmode
String mmode
Definition: jacobian.h:384
ARTS::Var::diy_dx
ArrayOfTensor3 diy_dx(Workspace &ws) noexcept
Definition: autoarts.h:3007
RetrievalQuantity::offset_vector
Vector offset_vector
Definition: jacobian.h:396
is_pressure_broadening_FVC
bool is_pressure_broadening_FVC(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a FVC derivative.
supports_continuum
bool supports_continuum(const ArrayOfRetrievalQuantity &js)
Returns if the array supports continuum derivatives.
Definition: jacobian.cc:1208
ARTS::Var::stokes_dim
Index stokes_dim(Workspace &ws) noexcept
Definition: autoarts.h:6650
temperature_perturbation
Numeric temperature_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the temperature perturbation if it exists.
Definition: jacobian.cc:1304
ArrayOfRetrievalQuantity
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Definition: jacobian.h:402
RetrievalQuantity::tfunc_parameters
Vector tfunc_parameters
Definition: jacobian.h:393
is_pressure_broadening_DV
bool is_pressure_broadening_DV(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a DV derivative.
JacPropMatType
JacPropMatType
List of Jacobian properties for analytical line shape related derivatives.
Definition: jacobian.h:46
RetrievalQuantity::OffsetVector
const Vector & OffsetVector() const
Definition: jacobian.h:347
JacobianType::None
@ None
get_diydx
void get_diydx(VectorView diy1, VectorView diy2, ConstMatrixView ImT, ConstMatrixView cumulative_transmission, ConstMatrixView dT1, ConstMatrixView dT2, ConstVectorView iYmJ, ConstVectorView dJ1, ConstVectorView dJ2, const Index stokes_dim, const bool transmission_only=false)
Definition: jacobian.cc:1049
RetrievalQuantity::SetTFuncParameters
void SetTFuncParameters(const Vector &p)
Definition: jacobian.h:340
RetrievalQuantity::mperturbation
Numeric mperturbation
Definition: jacobian.h:386
quantum.h
supports_propmat_clearsky
bool supports_propmat_clearsky(const ArrayOfRetrievalQuantity &js)
Returns if the array supports propagation matrix derivatives.
Definition: jacobian.cc:1240
supports_hitran_xsec
bool supports_hitran_xsec(const ArrayOfRetrievalQuantity &js)
Returns if the array supports HITRAN cross-section derivatives.
Definition: jacobian.cc:1204
equivalent_propmattype_index
Index equivalent_propmattype_index(const ArrayOfRetrievalQuantity &js, const Index i) noexcept
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Definition: jacobian.cc:1107
array.h
This file contains the definition of Array.
is_frequency_parameter
bool is_frequency_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
Definition: jacobian.cc:1120
is_wind_parameter
bool is_wind_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a wind parameter.
Definition: jacobian.cc:1115
RetrievalQuantity::Offset
Vector & Offset()
Definition: jacobian.h:378
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
RetrievalQuantity::Subtag
void Subtag(const String &st)
Sets the sub-tag.
Definition: jacobian.h:190
RetrievalQuantity::SubSubtag
void SubSubtag(const String &sst)
Sets the sub-sub-tag.
Definition: jacobian.h:204
is_pressure_broadening_D0
bool is_pressure_broadening_D0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D0 derivative.
is_pressure_broadening_G0
bool is_pressure_broadening_G0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
RetrievalQuantity::Analytical
Index & Analytical()
Definition: jacobian.h:367
matpackI.h
Implementation of Matrix, Vector, and such stuff.
Tensor3View
The Tensor3View class.
Definition: matpackIII.h:239
RetrievalQuantity::validProptype
static bool validProptype(JacPropMatType x) noexcept
Definition: jacobian.h:373
Array< Vector >
RetrievalQuantity::operator!=
bool operator!=(const JacPropMatType t) const
Returns "not operator==(t)".
Definition: jacobian.h:289
supports_zeeman
bool supports_zeeman(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Zeeman derivatives.
RetrievalQuantity::IntegrationOn
void IntegrationOn()
Sets the integration flag to true.
Definition: jacobian.h:329
RetrievalQuantity::Perturbation
void Perturbation(const Numeric &p)
Sets the size of perturbation.
Definition: jacobian.h:247
polynomial_basis_func
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
Definition: jacobian.cc:897
RetrievalQuantity::TransformationMatrix
const Matrix & TransformationMatrix() const
Definition: jacobian.h:346
agenda_class.h
Declarations for agendas.
is_lineshape_parameter
bool is_lineshape_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC, Y, G, DV derivative.
Definition: jacobian.cc:1187
RetrievalQuantity::QuantumIdentity
void QuantumIdentity(const QuantumIdentifier &qi)
Sets the identity of this Jacobian.
Definition: jacobian.h:319
do_line_center_jacobian
bool do_line_center_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a line center derivative.
Definition: jacobian.cc:1292
dxdvmrscf
void dxdvmrscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion of derivatives with respect to VMR.
Definition: jacobian.cc:1029
RetrievalQuantity::RetrievalQuantity
RetrievalQuantity(const String &maintag, const String &subtag, const String &subsubtag, const String &mode, const Index &analytical, const Numeric &perturbation, const ArrayOfVector &grids)
Constructor that sets the values.
Definition: jacobian.h:146
my_basic_string< char >
vmrunitscf
void vmrunitscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion between gas species units.
Definition: jacobian.cc:1001
RetrievalQuantity::HasSameInternalsAs
bool HasSameInternalsAs(const RetrievalQuantity &a) const
Checks that all the internal variables of *this match with those of the input.
Definition: jacobian.h:355
RetrievalQuantity::Integration
bool Integration() const
Do integration?
Definition: jacobian.h:326
RetrievalQuantity::MainTag
const String & MainTag() const
Returns the main tag.
Definition: jacobian.h:170
VectorView
The VectorView class.
Definition: matpackI.h:610
ARTS::Var::abs_species
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Definition: autoarts.h:2157
ARTS::Var::p_grid
Vector p_grid(Workspace &ws) noexcept
Definition: autoarts.h:4763
ARTS::Var::ppath
Ppath ppath(Workspace &ws) noexcept
Definition: autoarts.h:5139
supports_lookup
bool supports_lookup(const ArrayOfRetrievalQuantity &js)
Returns if the array supports lookup table derivatives.
Definition: jacobian.cc:1224
RetrievalQuantity::Mode
const String & Mode() const
Returns the mode.
Definition: jacobian.h:213
transform_jacobian
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
Definition: jacobian.cc:103
RetrievalQuantity::mquantumidentifier
QuantumIdentifier mquantumidentifier
Definition: jacobian.h:388
equivalent_propmattype_indexes
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Definition: jacobian.cc:1099
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
RetrievalQuantity::RetrievalQuantity
RetrievalQuantity()
Default constructor.
Definition: jacobian.h:123
do_temperature_jacobian
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
Definition: jacobian.cc:1279
species_iso_match
bool species_iso_match(const RetrievalQuantity &rq, const Index species, const Index iso)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags.
Definition: jacobian.cc:1268
magnetic_field_perturbation
Numeric magnetic_field_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the magnetic field perturbation if it exists.
Definition: jacobian.cc:1320
calcBaselineFit
void calcBaselineFit(Vector &y_baseline, const Vector &x, const Index &mblock_index, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const RetrievalQuantity &rq, const Index rq_index, const ArrayOfArrayOfIndex &jacobian_indices)
Calculate baseline fit.
Definition: jacobian.cc:921
is_lineshape_parameter_X1
bool is_lineshape_parameter_X1(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X1 derivative.
Definition: jacobian.cc:1163
RetrievalQuantity::Analytical
void Analytical(const Index &m)
Sets the analytical tag.
Definition: jacobian.h:233
RetrievalQuantity::TFuncParameters
Vector & TFuncParameters()
Definition: jacobian.h:376
supports_LBL_without_phase
bool supports_LBL_without_phase(const ArrayOfRetrievalQuantity &js)
Returns if the array supports line-by-line derivatives without requiring the phase.
Definition: jacobian.cc:1214
ARTS::Var::sensor_response_f_grid
Vector sensor_response_f_grid(Workspace &ws) noexcept
Definition: autoarts.h:6392
RetrievalQuantity::HasAffine
bool HasAffine() const
Definition: jacobian.h:343
abs_species_tags.h
Header file for stuff related to absorption species tags.
RetrievalQuantity::transformation_matrix
Matrix transformation_matrix
Definition: jacobian.h:395
is_pressure_broadening_G
bool is_pressure_broadening_G(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G derivative.
bifstream.h
This file contains the class declaration of bifstream.
RetrievalQuantity::Grids
void Grids(const ArrayOfVector &g)
Sets the grids of the retrieval.
Definition: jacobian.h:261
ARTS::Var::lon_grid
Vector lon_grid(Workspace &ws) noexcept
Definition: autoarts.h:4090
RetrievalQuantity::Grids
ArrayOfVector & Grids()
Definition: jacobian.h:369
ConstMatrixView::empty
bool empty() const
Returns true if variable size is zero.
Definition: matpackI.cc:426
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:982
diy_from_path_to_rgrids
void diy_from_path_to_rgrids(Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstTensor3View diy_dpath, const Index &atmosphere_dim, const Ppath &ppath, ConstVectorView ppath_p)
Maps jacobian data for points along the propagation path, to jacobian retrieval grid data.
Definition: jacobian.cc:337
is_pressure_broadening_D2
bool is_pressure_broadening_D2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D2 derivative.
cumulative_transmission
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
Definition: transmissionmatrix.cc:1527
supports_relaxation_matrix
bool supports_relaxation_matrix(const ArrayOfRetrievalQuantity &js)
Returns if the array supports relaxation matrix derivatives.
Definition: jacobian.cc:1218
RetrievalQuantity::PropType
void PropType(const JacPropMatType t)
Sets the propagation matrix derivative type.
Definition: jacobian.h:273
RetrievalQuantity::SetOffsetVector
void SetOffsetVector(const Vector &b)
Definition: jacobian.h:342
jacobian_type_extrapol
void jacobian_type_extrapol(ArrayOfGridPos &gp)
Adopts grid positions to extrapolation used for jacobians.
Definition: jacobian.cc:885
transform_x_back
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms=true)
Handles back-transformations of the state vector.
Definition: jacobian.cc:257
jacobianVMRcheck::test
bool test
Definition: jacobian.h:1161
ppath.h
Propagation path structure and functions.
ARTS::Var::sensor_response_pol_grid
ArrayOfIndex sensor_response_pol_grid(Workspace &ws) noexcept
Definition: autoarts.h:6428
RetrievalQuantity::TransformationFunc
const String & TransformationFunc() const
Definition: jacobian.h:344
do_frequency_jacobian
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
Definition: jacobian.cc:1296
is_pressure_broadening_G2
bool is_pressure_broadening_G2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
RetrievalQuantity::manalytical
Index manalytical
Definition: jacobian.h:385
do_magnetic_jacobian
bool do_magnetic_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a magnetic derivative.
Definition: jacobian.cc:1300
logic.h
Header file for logic.cc.
RetrievalQuantity::Proptype
JacPropMatType Proptype() const
Definition: jacobian.h:371
RetrievalQuantity::MainTag
void MainTag(const String &mt)
Sets the main tag.
Definition: jacobian.h:176
RetrievalQuantity::TFuncParameters
const Vector & TFuncParameters() const
Definition: jacobian.h:345
frequency_perturbation
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
Definition: jacobian.cc:1312
RetrievalQuantity::SubSubTag
String & SubSubTag()
Definition: jacobian.h:365
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:132
supports_CIA
bool supports_CIA(const ArrayOfRetrievalQuantity &js)
Returns if the array supports CIA derivatives.
Definition: jacobian.cc:1200
jacobianVMRcheck
Deals with whether or not we should do a VMR derivative.
Definition: jacobian.h:1160
RetrievalQuantity::QuantumIdentity
QuantumIdentifier & QuantumIdentity()
Definition: jacobian.h:370
jac_ranges_indices
void jac_ranges_indices(ArrayOfArrayOfIndex &jis, bool &any_affine, const ArrayOfRetrievalQuantity &jqs, const bool &before_affine=false)
Determines the index range inside x and the Jacobian for each retrieval quantity.
Definition: jacobian.cc:58
RetrievalQuantity::operator==
bool operator==(const JacPropMatType t) const
Checks if this represents the propagation matrix derivative type.
Definition: jacobian.h:281
is_line_parameter
bool is_line_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is related to the absorption line.
Definition: jacobian.cc:1195
RetrievalQuantity::msubtag
String msubtag
Definition: jacobian.h:382
ARTS::Var::jacobian
Matrix jacobian(Workspace &ws) noexcept
Definition: autoarts.h:3892
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
is_nlte_parameter
bool is_nlte_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a NLTE parameter.
Definition: jacobian.cc:1133
ARTS::Var::scat_species
ArrayOfString scat_species(Workspace &ws) noexcept
Definition: autoarts.h:6086
JacobianType
JacobianType
Enum for knowing what Jacobian scheme is in-play in the m_rte.cc methods.
Definition: jacobian.h:747
RetrievalQuantity
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Definition: jacobian.h:120
RetrievalQuantity::SetTransformationMatrix
void SetTransformationMatrix(const Matrix &A)
Definition: jacobian.h:341
do_vmr_jacobian
jacobianVMRcheck do_vmr_jacobian(const ArrayOfRetrievalQuantity &js, const QuantumIdentifier &line_qid) noexcept
Returns the required info for VMR Jacobian.
Definition: jacobian.cc:1283
RetrievalQuantity::mmaintag
String mmaintag
Definition: jacobian.h:381
RetrievalQuantity::mgrids
ArrayOfVector mgrids
Definition: jacobian.h:387
transform_x
void transform_x(Vector &x, const ArrayOfRetrievalQuantity &jqs)
Handles transformations of the state vector.
Definition: jacobian.cc:168
ARTS::Var::mblock_index
Index mblock_index(Workspace &ws) noexcept
Definition: autoarts.h:4258
Vector
The Vector class.
Definition: matpackI.h:860
RetrievalQuantity::Perturbation
Numeric & Perturbation()
Definition: jacobian.h:368
RetrievalQuantity::mintegration_flag
bool mintegration_flag
Definition: jacobian.h:390
RetrievalQuantity::Mode
void Mode(const String &m)
Sets the mode.
Definition: jacobian.h:219
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:476
is_magnetic_parameter
bool is_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a magnetic parameter.
Definition: jacobian.cc:1128
is_pressure_broadening_ETA
bool is_pressure_broadening_ETA(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a ETA derivative.
diy_from_pos_to_rgrids
void diy_from_pos_to_rgrids(Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstMatrixView diy_dpos, const Index &atmosphere_dim, ConstVectorView rtp_pos)
diy_from_pos_to_rgrids
Definition: jacobian.cc:506
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:195
RetrievalQuantity::Proptype
Index Proptype(JacPropMatType x)
Definition: jacobian.h:372
RetrievalQuantity::nelem
Index nelem() const
Number of elements in the grids.
Definition: jacobian.h:297
RetrievalQuantity::Subtag
const String & Subtag() const
Returns the sub-tag.
Definition: jacobian.h:184
methods.h
Declaration of the class MdRecord.
supports_faraday
bool supports_faraday(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Faraday derivatives.
Definition: jacobian.cc:1230
JacPropMatType::VMR
@ VMR
mystring.h
This file contains the definition of String, the ARTS string class.
RetrievalQuantity::SubTag
String & SubTag()
Definition: jacobian.h:364
ARTS::Var::rtp_pos
Vector rtp_pos(Workspace &ws) noexcept
Definition: autoarts.h:5774
operator<<
ostream & operator<<(ostream &os, const RetrievalQuantity &ot)
Output operator for RetrievalQuantity.
Definition: jacobian.cc:51
RetrievalQuantity::PropMatType
JacPropMatType PropMatType() const
Returns the propagation matrix derivative type.
Definition: jacobian.h:267
ARTS::Var::cloudbox_on
Index cloudbox_on(Workspace &ws) noexcept
Definition: autoarts.h:2782
propmattype_string
String propmattype_string(const RetrievalQuantity &rq)
Returns a string of the retrieval quantity propagation matrix type.
Definition: jacobian.cc:1328
RetrievalQuantity::Perturbation
const Numeric & Perturbation() const
Returns the size of perturbation.
Definition: jacobian.h:241