ARTS
2.2.66
|
Workspace functions to set variables defining the atmosphere (excluding the surface). More...
#include <cmath>
#include <cfloat>
#include "agenda_class.h"
#include "arts.h"
#include "auto_md.h"
#include "absorption.h"
#include "abs_species_tags.h"
#include "check_input.h"
#include "cloudbox.h"
#include "geodetic.h"
#include "matpackIII.h"
#include "messages.h"
#include "gridded_fields.h"
#include "interpolation.h"
#include "interpolation_poly.h"
#include "rte.h"
#include "special_interp.h"
#include "xml_io.h"
#include "global_data.h"
Go to the source code of this file.
Functions | |
void | atm_fields_compactExpand (GriddedField4 &af, Index &nf, const String &name, const Verbosity &) |
atm_fields_compactExpand More... | |
void | FieldFromGriddedFieldCheckLatLonHelper (const Vector &lat_grid, const Vector &lon_grid, const Index ilat, const Index ilon, const GriddedField &gfield) |
Check for correct grid dimensions. More... | |
void | FieldFromGriddedField (Matrix &field_out, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const GriddedField2 &gfraw_in, const Verbosity &) |
WORKSPACE METHOD: FieldFromGriddedField. More... | |
void | FieldFromGriddedField (Tensor3 &field_out, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const GriddedField3 &gfraw_in, const Verbosity &) |
WORKSPACE METHOD: FieldFromGriddedField. More... | |
void | FieldFromGriddedField (Tensor4 &field_out, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const GriddedField4 &gfraw_in, const Verbosity &) |
WORKSPACE METHOD: FieldFromGriddedField. More... | |
void | FieldFromGriddedField (Tensor4 &field_out, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfGriddedField3 &gfraw_in, const Verbosity &verbosity) |
WORKSPACE METHOD: FieldFromGriddedField. More... | |
void | GriddedFieldLatLonExpand (GriddedField2 &gfraw_out, const GriddedField2 &gfraw_in_orig, const Verbosity &) |
WORKSPACE METHOD: GriddedFieldLatLonExpand. More... | |
void | GriddedFieldLatLonExpand (GriddedField3 &gfraw_out, const GriddedField3 &gfraw_in_orig, const Verbosity &) |
WORKSPACE METHOD: GriddedFieldLatLonExpand. More... | |
void | GriddedFieldLatLonExpand (GriddedField4 &gfraw_out, const GriddedField4 &gfraw_in_orig, const Verbosity &) |
WORKSPACE METHOD: GriddedFieldLatLonExpand. More... | |
void | GriddedFieldLatLonExpand (ArrayOfGriddedField3 &gfraw_out, const ArrayOfGriddedField3 &gfraw_in, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldLatLonExpand. More... | |
void | GriddedFieldPRegridHelper (Index &ing_min, Index &ing_max, ArrayOfGridPosPoly &gp_p, Matrix &itw, GriddedField &gfraw_out, const GriddedField &gfraw_in, const Index p_grid_index, ConstVectorView p_grid, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity) |
Calculate grid positions and interpolations weights for GriddedFieldPRegrid. More... | |
void | GriddedFieldPRegrid (GriddedField3 &gfraw_out, const Vector &p_grid, const GriddedField3 &gfraw_in_orig, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldPRegrid. More... | |
void | GriddedFieldPRegrid (GriddedField4 &gfraw_out, const Vector &p_grid, const GriddedField4 &gfraw_in_orig, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldPRegrid. More... | |
void | GriddedFieldPRegrid (ArrayOfGriddedField3 &agfraw_out, const Vector &p_grid, const ArrayOfGriddedField3 &agfraw_in, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldPRegrid. More... | |
void | GriddedFieldLatLonRegridHelper (ArrayOfGridPosPoly &gp_lat, ArrayOfGridPosPoly &gp_lon, Tensor3 &itw, GriddedField &gfraw_out, const GriddedField &gfraw_in, const Index lat_grid_index, const Index lon_grid_index, ConstVectorView lat_true, ConstVectorView lon_true, const Index &interp_order, const Verbosity &verbosity) |
Calculate grid positions and interpolations weights for GriddedFieldLatLonRegrid. More... | |
void | GriddedFieldLatLonRegrid (GriddedField2 &gfraw_out, const Vector &lat_true, const Vector &lon_true, const GriddedField2 &gfraw_in_orig, const Index &interp_order, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid. More... | |
void | GriddedFieldLatLonRegrid (GriddedField3 &gfraw_out, const Vector &lat_true, const Vector &lon_true, const GriddedField3 &gfraw_in_orig, const Index &interp_order, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid. More... | |
void | GriddedFieldLatLonRegrid (GriddedField4 &gfraw_out, const Vector &lat_true, const Vector &lon_true, const GriddedField4 &gfraw_in_orig, const Index &interp_order, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid. More... | |
void | GriddedFieldLatLonRegrid (ArrayOfGriddedField3 &agfraw_out, const Vector &lat_true, const Vector &lon_true, const ArrayOfGriddedField3 &agfraw_in, const Index &interp_order, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid. More... | |
void | GriddedFieldZToPRegridHelper (Index &ing_min, Index &ing_max, ArrayOfGridPosPoly &gp_p, Matrix &itw, const GriddedField &gfraw_in, const Index z_grid_index, ConstVectorView z_grid, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity) |
Calculate grid positions and interpolations weights for GriddedFieldZToPRegrid. More... | |
void | GriddedFieldZToPRegrid (GriddedField3 &gfraw_out, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const GriddedField3 &gfraw_in_orig, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity) |
WORKSPACE METHOD: GriddedFieldZToPRegrid. More... | |
void | atm_fields_compactFromMatrix (GriddedField4 &af, const Index &atmosphere_dim, const Matrix &im, const ArrayOfString &field_names, const Verbosity &) |
WORKSPACE METHOD: atm_fields_compactFromMatrix. More... | |
void | atm_fields_compactAddConstant (GriddedField4 &af, const String &name, const Numeric &value, const Verbosity &verbosity) |
WORKSPACE METHOD: atm_fields_compactAddConstant. More... | |
void | atm_fields_compactAddSpecies (GriddedField4 &atm_fields_compact, const String &name, const GriddedField3 &species, const Verbosity &verbosity) |
WORKSPACE METHOD: atm_fields_compactAddSpecies. More... | |
void | batch_atm_fields_compactAddConstant (ArrayOfGriddedField4 &batch_atm_fields_compact, const String &name, const Numeric &value, const Verbosity &verbosity) |
WORKSPACE METHOD: batch_atm_fields_compactAddConstant. More... | |
void | batch_atm_fields_compactAddSpecies (ArrayOfGriddedField4 &batch_atm_fields_compact, const String &name, const GriddedField3 &species, const Verbosity &verbosity) |
WORKSPACE METHOD: batch_atm_fields_compactAddSpecies. More... | |
void | batch_atm_fields_compactFromArrayOfMatrix (ArrayOfGriddedField4 &batch_atm_fields_compact, const Index &atmosphere_dim, const ArrayOfMatrix &am, const ArrayOfString &field_names, const ArrayOfString &extra_field_names, const Vector &extra_field_values, const Verbosity &verbosity) |
WORKSPACE METHOD: batch_atm_fields_compactFromArrayOfMatrix. More... | |
void | AtmFieldsFromCompact (Vector &p_grid, Vector &lat_grid, Vector &lon_grid, Tensor3 &t_field, Tensor3 &z_field, Tensor4 &vmr_field, Tensor4 &massdensity_field, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfString &part_species, const GriddedField4 &atm_fields_compact, const Index &atmosphere_dim, const String &delim, const Verbosity &) |
WORKSPACE METHOD: AtmFieldsFromCompact. More... | |
void | AtmosphereSet1D (Index &atmosphere_dim, Vector &lat_grid, Vector &lon_grid, const Verbosity &verbosity) |
WORKSPACE METHOD: AtmosphereSet1D. More... | |
void | AtmosphereSet2D (Index &atmosphere_dim, Vector &lon_grid, const Verbosity &verbosity) |
WORKSPACE METHOD: AtmosphereSet2D. More... | |
void | AtmosphereSet3D (Index &atmosphere_dim, const Verbosity &verbosity) |
WORKSPACE METHOD: AtmosphereSet3D. More... | |
void | AtmFieldsCalc (Tensor3 &t_field, Tensor3 &z_field, Tensor4 &vmr_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const GriddedField3 &t_field_raw, const GriddedField3 &z_field_raw, const ArrayOfGriddedField3 &vmr_field_raw, const Index &atmosphere_dim, const Index &interp_order, const Index &vmr_zeropadding, const Index &vmr_nonegative, const Verbosity &verbosity) |
WORKSPACE METHOD: AtmFieldsCalc. More... | |
void | AtmFieldsCalcExpand1D (Tensor3 &t_field, Tensor3 &z_field, Tensor4 &vmr_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const GriddedField3 &t_field_raw, const GriddedField3 &z_field_raw, const ArrayOfGriddedField3 &vmr_field_raw, const Index &atmosphere_dim, const Index &interp_order, const Index &vmr_zeropadding, const Index &vmr_nonegative, const Verbosity &verbosity) |
WORKSPACE METHOD: AtmFieldsCalcExpand1D. More... | |
void | AtmFieldsExpand1D (Tensor3 &t_field, Tensor3 &z_field, Tensor4 &vmr_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Index &atmosphere_dim, const Verbosity &) |
WORKSPACE METHOD: AtmFieldsExpand1D. More... | |
void | AtmFieldsRefinePgrid (Vector &p_grid, Tensor3 &t_field, Tensor3 &z_field, Tensor4 &vmr_field, const Vector &lat_grid, const Vector &lon_grid, const Index &atmosphere_dim, const Numeric &p_step, const Verbosity &) |
WORKSPACE METHOD: AtmFieldsRefinePgrid. More... | |
void | AtmRawRead (GriddedField3 &t_field_raw, GriddedField3 &z_field_raw, ArrayOfGriddedField3 &vmr_field_raw, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Verbosity &verbosity) |
WORKSPACE METHOD: AtmRawRead. More... | |
void | InterpAtmFieldToPosition (Numeric &outvalue, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &rtp_pos, const Tensor3 &field, const Verbosity &verbosity) |
WORKSPACE METHOD: InterpAtmFieldToPosition. More... | |
void | p_gridDensify (Vector &p_grid, const Index &nfill, const Verbosity &verbosity) |
WORKSPACE METHOD: p_gridDensify. More... | |
void | p_gridFromZRaw (Vector &p_grid, const GriddedField3 &z_field_raw, const Index &no_negZ, const Verbosity &) |
WORKSPACE METHOD: p_gridFromZRaw. More... | |
void | lat_gridFromRawField (Vector &lat_grid, const GriddedField3 &field_raw, const Verbosity &) |
WORKSPACE METHOD: lat_gridFromRawField. More... | |
void | lon_gridFromRawField (Vector &lon_grid, const GriddedField3 &field_raw, const Verbosity &) |
WORKSPACE METHOD: lon_gridFromRawField. More... | |
void | wind_u_fieldIncludePlanetRotation (Tensor3 &wind_u_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Tensor3 &z_field, const Numeric &planet_rotation_period, const Verbosity &) |
WORKSPACE METHOD: wind_u_fieldIncludePlanetRotation. More... | |
void | z2g (Numeric &g, const Numeric &r, const Numeric &g0, const Numeric &z) |
void | z_fieldFromHSE (Workspace &ws, Tensor3 &z_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &lat_true, const Vector &lon_true, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &t_field, const Tensor4 &vmr_field, const Vector &refellipsoid, const Matrix &z_surface, const Index &atmfields_checked, const Agenda &g0_agenda, const Numeric &molarmass_dry_air, const Numeric &p_hse, const Numeric &z_hse_accuracy, const Verbosity &verbosity) |
WORKSPACE METHOD: z_fieldFromHSE. More... | |
Variables | |
const Index | GFIELD3_P_GRID |
const Index | GFIELD3_LAT_GRID |
const Index | GFIELD3_LON_GRID |
const Index | GFIELD4_FIELD_NAMES |
const Index | GFIELD4_P_GRID |
const Index | GFIELD4_LAT_GRID |
const Index | GFIELD4_LON_GRID |
const Numeric | DEG2RAD |
const Numeric | PI |
const Numeric | GAS_CONSTANT |
const Numeric | EPSILON_LON_CYCLIC = 2*DBL_EPSILON |
Data value accuracy requirement for values at 0 and 360 deg if longitudes are cyclic. More... | |
Workspace functions to set variables defining the atmosphere (excluding the surface).
These functions are listed in the doxygen documentation as entries of the file auto_md.h.
Definition in file m_atmosphere.cc.
void atm_fields_compactAddConstant | ( | GriddedField4 & | atm_fields_compact, |
const String & | name, | ||
const Numeric & | value, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: atm_fields_compactAddConstant.
Adds a constant field to atm_fields_compact.
This is handy for nitrogen or oxygen. The constant value is appended at the end of the fields that are already there. All dimensions (pressure, latitude, longitude) are filled up, so this works for 1D, 2D, or 3D atmospheres.
[out] | atm_fields_compact | WS Output |
[in] | name | Generic Input |
[in] | value | Generic Input |
Definition at line 1362 of file m_atmosphere.cc.
References atm_fields_compactExpand(), GriddedField4::data, and joker.
Referenced by atm_fields_compactAddConstant_g(), batch_atm_fields_compactAddConstant(), and batch_atm_fields_compactFromArrayOfMatrix().
void atm_fields_compactAddSpecies | ( | GriddedField4 & | atm_fields_compact, |
const String & | name, | ||
const GriddedField3 & | value, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: atm_fields_compactAddSpecies.
Adds a field to atm_fields_compact, with interpolation.
This method appends a GriddedField3 to atm_fields_compact. The GriddedField3 is interpolated upon the grid of atm_fields_compact. A typical use case for this method may be to add a climatology of some gas when this gas is needed for radiative transfer calculations, but not yet present in atm_fields_compact. One case where this happens is when using the Chevalier dataset for infrared simulations.
The grids in atm_fields_compact must fully encompass the grids in the GriddedField3 to be added, for interpolation to succeed. If this is not the case, a RuntimeError is thrown.
[out] | atm_fields_compact | WS Output |
[in] | name | Generic Input |
[in] | value | Generic Input |
Definition at line 1380 of file m_atmosphere.cc.
References atm_fields_compactExpand(), GriddedField3::checksize(), GriddedField4::checksize(), chk_interpolation_grids(), GriddedField3::data, GriddedField4::data, GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, GFIELD4_LAT_GRID, GFIELD4_LON_GRID, GFIELD4_P_GRID, gridpos(), interp(), interpweights(), joker, ConstVectorView::nelem(), and p2gridpos().
Referenced by atm_fields_compactAddSpecies_g(), and batch_atm_fields_compactAddSpecies().
void atm_fields_compactExpand | ( | GriddedField4 & | af, |
Index & | nf, | ||
const String & | name, | ||
const Verbosity & | |||
) |
atm_fields_compactExpand
Add a species to an atm_fields_compact. Does not add any content, but only resizes the data and adds a field to the ArrayOfString respresenting the species for this GriddedField4. This helper function is used by e.g. atm_fields_compactAddSpecies* and atm_fields_compactAddConstant.
af | The new atm_fields_compact |
nf | The new number of fields |
name | Name of new field |
Definition at line 102 of file m_atmosphere.cc.
References GriddedField4::data, GriddedField::get_string_grid(), GFIELD4_FIELD_NAMES, joker, ConstTensor4View::ncols(), Array< base >::nelem(), ConstTensor4View::npages(), ConstTensor4View::nrows(), and GriddedField4::resize().
Referenced by atm_fields_compactAddConstant(), and atm_fields_compactAddSpecies().
void atm_fields_compactFromMatrix | ( | GriddedField4 & | atm_fields_compact, |
const Index & | atmosphere_dim, | ||
const Matrix & | gin1, | ||
const ArrayOfString & | field_names, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: atm_fields_compactFromMatrix.
Set atm_fields_compact from 1D profiles in a matrix.
For clear-sky batch calculations it is handy to store atmospheric profiles in an array of matrix. We take such a matrix, and create atm_fields_compact* from it.
The matrix must contain one row for each pressure level. The matrix can contain some additional fields which are not directly used by ARTS for calculations but can be required for further processing, for e.g. wind speed and direction. In this case, additional fields must be put at the end of the matrix and they must be flagged by 'ignore', large or small letters, in the field names. Recommended row format:
p[Pa] T[K] z[m] VMR_1[fractional] ... VMR[fractional] IGNORE ... IGNORE
Works only for atmosphere_dim==1.
Keywords: <br> field_names : Field names to store in atm_fields_compact. <br> This should be, e.g.: <br> ["T[K]", "z[m]", "vmr_h2o[fractional]", "ignore"] <br> There must be one name less than matrix columns, <br> because the first column must contain pressure.
[out] | atm_fields_compact | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | gin1 | Generic Input |
[in] | field_names | Generic Input |
Definition at line 1281 of file m_atmosphere.cc.
References GriddedField4::data, GFIELD4_FIELD_NAMES, GFIELD4_LAT_GRID, GFIELD4_LON_GRID, GFIELD4_P_GRID, joker, ConstMatrixView::ncols(), Array< base >::nelem(), ConstMatrixView::nrows(), GriddedField4::resize(), GriddedField::set_grid(), and my_basic_string< charT >::toupper().
Referenced by atm_fields_compactFromMatrix_g(), and batch_atm_fields_compactFromArrayOfMatrix().
void AtmFieldsCalc | ( | Tensor3 & | t_field, |
Tensor3 & | z_field, | ||
Tensor4 & | vmr_field, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const GriddedField3 & | t_field_raw, | ||
const GriddedField3 & | z_field_raw, | ||
const ArrayOfGriddedField3 & | vmr_field_raw, | ||
const Index & | atmosphere_dim, | ||
const Index & | interp_order, | ||
const Index & | vmr_zeropadding, | ||
const Index & | vmr_nonegative, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmFieldsCalc.
Interpolation of raw atmospheric T, z, and VMR fields to calculation grids.
An atmospheric scenario includes the following data for each position (pressure, latitude, longitude) in the atmosphere: <br> 1. temperature field <br> 2. the corresponding altitude field <br> 3. vmr fields for the gaseous species This method interpolates the fields of raw data (t_field_raw, z_field_raw*, vmr_field_raw) which can be stored on arbitrary grids to the calculation grids (p_grid, lat_grid, lon_grid).
Internally, AtmFieldsCalc applies GriddedFieldPRegrid and GriddedFieldLatLonRegrid*. Generally, 'half-grid-step' extrapolation is allowed and applied. However, if vmr_zeropadding=1 then VMRs at p_grid* levels exceeding the raw VMRs' pressure grid are set to 0 (applying the zeropadding option of GriddedFieldPRegrid).
Default is to just accept obtained VMRs. If you want to enforce that all VMR created are >= 0, set vmr_nonegative to 1. Negative values are then set 0. Beside being present in input data, negative VMR can be generated from the interpolation if interp_order is above 1.
[out] | t_field | WS Output |
[out] | z_field | WS Output |
[out] | vmr_field | WS Output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | t_field_raw | WS Input |
[in] | z_field_raw | WS Input |
[in] | vmr_field_raw | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | interp_order | Generic Input (Default: "1") |
[in] | vmr_zeropadding | Generic Input (Default: "0") |
[in] | vmr_nonegative | Generic Input (Default: "0") |
Definition at line 1786 of file m_atmosphere.cc.
References chk_atm_grids(), chk_if_in_range(), chk_interpolation_grids(), chk_interpolation_pgrids(), CREATE_OUT2, GriddedField3::data, FieldFromGriddedField(), GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, GriddedFieldLatLonRegrid(), GriddedFieldPRegrid(), gridpos_poly(), interp(), interpweights(), joker, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor4View::npages(), ConstTensor4View::nrows(), p2gridpos_poly(), Tensor3::resize(), and Tensor4::resize().
Referenced by AtmFieldsCalc_g(), and AtmFieldsCalcExpand1D().
void AtmFieldsCalcExpand1D | ( | Tensor3 & | t_field, |
Tensor3 & | z_field, | ||
Tensor4 & | vmr_field, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const GriddedField3 & | t_field_raw, | ||
const GriddedField3 & | z_field_raw, | ||
const ArrayOfGriddedField3 & | vmr_field_raw, | ||
const Index & | atmosphere_dim, | ||
const Index & | interp_order, | ||
const Index & | vmr_zeropadding, | ||
const Index & | vmr_nonegative, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmFieldsCalcExpand1D.
Interpolation of 1D raw atmospheric fields to create 2D or 3D homogeneous atmospheric fields.
The method works as AtmFieldsCalc, but accepts only raw 1D atmospheres. The raw atmosphere is interpolated to p_grid and the obtained values are applied for all latitudes, and also longitudes for 3D, to create a homogeneous atmosphere.
The method deals only with the atmospheric fields, and to create a true 2D or 3D version of a 1D case, a demand is also that the ellipsoid is set to be a sphere.
[out] | t_field | WS Output |
[out] | z_field | WS Output |
[out] | vmr_field | WS Output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | t_field_raw | WS Input |
[in] | z_field_raw | WS Input |
[in] | vmr_field_raw | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | interp_order | Generic Input (Default: "1") |
[in] | vmr_zeropadding | Generic Input (Default: "0") |
[in] | vmr_nonegative | Generic Input (Default: "0") |
Definition at line 2040 of file m_atmosphere.cc.
References AtmFieldsCalc(), chk_atm_grids(), chk_if_in_range(), ConstTensor4View::nbooks(), ConstVectorView::nelem(), ConstTensor3View::npages(), Tensor3::resize(), and Tensor4::resize().
Referenced by AtmFieldsCalcExpand1D_g().
void AtmFieldsExpand1D | ( | Tensor3 & | t_field, |
Tensor3 & | z_field, | ||
Tensor4 & | vmr_field, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Index & | atmosphere_dim, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmFieldsExpand1D.
Maps a 1D case to 2D or 3D homogeneous atmospheric fields.
This method takes a 1D atmospheric case and converts it to the corresponding case for 2D or 3D. The atmospheric fields (t_field, z_field and vmr_field) must be 1D and match p_grid. The size of the new data is determined by atmosphere_dim, lat_grid and lon_grid*. That is, these later variables have been changed since the original fields were created.
The method deals only with the atmospheric fields, and to create a true 2D or 3D version of a 1D case, a demand is also that the ellipsoid is set to be a sphere.
[out] | t_field | WS Output |
[out] | z_field | WS Output |
[out] | vmr_field | WS Output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | atmosphere_dim | WS Input |
Definition at line 2101 of file m_atmosphere.cc.
References chk_atm_field(), chk_atm_grids(), chk_if_in_range(), max, ConstTensor4View::nbooks(), ConstVectorView::nelem(), Tensor3::resize(), and Tensor4::resize().
Referenced by AtmFieldsExpand1D_g().
void AtmFieldsFromCompact | ( | Vector & | p_grid, |
Vector & | lat_grid, | ||
Vector & | lon_grid, | ||
Tensor3 & | t_field, | ||
Tensor3 & | z_field, | ||
Tensor4 & | vmr_field, | ||
Tensor4 & | massdensity_field, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const ArrayOfString & | part_species, | ||
const GriddedField4 & | atm_fields_compact, | ||
const Index & | atmosphere_dim, | ||
const String & | delim, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmFieldsFromCompact.
Extract pressure grid and atmospheric fields from atm_fields_compact*.
An atmospheric scenario includes the following data for each position (pressure, latitude, longitude) in the atmosphere: <br> 1. temperature field <br> 2. the corresponding altitude field <br> 3. vmr fields for the gaseous species
This method just splits up the data found in atm_fields_compact to p_grid, lat_grid, lon_grid, and the various fields. No interpolation. See documentation of atm_fields_compact for a definition of the data.
There are some safety checks on the names of the fields: The first field must be called "T", the second "z"*. Remaining fields must be trace gas species volume mixing ratios, named for example "H2O", "O3", and so on. The species names must fit the species in abs_species. (Same species in same order.) Only the species name must fit, not the full tag.
Possible future extensions: Add a keyword parameter to refine the pressure grid if it is too coarse. Or a version that interpolates onto given grids, instead of using and returning the original grids.
[out] | p_grid | WS Output |
[out] | lat_grid | WS Output |
[out] | lon_grid | WS Output |
[out] | t_field | WS Output |
[out] | z_field | WS Output |
[out] | vmr_field | WS Output |
[out] | massdensity_field | WS Output |
[in] | abs_species | WS Input |
[in] | part_species | WS Input |
[in] | atm_fields_compact | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | delim | Generic Input (Default: "-") |
Definition at line 1593 of file m_atmosphere.cc.
References chk_atm_grids(), GriddedField4::data, GriddedField::get_grid_size(), GriddedField::get_numeric_grid(), GriddedField::get_string_grid(), GFIELD4_FIELD_NAMES, GFIELD4_LAT_GRID, GFIELD4_LON_GRID, GFIELD4_P_GRID, joker, Array< base >::nelem(), parse_partfield_name(), Tensor3::resize(), Tensor4::resize(), and global_data::species_data.
Referenced by AtmFieldsFromCompact_g().
void AtmFieldsRefinePgrid | ( | Vector & | p_grid, |
Tensor3 & | t_field, | ||
Tensor3 & | z_field, | ||
Tensor4 & | vmr_field, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Index & | atmosphere_dim, | ||
const Numeric & | p_step, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmFieldsRefinePgrid.
Refine the pressure grid in the atmospheric fields.
This method is used for absorption lookup table testing. It probably has no other application.
It adds additional vertical grid points to the atmospheric fields, by interpolating them in the usual ARTS way (linear in log pressure).
How fine the new grid will be is determined by the keyword parameter p_step. The definition of p_step, and the interpolation behavior, is consistent with abs_lookupSetup and abs_lookupSetupBatch. (New points are added between the original ones, so that the spacing is always below p_step.)
[out] | p_grid | WS Output |
[out] | t_field | WS Output |
[out] | z_field | WS Output |
[out] | vmr_field | WS Output |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_step | Generic Input |
Definition at line 2154 of file m_atmosphere.cc.
References chk_atm_field(), chk_atm_grids(), gridpos(), interp(), interpweights(), joker, ConstTensor4View::nbooks(), Array< base >::nelem(), ConstVectorView::nelem(), and transform().
Referenced by AtmFieldsRefinePgrid_g().
void AtmosphereSet1D | ( | Index & | atmosphere_dim, |
Vector & | lat_grid, | ||
Vector & | lon_grid, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmosphereSet1D.
Sets the atmospheric dimension to 1D.
Sets atmosphere_dim to 1 and gives some variables dummy values.
The latitude and longitude grids are set to be empty.
[out] | atmosphere_dim | WS Output |
[out] | lat_grid | WS Output |
[out] | lon_grid | WS Output |
Definition at line 1730 of file m_atmosphere.cc.
References CREATE_OUT2, CREATE_OUT3, and Vector::resize().
Referenced by AtmosphereSet1D_g().
WORKSPACE METHOD: AtmosphereSet2D.
Sets the atmospheric dimension to be 2D.
Sets atmosphere_dim to 2 and the longitude grid to be empty.
[out] | atmosphere_dim | WS Output |
[out] | lon_grid | WS Output |
Definition at line 1752 of file m_atmosphere.cc.
References CREATE_OUT2, CREATE_OUT3, and Vector::resize().
Referenced by AtmosphereSet2D_g().
WORKSPACE METHOD: AtmosphereSet3D.
Sets the atmospheric dimension to 3D.
[out] | atmosphere_dim | WS Output |
Definition at line 1770 of file m_atmosphere.cc.
References CREATE_OUT2, and CREATE_OUT3.
Referenced by AtmosphereSet3D_g().
void AtmRawRead | ( | GriddedField3 & | t_field_raw, |
GriddedField3 & | z_field_raw, | ||
ArrayOfGriddedField3 & | vmr_field_raw, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const String & | basename, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: AtmRawRead.
Reads atmospheric data from a scenario.
An atmospheric scenario includes the following data for each position (pressure, latitude, longitude) in the atmosphere: <br> 1. temperature field <br> 2. the corresponding altitude field <br> 3. vmr fields for the gaseous species The data is stored in different files. This methods reads all files and creates the variables t_field_raw, z_field_raw and vmr_field_raw*.
Files in a scenarios should be named matching the pattern of: tropical.H2O.xml
The files can be anywhere, but they must be all in the same directory, selected by 'basename'. The files are chosen by the species name. If you have more than one tag group for the same species, the same profile will be used.
[out] | t_field_raw | WS Output |
[out] | z_field_raw | WS Output |
[out] | vmr_field_raw | WS Output |
[in] | abs_species | WS Input |
[in] | basename | Generic Input |
Definition at line 2308 of file m_atmosphere.cc.
References CREATE_OUT3, Array< base >::nelem(), global_data::species_data, and xml_read_from_file().
Referenced by AtmRawRead_g().
void batch_atm_fields_compactAddConstant | ( | ArrayOfGriddedField4 & | batch_atm_fields_compact, |
const String & | name, | ||
const Numeric & | value, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: batch_atm_fields_compactAddConstant.
Adds a constant field to batch_atm_fields_compact.
Applies atm_fields_compactAddConstant to each batch. The format is equal to that WSM.
[out] | batch_atm_fields_compact | WS Output |
[in] | name | Generic Input |
[in] | value | Generic Input |
Definition at line 1462 of file m_atmosphere.cc.
References atm_fields_compactAddConstant(), and Array< base >::nelem().
Referenced by batch_atm_fields_compactAddConstant_g().
void batch_atm_fields_compactAddSpecies | ( | ArrayOfGriddedField4 & | batch_atm_fields_compact, |
const String & | name, | ||
const GriddedField3 & | value, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: batch_atm_fields_compactAddSpecies.
Adds a field to batch_atm_fields_compact, with interpolation.
This method appends a GriddedField3 to each atm_fields_compact. in batch_atm_fields_compact. For details, see atm_fields_compactAddSpecies.
[out] | batch_atm_fields_compact | WS Output |
[in] | name | Generic Input |
[in] | value | Generic Input |
Definition at line 1478 of file m_atmosphere.cc.
References atm_fields_compactAddSpecies(), and Array< base >::nelem().
Referenced by batch_atm_fields_compactAddSpecies_g().
void batch_atm_fields_compactFromArrayOfMatrix | ( | ArrayOfGriddedField4 & | batch_atm_fields_compact, |
const Index & | atmosphere_dim, | ||
const ArrayOfMatrix & | gin1, | ||
const ArrayOfString & | field_names, | ||
const ArrayOfString & | extra_field_names, | ||
const Vector & | extra_field_values, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: batch_atm_fields_compactFromArrayOfMatrix.
Expand batch of 1D atmospheric states to a batch_atm_fields_compact.
This is used to handle 1D batch cases, for example from the Chevallier data set, stored in a matrix.
The matrix must contain one row for each pressure level. The matrix can contain some additional fiels which are not directly used by ARTS for calculations but can be required for further processing, for e.g. wind speed and direction. In this case, additional fields must be put at the end of the matrix and they must be flagged by 'ignore', large or small letters, in the field names. Row format:
p[Pa] T[K] z[m] VMR_1[fractional] ... VMR[fractional] IGNORE ... IGNORE
Keywords: <br> field_names : Field names to store in atm_fields_compact. <br> This should be, e.g.: <br> ["T", "z", "H2O", "O3", "ignore"] <br> There must be one name less than matrix columns, <br> because the first column must contain pressure.
<br> extra_field_names : You can add additional constant VMR fields, <br> which is handy for O2 and N2. Give here the <br> field name, e.g., "O2". Default: Empty.
<br> extra_field_values : Give here the constant field value. Default: <br> Empty. Dimension must match extra_field_names.
[out] | batch_atm_fields_compact | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | gin1 | Generic Input |
[in] | field_names | Generic Input |
[in] | extra_field_names | Generic Input (Default: "[]") |
[in] | extra_field_values | Generic Input (Default: "[]") |
Definition at line 1511 of file m_atmosphere.cc.
References atm_fields_compactAddConstant(), atm_fields_compactFromMatrix(), Array< base >::nelem(), and ConstVectorView::nelem().
Referenced by batch_atm_fields_compactFromArrayOfMatrix_g().
void FieldFromGriddedField | ( | Matrix & | out, |
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const GriddedField2 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: FieldFromGriddedField.
Extract the data from a GriddedField.
A check is performed that the grids from the GriddedField match p_grid, lat_grid and lon_grid.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | in | Generic Input |
Definition at line 184 of file m_atmosphere.cc.
References GriddedField2::data, and FieldFromGriddedFieldCheckLatLonHelper().
Referenced by AtmFieldsCalc(), FieldFromGriddedField_sg_MatrixGriddedField2_g(), FieldFromGriddedField_sg_Tensor3GriddedField3_g(), FieldFromGriddedField_sg_Tensor4ArrayOfGriddedField3_g(), FieldFromGriddedField_sg_Tensor4GriddedField4_g(), and pnd_fieldCalc().
void FieldFromGriddedField | ( | Tensor3 & | out, |
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const GriddedField3 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: FieldFromGriddedField.
Extract the data from a GriddedField.
A check is performed that the grids from the GriddedField match p_grid, lat_grid and lon_grid.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | in | Generic Input |
Definition at line 201 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_if_equal(), GriddedField3::data, FieldFromGriddedFieldCheckLatLonHelper(), and GriddedField::get_numeric_grid().
void FieldFromGriddedField | ( | Tensor4 & | out, |
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const GriddedField4 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: FieldFromGriddedField.
Extract the data from a GriddedField.
A check is performed that the grids from the GriddedField match p_grid, lat_grid and lon_grid.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | in | Generic Input |
Definition at line 221 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_if_equal(), GriddedField4::data, FieldFromGriddedFieldCheckLatLonHelper(), and GriddedField::get_numeric_grid().
void FieldFromGriddedField | ( | Tensor4 & | out, |
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const ArrayOfGriddedField3 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: FieldFromGriddedField.
Extract the data from a GriddedField.
A check is performed that the grids from the GriddedField match p_grid, lat_grid and lon_grid.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | in | Generic Input |
Definition at line 241 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_if_equal(), CREATE_OUT1, FieldFromGriddedFieldCheckLatLonHelper(), joker, Array< base >::nelem(), ConstVectorView::nelem(), and Tensor4::resize().
void FieldFromGriddedFieldCheckLatLonHelper | ( | const Vector & | lat_grid, |
const Vector & | lon_grid, | ||
const Index | ilat, | ||
const Index | ilon, | ||
const GriddedField & | gfield | ||
) |
Check for correct grid dimensions.
Definition at line 156 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_if_equal(), chk_size(), GriddedField::get_numeric_grid(), and ConstVectorView::nelem().
Referenced by FieldFromGriddedField().
void GriddedFieldLatLonExpand | ( | GriddedField2 & | out, |
const GriddedField2 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonExpand.
Expands the latitude and longitude grid of the GriddedField to [-90, 90] and [0,360], respectively. Expansion is only done in the dimension(s), where the grid size is 1. The values from the input data will be duplicated to accomodate for the larger size of the output field. gfield_raw_out and gfield_raw_in can be the same variable.
[out] | out | Supergeneric output |
[in] | in | Generic Input |
Definition at line 276 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), GriddedField2::data, joker, ConstMatrixView::ncols(), ConstMatrixView::nrows(), GriddedField2::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
Referenced by GriddedFieldLatLonExpand(), GriddedFieldLatLonExpand_sg_ArrayOfGriddedField3ArrayOfGriddedField3_g(), GriddedFieldLatLonExpand_sg_GriddedField2GriddedField2_g(), GriddedFieldLatLonExpand_sg_GriddedField3GriddedField3_g(), and GriddedFieldLatLonExpand_sg_GriddedField4GriddedField4_g().
void GriddedFieldLatLonExpand | ( | GriddedField3 & | out, |
const GriddedField3 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonExpand.
Expands the latitude and longitude grid of the GriddedField to [-90, 90] and [0,360], respectively. Expansion is only done in the dimension(s), where the grid size is 1. The values from the input data will be duplicated to accomodate for the larger size of the output field. gfield_raw_out and gfield_raw_in can be the same variable.
[out] | out | Supergeneric output |
[in] | in | Generic Input |
Definition at line 337 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), GriddedField3::data, GriddedField::get_grid_name(), GriddedField::get_numeric_grid(), joker, ConstTensor3View::ncols(), ConstTensor3View::npages(), ConstTensor3View::nrows(), GriddedField3::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
void GriddedFieldLatLonExpand | ( | GriddedField4 & | out, |
const GriddedField4 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonExpand.
Expands the latitude and longitude grid of the GriddedField to [-90, 90] and [0,360], respectively. Expansion is only done in the dimension(s), where the grid size is 1. The values from the input data will be duplicated to accomodate for the larger size of the output field. gfield_raw_out and gfield_raw_in can be the same variable.
[out] | out | Supergeneric output |
[in] | in | Generic Input |
Definition at line 402 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), GriddedField4::data, GriddedField::get_grid_name(), GriddedField::get_numeric_grid(), joker, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstTensor4View::npages(), ConstTensor4View::nrows(), GriddedField4::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
void GriddedFieldLatLonExpand | ( | ArrayOfGriddedField3 & | out, |
const ArrayOfGriddedField3 & | in, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonExpand.
Expands the latitude and longitude grid of the GriddedField to [-90, 90] and [0,360], respectively. Expansion is only done in the dimension(s), where the grid size is 1. The values from the input data will be duplicated to accomodate for the larger size of the output field. gfield_raw_out and gfield_raw_in can be the same variable.
[out] | out | Supergeneric output |
[in] | in | Generic Input |
Definition at line 475 of file m_atmosphere.cc.
References GriddedFieldLatLonExpand(), and Array< base >::nelem().
void GriddedFieldLatLonRegrid | ( | GriddedField2 & | out, |
const Vector & | lat_true, | ||
const Vector & | lon_true, | ||
const GriddedField2 & | in, | ||
const Index & | interp_order, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid.
Interpolates the input field along the latitude and longitude dimensions to lat_true and lon_true.
If the input longitude grid is outside of lon_true it will be shifted left or right by 360. If it covers 360 degrees, a cyclic interpolation will be performed. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | lat_true | WS Input |
[in] | lon_true | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
Definition at line 808 of file m_atmosphere.cc.
References GriddedField2::data, EPSILON_LON_CYCLIC, GriddedField::get_grid_size(), GriddedField::get_numeric_grid(), GriddedFieldLatLonRegridHelper(), interp(), is_lon_cyclic(), is_same_within_epsilon(), ConstVectorView::nelem(), and GriddedField2::resize().
Referenced by AtmFieldsCalc(), GriddedFieldLatLonRegrid(), GriddedFieldLatLonRegrid_sg_ArrayOfGriddedField3ArrayOfGriddedField3_g(), GriddedFieldLatLonRegrid_sg_GriddedField2GriddedField2_g(), GriddedFieldLatLonRegrid_sg_GriddedField3GriddedField3_g(), and GriddedFieldLatLonRegrid_sg_GriddedField4GriddedField4_g().
void GriddedFieldLatLonRegrid | ( | GriddedField3 & | out, |
const Vector & | lat_true, | ||
const Vector & | lon_true, | ||
const GriddedField3 & | in, | ||
const Index & | interp_order, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid.
Interpolates the input field along the latitude and longitude dimensions to lat_true and lon_true.
If the input longitude grid is outside of lon_true it will be shifted left or right by 360. If it covers 360 degrees, a cyclic interpolation will be performed. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | lat_true | WS Input |
[in] | lon_true | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
Definition at line 892 of file m_atmosphere.cc.
References GriddedField3::data, EPSILON_LON_CYCLIC, GriddedField::get_grid_name(), GriddedField::get_grid_size(), GriddedField::get_numeric_grid(), GriddedFieldLatLonRegridHelper(), interp(), is_lon_cyclic(), is_same_within_epsilon(), joker, ConstVectorView::nelem(), ConstTensor3View::npages(), GriddedField3::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
void GriddedFieldLatLonRegrid | ( | GriddedField4 & | out, |
const Vector & | lat_true, | ||
const Vector & | lon_true, | ||
const GriddedField4 & | in, | ||
const Index & | interp_order, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid.
Interpolates the input field along the latitude and longitude dimensions to lat_true and lon_true.
If the input longitude grid is outside of lon_true it will be shifted left or right by 360. If it covers 360 degrees, a cyclic interpolation will be performed. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | lat_true | WS Input |
[in] | lon_true | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
Definition at line 984 of file m_atmosphere.cc.
References GriddedField4::data, EPSILON_LON_CYCLIC, GriddedField::get_grid_name(), GriddedField::get_grid_size(), GriddedField::get_numeric_grid(), GriddedFieldLatLonRegridHelper(), interp(), is_lon_cyclic(), is_same_within_epsilon(), joker, ConstTensor4View::nbooks(), ConstVectorView::nelem(), ConstTensor4View::npages(), GriddedField4::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
void GriddedFieldLatLonRegrid | ( | ArrayOfGriddedField3 & | out, |
const Vector & | lat_true, | ||
const Vector & | lon_true, | ||
const ArrayOfGriddedField3 & | in, | ||
const Index & | interp_order, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldLatLonRegrid.
Interpolates the input field along the latitude and longitude dimensions to lat_true and lon_true.
If the input longitude grid is outside of lon_true it will be shifted left or right by 360. If it covers 360 degrees, a cyclic interpolation will be performed. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | lat_true | WS Input |
[in] | lon_true | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
Definition at line 1084 of file m_atmosphere.cc.
References GriddedFieldLatLonRegrid(), and Array< base >::nelem().
void GriddedFieldLatLonRegridHelper | ( | ArrayOfGridPosPoly & | gp_lat, |
ArrayOfGridPosPoly & | gp_lon, | ||
Tensor3 & | itw, | ||
GriddedField & | gfraw_out, | ||
const GriddedField & | gfraw_in, | ||
const Index | lat_grid_index, | ||
const Index | lon_grid_index, | ||
ConstVectorView | lat_true, | ||
ConstVectorView | lon_true, | ||
const Index & | interp_order, | ||
const Verbosity & | verbosity | ||
) |
Calculate grid positions and interpolations weights for GriddedFieldLatLonRegrid.
Definition at line 755 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_interpolation_grids(), CREATE_OUT2, GriddedField::get_grid_name(), GriddedField::get_grid_size(), GriddedField::get_numeric_grid(), gridpos_poly(), gridpos_poly_longitudinal(), interpweights(), ConstVectorView::nelem(), Tensor3::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
Referenced by GriddedFieldLatLonRegrid().
void GriddedFieldPRegrid | ( | GriddedField3 & | out, |
const Vector & | p_grid, | ||
const GriddedField3 & | in, | ||
const Index & | interp_order, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldPRegrid.
Interpolates the input field along the pressure dimension to p_grid.
If zero-padding is applied (zeropadding=1), pressures that are outside the p_grid are set to 0. This is thought, e.g., for VMR fields that outside the given pressure can safely be assumed to be zero. Note: Using zeropadding for altitude and temperature fields is strongly discouraged (it will work here, though, but likely trigger errors later on). Extrapolation is allowed within the common 0.5grid-step margin, but is overruled by zeropadding. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
[in] | zeropadding | Generic Input (Default: "0") |
Definition at line 572 of file m_atmosphere.cc.
References GriddedField3::data, GriddedField::get_grid_name(), GriddedField::get_numeric_grid(), GriddedFieldPRegridHelper(), interp(), joker, ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::nrows(), GriddedField3::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
Referenced by AtmFieldsCalc(), GriddedFieldPRegrid(), GriddedFieldPRegrid_sg_ArrayOfGriddedField3ArrayOfGriddedField3_g(), GriddedFieldPRegrid_sg_GriddedField3GriddedField3_g(), GriddedFieldPRegrid_sg_GriddedField4GriddedField4_g(), and pnd_fieldCalc().
void GriddedFieldPRegrid | ( | GriddedField4 & | out, |
const Vector & | p_grid, | ||
const GriddedField4 & | in, | ||
const Index & | interp_order, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldPRegrid.
Interpolates the input field along the pressure dimension to p_grid.
If zero-padding is applied (zeropadding=1), pressures that are outside the p_grid are set to 0. This is thought, e.g., for VMR fields that outside the given pressure can safely be assumed to be zero. Note: Using zeropadding for altitude and temperature fields is strongly discouraged (it will work here, though, but likely trigger errors later on). Extrapolation is allowed within the common 0.5grid-step margin, but is overruled by zeropadding. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
[in] | zeropadding | Generic Input (Default: "0") |
Definition at line 642 of file m_atmosphere.cc.
References GriddedField4::data, GriddedField::get_grid_name(), GriddedField::get_numeric_grid(), GriddedFieldPRegridHelper(), interp(), joker, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstVectorView::nelem(), ConstTensor4View::nrows(), GriddedField4::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
void GriddedFieldPRegrid | ( | ArrayOfGriddedField3 & | out, |
const Vector & | p_grid, | ||
const ArrayOfGriddedField3 & | in, | ||
const Index & | interp_order, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldPRegrid.
Interpolates the input field along the pressure dimension to p_grid.
If zero-padding is applied (zeropadding=1), pressures that are outside the p_grid are set to 0. This is thought, e.g., for VMR fields that outside the given pressure can safely be assumed to be zero. Note: Using zeropadding for altitude and temperature fields is strongly discouraged (it will work here, though, but likely trigger errors later on). Extrapolation is allowed within the common 0.5grid-step margin, but is overruled by zeropadding. in and out fields can be the same variable.
[out] | out | Supergeneric output |
[in] | p_grid | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
[in] | zeropadding | Generic Input (Default: "0") |
Definition at line 717 of file m_atmosphere.cc.
References GriddedFieldPRegrid(), and Array< base >::nelem().
void GriddedFieldPRegridHelper | ( | Index & | ing_min, |
Index & | ing_max, | ||
ArrayOfGridPosPoly & | gp_p, | ||
Matrix & | itw, | ||
GriddedField & | gfraw_out, | ||
const GriddedField & | gfraw_in, | ||
const Index | p_grid_index, | ||
ConstVectorView | p_grid, | ||
const Index & | interp_order, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
Calculate grid positions and interpolations weights for GriddedFieldPRegrid.
Definition at line 507 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_interpolation_pgrids(), chk_interpolation_pgrids_loose_no_data_check(), CREATE_OUT2, GriddedField::get_grid_name(), GriddedField::get_numeric_grid(), interpweights(), ConstVectorView::nelem(), p2gridpos_poly(), Matrix::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
Referenced by GriddedFieldPRegrid().
void GriddedFieldZToPRegrid | ( | GriddedField3 & | out, |
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | z_field, | ||
const GriddedField3 & | in, | ||
const Index & | interp_order, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: GriddedFieldZToPRegrid.
Interpolates the input field along the vertical dimension to p_grid.
This is done from z_field, and thus requires the atmosphere to be set beforehand.
The latitude and longitude grid of the input field must match lat_grid and lon_grid for the method to work.
BETA mode.
[out] | out | Generic output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | z_field | WS Input |
[in] | in | Generic Input |
[in] | interp_order | Generic Input (Default: "1") |
[in] | zeropadding | Generic Input (Default: "0") |
Definition at line 1183 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), GriddedField3::data, GriddedField::get_grid_name(), GriddedField::get_numeric_grid(), GriddedFieldZToPRegridHelper(), interp(), joker, ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstTensor3View::nrows(), GriddedField3::resize(), GriddedField::set_grid(), and GriddedField::set_grid_name().
Referenced by GriddedFieldZToPRegrid_g().
void GriddedFieldZToPRegridHelper | ( | Index & | ing_min, |
Index & | ing_max, | ||
ArrayOfGridPosPoly & | gp_p, | ||
Matrix & | itw, | ||
const GriddedField & | gfraw_in, | ||
const Index | z_grid_index, | ||
ConstVectorView | z_grid, | ||
const Index & | interp_order, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
Calculate grid positions and interpolations weights for GriddedFieldZToPRegrid.
Definition at line 1122 of file m_atmosphere.cc.
References chk_griddedfield_gridname(), chk_interpolation_grids_loose_no_data_check(), chk_interpolation_pgrids(), CREATE_OUT2, GriddedField::get_numeric_grid(), gridpos_poly(), interpweights(), ConstVectorView::nelem(), and Matrix::resize().
Referenced by GriddedFieldZToPRegrid().
void InterpAtmFieldToPosition | ( | Numeric & | out, |
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | z_field, | ||
const Vector & | rtp_pos, | ||
const Tensor3 & | field, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: InterpAtmFieldToPosition.
Point interpolation of atmospheric fields.
The default way to specify the position is by rtp_pos.
Linear interpolation is applied.
[out] | out | Generic output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | z_field | WS Input |
[in] | rtp_pos | WS Input |
[in] | field | Generic Input |
Definition at line 2365 of file m_atmosphere.cc.
References chk_atm_field(), chk_atm_grids(), chk_rte_pos(), CREATE_OUT3, interp_atmfield_by_gp(), and rte_pos2gridpos().
Referenced by InterpAtmFieldToPosition_g().
void lat_gridFromRawField | ( | Vector & | lat_grid, |
const GriddedField3 & | field_raw, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: lat_gridFromRawField.
Sets lat_grid according to given raw atmospheric field's lat_grid. Similar to p_gridFromZRaw, but acting on a generic GriddedField3 (e.g., a wind or magnetic field component).
[out] | lat_grid | WS Output |
[in] | field_raw | Generic Input |
Definition at line 2476 of file m_atmosphere.cc.
References GriddedField::get_numeric_grid(), and GFIELD3_LAT_GRID.
Referenced by lat_gridFromRawField_g().
void lon_gridFromRawField | ( | Vector & | lon_grid, |
const GriddedField3 & | field_raw, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: lon_gridFromRawField.
Sets lon_grid according to given raw atmospheric field's lat_grid. Similar to p_gridFromZRaw, but acting on a generic GriddedField3 (e.g., a wind or magnetic field component).
[out] | lon_grid | WS Output |
[in] | field_raw | Generic Input |
Definition at line 2487 of file m_atmosphere.cc.
References GriddedField::get_numeric_grid(), and GFIELD3_LON_GRID.
Referenced by lon_gridFromRawField_g().
WORKSPACE METHOD: p_gridDensify.
A simple way to make p_grid more dense.
The method includes new values in p_grid. For each intermediate pressure range, nfill points are added. That is, setting nfill to zero returns an unmodified p_grid. The number of elements of the new p_grid is (n0-1)*(1+nfill)+1, where n0 is the original length.
The new points are distributed equidistant in log(p).
[out] | p_grid | WS Output |
[in] | nfill | Generic Input (Default: "-1") |
Definition at line 2398 of file m_atmosphere.cc.
References ConstVectorView::nelem(), Vector::resize(), and VectorNLogSpace().
Referenced by p_gridDensify_g().
void p_gridFromZRaw | ( | Vector & | p_grid, |
const GriddedField3 & | z_field_raw, | ||
const Index & | no_negZ, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: p_gridFromZRaw.
Sets p_grid according to input atmosphere's raw z_field, derived e.g. from AtmRawRead. Attention: as default only pressure values for altitudes >= 0 are extracted. If negative altitudes shall also be selected, set no_neg=0.
[out] | p_grid | WS Output |
[in] | z_field_raw | WS Input |
[in] | no_negZ | Generic Input (Default: "1") |
Definition at line 2434 of file m_atmosphere.cc.
References GriddedField3::data, GriddedField::get_numeric_grid(), GFIELD3_P_GRID, is_decreasing(), is_increasing(), joker, and ConstTensor3View::npages().
Referenced by p_gridFromZRaw_g().
void wind_u_fieldIncludePlanetRotation | ( | Tensor3 & | wind_u_field, |
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Vector & | refellipsoid, | ||
const Tensor3 & | z_field, | ||
const Numeric & | planet_rotation_period, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: wind_u_fieldIncludePlanetRotation.
Maps the planet's rotation to an imaginary wind.
This method is of relevance if the observation platform is not following the planet's rotation, and Doppler effects must be considered. Examples include full disk observations from another planet or a satellite not in orbit of the observed planet.
The rotation of the planet is not causing any Doppler shift for 1D and 2D simulations, and the method can only be used for 3D.
[out] | wind_u_field | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | refellipsoid | WS Input |
[in] | z_field | WS Input |
[in] | planet_rotation_period | WS Input |
Definition at line 2498 of file m_atmosphere.cc.
References chk_atm_field(), DEG2RAD, ConstVectorView::nelem(), ConstTensor3View::npages(), PI, refell2r(), and Tensor3::resize().
Referenced by wind_u_fieldIncludePlanetRotation_g().
Definition at line 2549 of file m_atmosphere.cc.
Referenced by z_fieldFromHSE().
void z_fieldFromHSE | ( | Workspace & | ws, |
Tensor3 & | z_field, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Vector & | lat_true, | ||
const Vector & | lon_true, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const Vector & | refellipsoid, | ||
const Matrix & | z_surface, | ||
const Index & | atmfields_checked, | ||
const Agenda & | g0_agenda, | ||
const Numeric & | molarmass_dry_air, | ||
const Numeric & | p_hse, | ||
const Numeric & | z_hse_accuracy, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: z_fieldFromHSE.
Force altitudes to fulfil hydrostatic equilibrium.
The method applies hydrostatic equilibrium. A mixture of "dry air" and water vapour (if present as abs_species tag) is assumed. That is, the air is assumed to be well mixed and its weight, apart from the water vapour, is constant (molarmass_dry_air). In addition, the effect of any particles (including liquid and ice particles) is neglected.
The output is an update of z_field. This variable is expected to contain approximative altitudes when calling the function. The altitude matching p_hse is kept constant. Other input altitudes can basically be arbitrary, but good estimates give quicker calculations.
The calculations are repeated until the change in altitude is below z_hse_accuracy*. An iterative process is needed as gravity varies with altitude.
For 1D and 2D, the geographical position is taken from lat_true and lon_true.
[in,out] | ws | Workspace |
[out] | z_field | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | lat_true | WS Input |
[in] | lon_true | WS Input |
[in] | abs_species | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | refellipsoid | WS Input |
[in] | z_surface | WS Input |
[in] | atmfields_checked | WS Input |
[in] | g0_agenda | WS Input |
[in] | molarmass_dry_air | WS Input |
[in] | p_hse | WS Input |
[in] | z_hse_accuracy | WS Input |
Definition at line 2560 of file m_atmosphere.cc.
References chk_latlon_true(), CREATE_OUT1, find_first_species_tg(), g0_agendaExecute(), GAS_CONSTANT, interp(), interpweights(), joker, max, ConstTensor3View::ncols(), ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstTensor3View::nrows(), ConstMatrixView::nrows(), p2gridpos(), pos2true_latlon(), refell2r(), species_index_from_species_name(), and z2g().
Referenced by jacobianCalcTemperaturePerturbations(), and z_fieldFromHSE_g().
const Numeric DEG2RAD |
Referenced by wind_u_fieldIncludePlanetRotation().
const Numeric EPSILON_LON_CYCLIC = 2*DBL_EPSILON |
Data value accuracy requirement for values at 0 and 360 deg if longitudes are cyclic.
Referenced by GriddedFieldLatLonRegrid().
const Numeric GAS_CONSTANT |
Referenced by z_fieldFromHSE().
const Index GFIELD3_LAT_GRID |
Referenced by atm_fields_compactAddSpecies(), AtmFieldsCalc(), and lat_gridFromRawField().
const Index GFIELD3_LON_GRID |
Referenced by atm_fields_compactAddSpecies(), AtmFieldsCalc(), and lon_gridFromRawField().
const Index GFIELD3_P_GRID |
Referenced by atm_fields_compactAddSpecies(), AtmFieldsCalc(), and p_gridFromZRaw().
const Index GFIELD4_FIELD_NAMES |
Referenced by atm_fields_compactExpand(), atm_fields_compactFromMatrix(), and AtmFieldsFromCompact().
const Index GFIELD4_LAT_GRID |
Referenced by atm_fields_compactAddSpecies(), atm_fields_compactFromMatrix(), and AtmFieldsFromCompact().
const Index GFIELD4_LON_GRID |
Referenced by atm_fields_compactAddSpecies(), atm_fields_compactFromMatrix(), and AtmFieldsFromCompact().
const Index GFIELD4_P_GRID |
Referenced by atm_fields_compactAddSpecies(), atm_fields_compactFromMatrix(), and AtmFieldsFromCompact().
const Numeric PI |
Referenced by wind_u_fieldIncludePlanetRotation().