ARTS  2.3.1285(git:92a29ea9-dirty)
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,
51 
53  MagneticU,
54  MagneticV,
55  MagneticW,
56 
58  WindU,
59  WindV,
60  WindW,
61  Frequency, // Note: This is how wind is done internal to propmat agenda
62 
64  LineCenter,
65 
67 
72 
77 
82 
87 
92 
97 
100  LineShapeYX2,
101  LineShapeYX3,
102 
103  LineShapeGX0,
104  LineShapeGX1,
105  LineShapeGX2,
106  LineShapeGX3,
107 
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(),
131  mquantumidentifier(),
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),
160  mquantumidentifier(),
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 
267  JacPropMatType PropMatType() const { return mproptype; }
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 
319  void QuantumIdentity(const QuantumIdentifier& qi) { mquantumidentifier = qi; }
320 
326  bool Integration() const { return mintegration_flag; }
327 
329  void IntegrationOn() { mintegration_flag = true; }
330 
332  void IntegrationOff() { mintegration_flag = false; }
333 
339  void SetTransformationFunc(const String& s) { transformation_func = s; }
340  void SetTFuncParameters(const Vector& p) { tfunc_parameters = p; }
341  void SetTransformationMatrix(const Matrix& A) { transformation_matrix = A; }
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; }
346  const Matrix& TransformationMatrix() const { return transformation_matrix; }
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
359  a.mquantumidentifier == mquantumidentifier and
360  a.mproptype == mproptype;
361  }
362 
363  String& MainTag() {return mmaintag;}
364  String& SubTag() {return msubtag;}
365  String& SubSubTag() {return msubsubtag;}
366  String& Mode() {return mmode;}
367  Index& Analytical() {return manalytical;}
368  Numeric& Perturbation() {return mperturbation;}
369  ArrayOfVector& Grids() {return mgrids;}
370  QuantumIdentifier& QuantumIdentity() {return mquantumidentifier;}
371  JacPropMatType Proptype() const {return mproptype;}
372  Index Proptype(JacPropMatType x) {if (validProptype(x)) {mproptype = x; return EXIT_SUCCESS;} else return EXIT_FAILURE;}
373  static bool validProptype(JacPropMatType x) noexcept {return Index(x) <= Index(JacPropMatType::NotPropagationMatrixType) and Index(x) >= 0;}
374  void Integration(bool x) {mintegration_flag = x;}
375  String& TransformationFunc() {return transformation_func;}
376  Vector& TFuncParameters() {return tfunc_parameters;}
377  Matrix& Transformation() {return transformation_matrix;}
378  Vector& Offset() {return offset_vector;}
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 
454 void transform_jacobian(Matrix& jacobian,
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,
603  ConstVectorView rtp_pos);
604 
628  ArrayOfIndex& abs_species_i,
629  ArrayOfIndex& scat_species_i,
630  ArrayOfIndex& is_t,
631  ArrayOfIndex& wind_i,
632  ArrayOfIndex& magfield_i,
633  const ArrayOfRetrievalQuantity& jacobian_quantities,
634  const ArrayOfArrayOfSpeciesTag& abs_species,
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 
692 void calcBaselineFit(Vector& y_baseline,
693  const Vector& x,
694  const Index& mblock_index,
695  const Sparse& sensor_response,
696  const ArrayOfIndex& sensor_response_pol_grid,
697  const Vector& sensor_response_f_grid,
698  const Matrix& sensor_response_dlos_grid,
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 
898 bool is_pressure_broadening_G0(const RetrievalQuantity& t) noexcept;
899 
908 bool is_pressure_broadening_D0(const RetrievalQuantity& t) noexcept;
909 
916 bool is_pressure_broadening_G2(const RetrievalQuantity& t) noexcept;
917 
926 bool is_pressure_broadening_D2(const RetrievalQuantity& t) noexcept;
927 
936 bool is_pressure_broadening_FVC(const RetrievalQuantity& t) noexcept;
937 
946 bool is_pressure_broadening_ETA(const RetrievalQuantity& t) noexcept;
947 
956 bool is_pressure_broadening_Y(const RetrievalQuantity& t) noexcept;
957 
966 bool is_pressure_broadening_G(const RetrievalQuantity& t) noexcept;
967 
976 bool is_pressure_broadening_DV(const RetrievalQuantity& t) noexcept;
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
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.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
bool is_pressure_broadening_G0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
bool is_pressure_broadening_Y(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a Y derivative.
String & SubTag()
Definition: jacobian.h:364
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
JacPropMatType PropMatType() const
Returns the propagation matrix derivative type.
Definition: jacobian.h:267
bool is_nlte_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a NLTE parameter.
Definition: jacobian.cc:1133
The VectorView class.
Definition: matpackI.h:610
String propmattype_string(const RetrievalQuantity &rq)
Returns a string of the retrieval quantity propagation matrix type.
Definition: jacobian.cc:1328
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
Definition: jacobian.h:255
String & Mode()
Definition: jacobian.h:366
bool supports_lookup(const ArrayOfRetrievalQuantity &js)
Returns if the array supports lookup table derivatives.
Definition: jacobian.cc:1224
void SetTransformationFunc(const String &s)
Transformation.
Definition: jacobian.h:339
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
Definition: jacobian.cc:103
bool is_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a magnetic parameter.
Definition: jacobian.cc:1128
bool is_pressure_broadening_D0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D0 derivative.
const QuantumIdentifier & QuantumIdentity() const
Returns the identity of this Jacobian.
Definition: jacobian.h:311
const Index & Analytical() const
Returns the analytical tag.
Definition: jacobian.h:227
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
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
Definition: jacobian.cc:1296
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
String msubsubtag
Definition: jacobian.h:383
Matrix & Transformation()
Definition: jacobian.h:377
The Vector class.
Definition: matpackI.h:860
void Integration(bool x)
Definition: jacobian.h:374
String & TransformationFunc()
Definition: jacobian.h:375
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
bool is_lineshape_parameter_X0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X0 derivative.
Definition: jacobian.cc:1155
String & MainTag()
Definition: jacobian.h:363
void IntegrationOff()
Sets the integration flag to false.
Definition: jacobian.h:332
bool is_derived_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a derived magnetic parameter.
Definition: jacobian.cc:1124
The Sparse class.
Definition: matpackII.h:60
bool is_line_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is related to the absorption line.
Definition: jacobian.cc:1195
const String & SubSubtag() const
Returns the sub-sub-tag.
Definition: jacobian.h:198
bool supports_continuum(const ArrayOfRetrievalQuantity &js)
Returns if the array supports continuum derivatives.
Definition: jacobian.cc:1208
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Definition: jacobian.h:402
const QuantumIdentifier & qid
Definition: jacobian.h:1162
const Vector & OffsetVector() const
Definition: jacobian.h:347
void jacobian_type_extrapol(ArrayOfGridPos &gp)
Adopts grid positions to extrapolation used for jacobians.
Definition: jacobian.cc:885
void SetTFuncParameters(const Vector &p)
Definition: jacobian.h:340
bool operator==(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is everything the same between the identifiers.
Definition: quantum.h:702
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
void Subtag(const String &st)
Sets the sub-tag.
Definition: jacobian.h:190
void SubSubtag(const String &sst)
Sets the sub-sub-tag.
Definition: jacobian.h:204
Header file for interpolation.cc.
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
Vector offset_vector
Definition: jacobian.h:396
bool do_magnetic_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a magnetic derivative.
Definition: jacobian.cc:1300
bool is_lineshape_parameter_X2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X2 derivative.
Definition: jacobian.cc:1171
bool supports_relaxation_matrix(const ArrayOfRetrievalQuantity &js)
Returns if the array supports relaxation matrix derivatives.
Definition: jacobian.cc:1218
Index & Analytical()
Definition: jacobian.h:367
Vector tfunc_parameters
Definition: jacobian.h:393
static bool validProptype(JacPropMatType x) noexcept
Definition: jacobian.h:373
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
Definition: jacobian.cc:1312
bool operator!=(const JacPropMatType t) const
Returns "not operator==(t)".
Definition: jacobian.h:289
void Perturbation(const Numeric &p)
Sets the size of perturbation.
Definition: jacobian.h:247
Numeric mperturbation
Definition: jacobian.h:386
bool is_pressure_broadening_FVC(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a FVC derivative.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Definition: jacobian.h:120
This file contains the definition of Array.
JacPropMatType
List of Jacobian properties for analytical line shape related derivatives.
Definition: jacobian.h:46
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
Vector & Offset()
Definition: jacobian.h:378
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
void transform_x(Vector &x, const ArrayOfRetrievalQuantity &jqs)
Handles transformations of the state vector.
Definition: jacobian.cc:168
void IntegrationOn()
Sets the integration flag to true.
Definition: jacobian.h:329
ostream & operator<<(ostream &os, const RetrievalQuantity &ot)
Output operator for RetrievalQuantity.
Definition: jacobian.cc:51
bool is_pressure_broadening_D2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D2 derivative.
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
Numeric magnetic_field_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the magnetic field perturbation if it exists.
Definition: jacobian.cc:1320
const Matrix & TransformationMatrix() const
Definition: jacobian.h:346
void QuantumIdentity(const QuantumIdentifier &qi)
Sets the identity of this Jacobian.
Definition: jacobian.h:319
const String & Mode() const
Returns the mode.
Definition: jacobian.h:213
Declarations for agendas.
The Tensor3View class.
Definition: matpackIII.h:239
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
This file contains the class declaration of bifstream.
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
bool supports_hitran_xsec(const ArrayOfRetrievalQuantity &js)
Returns if the array supports HITRAN cross-section derivatives.
Definition: jacobian.cc:1204
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
bool HasSameInternalsAs(const RetrievalQuantity &a) const
Checks that all the internal variables of *this match with those of the input.
Definition: jacobian.h:355
bool Integration() const
Do integration?
Definition: jacobian.h:326
const String & MainTag() const
Returns the main tag.
Definition: jacobian.h:170
void Analytical(const Index &m)
Sets the analytical tag.
Definition: jacobian.h:233
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Definition: jacobian.cc:1099
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
Definition: jacobian.cc:1279
Class to identify and match lines by their quantum numbers.
Definition: quantum.h:390
bool HasAffine() const
Definition: jacobian.h:343
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
Matrix transformation_matrix
Definition: jacobian.h:395
bool supports_faraday(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Faraday derivatives.
Definition: jacobian.cc:1230
void Grids(const ArrayOfVector &g)
Sets the grids of the retrieval.
Definition: jacobian.h:261
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
QuantumIdentifier mquantumidentifier
Definition: jacobian.h:388
The Matrix class.
Definition: matpackI.h:1193
RetrievalQuantity()
Default constructor.
Definition: jacobian.h:123
bool is_pressure_broadening_G(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G derivative.
jacobianVMRcheck do_vmr_jacobian(const ArrayOfRetrievalQuantity &js, const QuantumIdentifier &line_qid) noexcept
Returns the required info for VMR Jacobian.
Definition: jacobian.cc:1283
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
void PropType(const JacPropMatType t)
Sets the propagation matrix derivative type.
Definition: jacobian.h:273
Implementation of Matrix, Vector, and such stuff.
Vector & TFuncParameters()
Definition: jacobian.h:376
Propagation path structure and functions.
const String & TransformationFunc() const
Definition: jacobian.h:344
Header file for logic.cc.
JacPropMatType Proptype() const
Definition: jacobian.h:371
ArrayOfVector & Grids()
Definition: jacobian.h:369
const Vector & TFuncParameters() const
Definition: jacobian.h:345
Numeric temperature_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the temperature perturbation if it exists.
Definition: jacobian.cc:1304
void SetOffsetVector(const Vector &b)
Definition: jacobian.h:342
bool is_lineshape_parameter_X1(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X1 derivative.
Definition: jacobian.cc:1163
A constant view of a Tensor3.
Definition: matpackIII.h:132
A constant view of a Vector.
Definition: matpackI.h:476
Header file for stuff related to absorption species tags.
A constant view of a Matrix.
Definition: matpackI.h:982
void MainTag(const String &mt)
Sets the main tag.
Definition: jacobian.h:176
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
String & SubSubTag()
Definition: jacobian.h:365
bool supports_particles(const ArrayOfRetrievalQuantity &js)
Returns if the array supports particulate derivatives.
Definition: jacobian.cc:1236
ArrayOfVector mgrids
Definition: jacobian.h:387
bool supports_propmat_clearsky(const ArrayOfRetrievalQuantity &js)
Returns if the array supports propagation matrix derivatives.
Definition: jacobian.cc:1240
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
Numeric & Perturbation()
Definition: jacobian.h:368
QuantumIdentifier & QuantumIdentity()
Definition: jacobian.h:370
bool is_wind_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a wind parameter.
Definition: jacobian.cc:1115
void Mode(const String &m)
Sets the mode.
Definition: jacobian.h:219
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
Definition: jacobian.cc:897
Deals with whether or not we should do a VMR derivative.
Definition: jacobian.h:1160
bool operator==(const JacPropMatType t) const
Checks if this represents the propagation matrix derivative type.
Definition: jacobian.h:281
JacobianType
Enum for knowing what Jacobian scheme is in-play in the m_rte.cc methods.
Definition: jacobian.h:747
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
Index nelem() const
Number of elements in the grids.
Definition: jacobian.h:297
Index Proptype(JacPropMatType x)
Definition: jacobian.h:372
const String & Subtag() const
Returns the sub-tag.
Definition: jacobian.h:184
bool supports_CIA(const ArrayOfRetrievalQuantity &js)
Returns if the array supports CIA derivatives.
Definition: jacobian.cc:1200
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
bool is_pressure_broadening_G2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
const Numeric & Perturbation() const
Returns the size of perturbation.
Definition: jacobian.h:241
void SetTransformationMatrix(const Matrix &A)
Definition: jacobian.h:341
bool is_pressure_broadening_ETA(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a ETA derivative.
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
bool is_pressure_broadening_DV(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a DV derivative.
bool mintegration_flag
Definition: jacobian.h:390
JacPropMatType mproptype
Definition: jacobian.h:389
Declaration of the class MdRecord.
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
String transformation_func
Definition: jacobian.h:392
This file contains the definition of String, the ARTS string class.
bool supports_zeeman(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Zeeman derivatives.
bool do_line_center_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a line center derivative.
Definition: jacobian.cc:1292