jacobian.h File Reference

Declarations required for the calculation of jacobians. More...

#include <map>
#include <iostream>
#include <stdexcept>
#include "matpackI.h"
#include "array.h"
#include "mystring.h"
#include "make_array.h"
#include "bifstream.h"
#include "interpolation.h"
#include "logic.h"
#include "methods.h"
#include "ppath.h"
#include "agenda_class.h"

Include dependency graph for jacobian.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RetrievalQuantity
 Contains the data for one retrieval quantity. More...

Typedefs

typedef Array< RetrievalQuantityArrayOfRetrievalQuantity

Functions

ostream & operator<< (ostream &os, const RetrievalQuantity &ot)
 Output operator for RetrievalQuantity.
void calc_nd_field (Tensor3View &nd, const VectorView &p, const Tensor3View &t)
 Calculate the number density field.
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)
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.
void get_perturbation_limit (ArrayOfIndex &limit, const Vector &pert_grid, const Vector &atm_limit)
 Get limits for perturbation of a box.
void get_perturbation_range (Range &range, const Index &index, const Index &length)
 Get range for perturbation.
void jacobian_from_path_to_rgrids (MatrixView ib_q_jacs, const Index &nbdone, const ArrayOfTensor4 &diy_dq, const Index &iq, const Index &atmosphere_dim, const ArrayOfPpath &ppath_array, const RetrievalQuantity &jacobian_quantity)
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 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 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.
void polynomial_basis_func (Vector &b, const Vector &x, const Index &poly_coeff)
 Calculates polynomial basis functions.


Detailed Description

Declarations required for the calculation of jacobians.

Author:
Mattias Ekstrom

Definition in file jacobian.h.


Typedef Documentation

Definition at line 120 of file jacobian.h.


Function Documentation

void calc_nd_field ( Tensor3View nd,
const VectorView p,
const Tensor3View t 
)

Calculate the number density field.

This function returns the number density for each grid point in the Tensor3View.

Parameters:
nd The number density field
p The pressure grid
t The temperature field
Author:
Mattias Ekstrom
Date:
2005-06-03

Definition at line 53 of file jacobian.cc.

References ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstTensor3View::nrows(), and number_density().

Referenced by jacobianCalcAbsSpecies().

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 
)

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.

This function constructs a perturbation grid which consists of the given retrieval grid with an extra endpoint added at each end. These endpoints lies outside the atmospheric grid. This enables the interpolation of an perturbation on the perturbation grid to be interpolated to the atmospheric grid. For this reason the function returns an ArrayOfGridPos.

If the atmospheric grid is a pressure grid, interpolation is made in logarithm of the atmospheric grid.

Parameters:
gp Array of GridPos for interpolation.
atm_grid Atmospheric grid.
jac_grid Retrieval grid.
is_pressure True for pressure grid
Author:
Mattias Ekstrom
Date:
2005-05-12

Definition at line 224 of file jacobian.cc.

References gridpos(), ConstVectorView::nelem(), and p2gridpos().

Referenced by jacobianCalcAbsSpecies(), and jacobianCalcTemperature().

void get_perturbation_limit ( ArrayOfIndex limit,
const Vector pert_grid,
const Vector atm_limit 
)

Get limits for perturbation of a box.

This is a helper function that calculates the limits where the perturbation should be added to the perturbation grid. This is needed for example by the particle perturbation that only should be applied for the cloudbox. The limits are defined as the outermost points lying within or just outside the box limits.

The atmospheric limits should be given in the same unit as the perturbation grid. And only the first and last element will be considered as limits.

Assertions are used to perform checks. The input grids are checked so that the atmospheric limits are containg within the perturbation grid. The limit indices are checked so that they are ordered in increasing order before return.

Parameters:
limit The limit indices in the perturbation grid
pert_grid The perturbation grid
atm_limit The atmospheric limits of the box.
Author:
Mattias Ekstrom
Date:
2005-02-25

Definition at line 283 of file jacobian.cc.

References is_decreasing(), and ConstVectorView::nelem().

void get_perturbation_range ( Range range,
const Index index,
const Index length 
)

Get range for perturbation.

This is a helper function that calculates the range in which the perturbation should be added to the perturbation grid. This is needed to handle the edge effects. At the edges we want the perturbation to continue outwards.

Parameters:
range The range in the perturbation grid.
index The index of the perturbation in the retrieval grid.
length The length of retrieval grid
Author:
Mattias Ekstrom
Date:
2004-10-14

Definition at line 335 of file jacobian.cc.

Referenced by jacobianCalcAbsSpecies(), and jacobianCalcTemperature().

void jacobian_from_path_to_rgrids ( MatrixView  ib_q_jacs,
const Index nbdone,
const ArrayOfTensor4 diy_dq,
const Index iq,
const Index atmosphere_dim,
const ArrayOfPpath ppath_array,
const RetrievalQuantity jacobian_quantity 
)

ostream& operator<< ( ostream &  os,
const RetrievalQuantity ot 
)

Output operator for RetrievalQuantity.

Author:
Mattias Ekstrom

Definition at line 31 of file jacobian.cc.

References RetrievalQuantity::MainTag(), and RetrievalQuantity::Subtag().

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.

This is a helper function that interpolated the perturbation field for a 1D relative perturbation onto the atmospheric field.

Parameters:
field The interpolated perturbation field.
p_gp The GridPos for interpolation.
p_pert_n The number of perturbations.
p_range The perturbation range in the perturbation grid.
size The size of the perturbation.
method Relative perturbation==0, absolute==1
Author:
Mattias Ekstrom
Date:
2005-05-11

Definition at line 582 of file jacobian.cc.

References interp(), interpweights(), Array< base >::nelem(), and ConstVectorView::nelem().

Referenced by jacobianCalcAbsSpecies(), and jacobianCalcTemperature().

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.

This is a helper function that interpolated the perturbation field for a 2D relative perturbation onto the atmospheric field.

Parameters:
field The interpolated perturbation field.
p_gp The GridPos for interpolation in the 1st dim.
lat_gp The GridPos for interpolation in the 2nd dim.
p_pert_n The number of perturbations in the 1st dim.
lat_pert_n The number of perturbations in the 2nd dim.
p_range The perturbation range in the 1st dim.
lat_range The perturbation range in the 2nd dim.
size The size of the perturbation.
method Relative perturbation==0, absolute==1
Author:
Mattias Ekstrom
Date:
2005-05-11

Definition at line 627 of file jacobian.cc.

References interp(), interpweights(), ConstMatrixView::ncols(), Array< base >::nelem(), and ConstMatrixView::nrows().

Referenced by jacobianCalcAbsSpecies(), and jacobianCalcTemperature().

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.

This is a helper function that interpolated the perturbation field for a 3D relative perturbation onto the atmospheric field.

Parameters:
field The interpolated perturbation field.
p_gp The GridPos for interpolation in the 1st dim.
lat_gp The GridPos for interpolation in the 2nd dim.
lon_gp The GridPos for interpolation in the 3rd dim.
p_pert_n The number of perturbations in the 1st dim.
lat_pert_n The number of perturbations in the 2nd dim.
lon_pert_n The number of perturbations in the 3rd dim.
p_range The perturbation range in the 1st dim.
lat_range The perturbation range in the 2nd dim.
lon_range The perturbation range in the 3rd dim.
size The size of the perturbation.
method Set to 0 for relative, and 1 for absolute.
Author:
Mattias Ekstrom
Date:
2005-05-11

Definition at line 678 of file jacobian.cc.

References interp(), interpweights(), ConstTensor3View::ncols(), Array< base >::nelem(), ConstTensor3View::npages(), and ConstTensor3View::nrows().

Referenced by jacobianCalcAbsSpecies(), and jacobianCalcTemperature().

void polynomial_basis_func ( Vector b,
const Vector x,
const Index poly_coeff 
)

Calculates polynomial basis functions.

The basis function is b(x) = 1 for poly_coeff = 0. For higher coefficients, x^poly_coeff - m, where first the range covered by x* is normalised to [-1,1] and m is selected in such way that sum(b) = 0.

Parameters:
b Calculated basis function.
x The grid over which the fit shall be performed.
poly_coeff Polynomial coefficient.
Author:
Patrick Eriksson
Date:
2008-11-07

Definition at line 725 of file jacobian.cc.

References dx, max, mean(), min, ConstVectorView::nelem(), and Vector::resize().

Referenced by jacobianCalcPointing(), and jacobianCalcPolyfit().


Generated on Mon Mar 23 14:06:37 2009 for ARTS by  doxygen 1.5.6