Go to the documentation of this file.
33 return os <<
"\n Main tag = " << ot.
MainTag()
34 <<
"\n Sub tag = " << ot.
Subtag()
35 <<
"\n Mode = " << ot.
Mode()
66 for (
Index lat_it=0; lat_it<nd.
nrows(); lat_it++)
68 for (
Index lon_it=0; lon_it<nd.
ncols(); lon_it++)
70 nd(p_it,lat_it,lon_it) =
number_density( p[p_it], t(p_it,lat_it,lon_it));
112 const String& p_retr_name,
113 const String& lat_retr_name,
114 const String& lon_retr_name,
117 if ( p_retr.
nelem()==0 )
119 os <<
"The grid vector *" << p_retr_name <<
"* is empty,"
120 <<
" at least one pressure level\n"
121 <<
"should be specified.";
126 os <<
"The pressure grid vector *" << p_retr_name <<
"* is not a\n"
127 <<
"strictly decreasing vector, which is required.";
130 else if ( log(p_retr[0])> 1.5*log(p_grid[0])-0.5*log(p_grid[1]) ||
131 log(p_retr[p_retr.
nelem()-1])<1.5*log(p_grid[p_grid.
nelem()-1])-
132 0.5*log(p_grid[p_grid.
nelem()-2]))
134 os <<
"The grid vector *" << p_retr_name <<
"* is not covered by the\n"
135 <<
"corresponding atmospheric grid.";
147 if ( lat_retr.
nelem()==0 )
149 os <<
"The grid vector *" << lat_retr_name <<
"* is empty,"
150 <<
" at least one latitude\n"
151 <<
"should be specified for a 2D/3D atmosphere.";
156 os <<
"The latitude grid vector *" << lat_retr_name <<
"* is not a\n"
157 <<
"strictly increasing vector, which is required.";
160 else if ( lat_retr[0]<1.5*lat_grid[0]-0.5*lat_grid[1] ||
161 lat_retr[lat_retr.
nelem()-1]>1.5*lat_grid[lat_grid.
nelem()-1]-
162 0.5*lat_grid[lat_grid.
nelem()-2] )
164 os <<
"The grid vector *" << lat_retr_name <<
"* is not covered by the\n"
165 <<
"corresponding atmospheric grid.";
176 if ( lon_retr.
nelem()==0 )
178 os <<
"The grid vector *" << lon_retr_name <<
"* is empty,"
179 <<
" at least one longitude\n"
180 <<
"should be specified for a 3D atmosphere.";
185 os <<
"The longitude grid vector *" << lon_retr_name <<
"* is not a\n"
186 <<
"strictly increasing vector, which is required.";
189 else if ( lon_retr[0]<1.5*lon_grid[0]-0.5*lon_grid[1] ||
190 lon_retr[lon_retr.
nelem()-1]>1.5*lon_grid[lon_grid.
nelem()-1]-
191 0.5*lon_grid[lon_grid.
nelem()-2] )
193 os <<
"The grid vector *" << lon_retr_name <<
"* is not covered by the\n"
194 <<
"corresponding atmospheric grid.";
232 const bool& is_pressure)
241 pert[0] = atm_grid[0]*10.0;
242 pert[nj+1] = atm_grid[na-1]*0.1;
246 pert[0] = atm_grid[0]-1.0;
247 pert[nj+1] = atm_grid[na-1]+1.0;
249 pert[
Range(1,nj)] = jac_grid;
308 while (inc*pert_grid[limit[0]+1] < inc*atm_limit[0])
314 limit[1]=pert_grid.
nelem();
315 while (inc*pert_grid[limit[1]-1] > inc*atm_limit[na])
320 assert(limit[1]>limit[0]);
345 range =
Range(index,2);
346 else if (index==length-1)
347 range =
Range(index+1,2);
349 range =
Range(index+1,1);
372 const Index& p_pert_n,
373 const Range& p_range,
383 pert_field[p_range] += size;
384 interp( pert, itw, pert_field, p_gp);
418 const Index& p_pert_n,
419 const Index& lat_pert_n,
420 const Range& p_range,
421 const Range& lat_range,
431 pert_field(p_range,lat_range) += size;
432 interp( pert, itw, pert_field, p_gp, lat_gp);
470 const Index& p_pert_n,
471 const Index& lat_pert_n,
472 const Index& lon_pert_n,
473 const Range& p_range,
474 const Range& lat_range,
475 const Range& lon_range,
484 Tensor3 pert_field(p_pert_n,lat_pert_n,lon_pert_n,1.0-(
Numeric)method);
485 pert_field(p_range,lat_range,lon_range) += size;
486 interp( pert, itw, pert_field, p_gp, lat_gp, lon_gp);
516 const Index& poly_coeff )
520 assert( l > poly_coeff );
525 if( poly_coeff == 0 )
532 for(
Index i=0; i<l; i++ )
534 b[i] = ( x[i] - xmin ) /
dx - 1.0;
535 b[i] = pow( b[i],
int(poly_coeff) );
568 if( unit ==
"rel" || unit ==
"logrel" )
570 else if( unit ==
"vmr" )
572 else if( unit ==
"nd" )
576 throw runtime_error(
"Allowed options for gas species jacobians are "
577 "\"rel\", \"vmr\", \"nd\" and \"logrel\"." );
const Index & Analytical() const
Boolean to make analytical calculations (if possible).
void get_perturbation_range(Range &range, const Index &index, const Index &length)
Get range for perturbation.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
ostream & operator<<(ostream &os, const RetrievalQuantity &ot)
Output operator for RetrievalQuantity.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
p2gridpos
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
void perturbation_field_1d(VectorView field, const ArrayOfGridPos &p_gp, const Index &p_pert_n, const Range &p_range, const Numeric &size, const Index &method)
Calculate the 1D perturbation for a relative perturbation.
void vmrunitscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
vmrunitscf
void resize(Index n)
Resize function.
void perturbation_field_2d(MatrixView field, const ArrayOfGridPos &p_gp, const ArrayOfGridPos &lat_gp, const Index &p_pert_n, const Index &lat_pert_n, const Range &p_range, const Range &lat_range, const Numeric &size, const Index &method)
Calculate the 2D perturbation for a relative perturbation.
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
Index nrows() const
Returns the number of rows.
void calc_nd_field(Tensor3View &nd, const VectorView &p, const Tensor3View &t)
Calculate the number density field.
Index npages() const
Returns the number of pages.
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
void get_perturbation_limit(ArrayOfIndex &limit, const Vector &pert_grid, const Vector &atm_limit)
Get limits for perturbation of a box.
Index ncols() const
Returns the number of columns.
The implementation for String, the ARTS string class.
const String & MainTag() const
Main tag.
Index nelem() const
Returns the number of elements.
Numeric mean(const ConstVectorView &x)
Mean function, vector version.
const String & Mode() const
Calculation mode.
Declarations required for the calculation of jacobians.
NUMERIC Numeric
The type to use for all floating point numbers.
void get_perturbation_gridpos(ArrayOfGridPos &gp, const Vector &atm_grid, const Vector &jac_grid, const bool &is_pressure)
Calculate array of GridPos for perturbation interpolation.
Index nrows() const
Returns the number of rows.
void perturbation_field_3d(Tensor3View field, const ArrayOfGridPos &p_gp, const ArrayOfGridPos &lat_gp, const ArrayOfGridPos &lon_gp, const Index &p_pert_n, const Index &lat_pert_n, const Index &lon_pert_n, const Range &p_range, const Range &lat_range, const Range &lon_range, const Numeric &size, const Index &method)
Calculate the 3D perturbation for a relative perturbation.
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.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Index ncols() const
Returns the number of columns.
Header file for special_interp.cc.
INDEX Index
The type to use for all integer numbers and indices.
Contains the data for one retrieval quantity.
Index nelem() const
Number of elements.
const String & Subtag() const
Subtag.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
The global header file for ARTS.