ARTS
2.2.66
|
Workspace functions for doing batch calculations. More...
#include <cmath>
#include "arts.h"
#include "arts_omp.h"
#include "auto_md.h"
#include "math_funcs.h"
#include "physics_funcs.h"
#include "rte.h"
#include "xml_io.h"
Go to the source code of this file.
Functions | |
void | ForLoop (Workspace &ws, const Agenda &forloop_agenda, const Index &start, const Index &stop, const Index &step, const Verbosity &verbosity) |
WORKSPACE METHOD: ForLoop. More... | |
void | VectorExtractFromMatrix (Vector &v, const Matrix &m, const Index &index, const String &direction, const Verbosity &) |
WORKSPACE METHOD: VectorExtractFromMatrix. More... | |
void | MatrixExtractFromTensor3 (Matrix &m, const Tensor3 &t3, const Index &index, const String &direction, const Verbosity &) |
WORKSPACE METHOD: MatrixExtractFromTensor3. More... | |
void | ybatchCalc (Workspace &ws, ArrayOfVector &ybatch, ArrayOfArrayOfVector &ybatch_aux, ArrayOfMatrix &ybatch_jacobians, const Index &ybatch_start, const Index &ybatch_n, const Agenda &ybatch_calc_agenda, const Index &robust, const Verbosity &verbosity) |
WORKSPACE METHOD: ybatchCalc. More... | |
void | ybatchMetProfiles (Workspace &ws, ArrayOfVector &ybatch, const ArrayOfArrayOfSpeciesTag &abs_species, const Agenda &met_profile_calc_agenda, const Vector &f_grid, const Matrix &met_amsu_data, const Matrix &sensor_pos, const Vector &refellipsoid, const Vector &lat_grid, const Vector &lon_grid, const Index &atmosphere_dim, const ArrayOfSingleScatteringData &scat_data_array, const Index &nelem_p_grid, const String &met_profile_path, const String &met_profile_pnd_path, const Verbosity &verbosity) |
WORKSPACE METHOD: ybatchMetProfiles. More... | |
void | ybatchMetProfilesClear (Workspace &ws, ArrayOfVector &ybatch, const ArrayOfArrayOfSpeciesTag &abs_species, const Agenda &met_profile_calc_agenda, const Vector &f_grid, const Matrix &met_amsu_data, const Matrix &sensor_pos, const Vector &refellipsoid, const Index &nelem_p_grid, const String &met_profile_path, const Verbosity &verbosity) |
WORKSPACE METHOD: ybatchMetProfilesClear. More... | |
Variables | |
const Numeric | PI |
const Numeric | DEG2RAD |
const Numeric | RAD2DEG |
const Index | GFIELD3_P_GRID |
Workspace functions for doing batch calculations.
These functions are listed in the doxygen documentation as entries of the file auto_md.h.
Definition in file m_batch.cc.
void ForLoop | ( | Workspace & | ws, |
const Agenda & | forloop_agenda, | ||
const Index & | start, | ||
const Index & | stop, | ||
const Index & | step, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ForLoop.
A simple for-loop.
This method is handy when you quickly want to test out a calculation with a set of different settings.
It does a for-loop from start to stop in steps of step (who would have guessed that). For each iteration, the agenda forloop_agenda is executed. Inside the agenda, the variable forloop_index is available as index counter.
There are no other inputs to forloop_agenda, and also no outputs. That means, if you want to get any results out of this loop, you have to save it to files (for example with WriteXMLIndexed), since variables used inside the agenda will only be local.
Note that this kind of for loop is not parallel.
The method is intended for simple testing, not as a replacement of ybatchCalc*. However, it is compatible with ybatchCalc, in the sense that ybatchCalc may occur inside forloop_agenda.
[in,out] | ws | Workspace |
[in] | forloop_agenda | WS Input |
[in] | start | Generic Input |
[in] | stop | Generic Input |
[in] | step | Generic Input |
Definition at line 68 of file m_batch.cc.
References CREATE_OUT1, and forloop_agendaExecute().
Referenced by ForLoop_g().
void MatrixExtractFromTensor3 | ( | Matrix & | out, |
const Tensor3 & | in, | ||
const Index & | i, | ||
const String & | direction, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: MatrixExtractFromTensor3.
Extracts a Matrix from a Tensor3.
Copies page or row or column with given Index from input Tensor3 variable to output Matrix. Higher order equivalent of VectorExtractFromMatrix.
[out] | out | Generic output |
[in] | in | Generic Input |
[in] | i | Generic Input |
[in] | direction | Generic Input |
Definition at line 144 of file m_batch.cc.
References joker, ConstTensor3View::ncols(), ConstTensor3View::npages(), ConstTensor3View::nrows(), and Matrix::resize().
Referenced by MatrixExtractFromTensor3_g().
void VectorExtractFromMatrix | ( | Vector & | out, |
const Matrix & | in, | ||
const Index & | i, | ||
const String & | direction, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: VectorExtractFromMatrix.
Extracts a Vector from a Matrix.
Copies row or column with given Index from input Matrix variable to create output Vector.
[out] | out | Generic output |
[in] | in | Generic Input |
[in] | i | Generic Input |
[in] | direction | Generic Input |
Definition at line 94 of file m_batch.cc.
References joker, ConstMatrixView::ncols(), ConstMatrixView::nrows(), and Vector::resize().
Referenced by VectorExtractFromMatrix_g().
void ybatchCalc | ( | Workspace & | ws, |
ArrayOfVector & | ybatch, | ||
ArrayOfArrayOfVector & | ybatch_aux, | ||
ArrayOfMatrix & | ybatch_jacobians, | ||
const Index & | ybatch_start, | ||
const Index & | ybatch_n, | ||
const Agenda & | ybatch_calc_agenda, | ||
const Index & | robust, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ybatchCalc.
Performs batch calculations for the measurement vector y.
We perform ybatch_n jobs, starting at index ybatch_start. (Zero based indexing, as usual.) The output array ybatch will have ybatch_n elements. Indices in the output array start with zero, independent of ybatch_start.
The method performs the following: <br> 1. Sets ybatch_index = ybatch_start. <br> 2. Performs a-d until <br> ybatch_index = ybatch_start + ybatch_n. <br> a. Executes ybatch_calc_agenda. <br> b. If ybatch_index = ybatch_start, resizes ybatch <br> based on ybatch_n and length of y. <br> c. Copies y to ybatch_index - ybatch_start <br> of ybatch. <br> d. Adds 1 to ybatch_index.
Beside the ybatch_calc_agenda, the WSVs ybatch_start and ybatch_n must be set before calling this method. Further, ybatch_calc_agenda is expected to produce a spectrum and should accordingly include a call of yCalc (or asimilar method).
The input variable ybatch_start is set to a default of zero in general.arts*.
An agenda that calculates spectra for different temperature profiles could look like this:
<br> AgendaSet(ybatch_calc_agenda){ <br> Extract(t_field,tensor4_1,ybatch_index) <br> yCalc <br> }
Jacobians are also collected, and stored in output variable ybatch_jacobians. (This will be empty if yCalc produces empty Jacobians.)
See the user guide for further practical examples.
[in,out] | ws | Workspace |
[out] | ybatch | WS Output |
[out] | ybatch_aux | WS Output |
[out] | ybatch_jacobians | WS Output |
[in] | ybatch_start | WS Input |
[in] | ybatch_n | WS Input |
[in] | ybatch_calc_agenda | WS Input |
[in] | robust | Generic Input (Default: "0") |
Definition at line 208 of file m_batch.cc.
References arts_omp_get_thread_num(), CREATE_OUTS, ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), and ybatch_calc_agendaExecute().
Referenced by ybatchCalc_g().
void ybatchMetProfiles | ( | Workspace & | ws, |
ArrayOfVector & | ybatch, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Agenda & | met_profile_calc_agenda, | ||
const Vector & | f_grid, | ||
const Matrix & | met_amsu_data, | ||
const Matrix & | sensor_pos, | ||
const Vector & | refellipsoid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Index & | atmosphere_dim, | ||
const ArrayOfSingleScatteringData & | scat_data_array, | ||
const Index & | nelem_p_grid, | ||
const String & | met_profile_path, | ||
const String & | met_profile_pnd_path, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ybatchMetProfiles.
This method is used for simulating ARTS for metoffice model fields This method reads in met_amsu_data which contains the lat-lon of the metoffice profile files as a Matrix. It then loops over the number of profiles and corresponding to each longitude create the appropriate profile basename. Then, corresponding to each basename we have temperature field, altitude field, humidity field and particle number density field. The temperature field and altitude field are stored in the same dimensions as t_field_raw and z_field_raw. The oxygen and nitrogen VMRs are set to constant values of 0.209 and 0.782, respectively and are used along with humidity field to generate vmr_field_raw.
The three fields t_field_raw, z_field_raw, and vmr_field_raw are given as input to met_profile_calc_agenda which is called in this method. See documentation of WSM met_profile_calc_agenda for more information on this agenda.
The method also converts satellite zenith angle to appropriate sensor_los*. It also sets the p_grid and cloudbox_limits from the profiles inside the function
[in,out] | ws | Workspace |
[out] | ybatch | WS Output |
[in] | abs_species | WS Input |
[in] | met_profile_calc_agenda | WS Input |
[in] | f_grid | WS Input |
[in] | met_amsu_data | WS Input |
[in] | sensor_pos | WS Input |
[in] | refellipsoid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | scat_data_array | WS Input |
[in] | nelem_p_grid | Generic Input |
[in] | met_profile_path | Generic Input |
[in] | met_profile_pnd_path | Generic Input |
Definition at line 373 of file m_batch.cc.
References abs, cloudboxSetManually(), GriddedField3::data, DEG2RAD, GriddedField::get_numeric_grid(), GFIELD3_P_GRID, joker, met_profile_calc_agendaExecute(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), RAD2DEG, Vector::resize(), Matrix::resize(), VectorNLogSpace(), and xml_read_from_file().
Referenced by ybatchMetProfiles_g().
void ybatchMetProfilesClear | ( | Workspace & | ws, |
ArrayOfVector & | ybatch, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Agenda & | met_profile_calc_agenda, | ||
const Vector & | f_grid, | ||
const Matrix & | met_amsu_data, | ||
const Matrix & | sensor_pos, | ||
const Vector & | refellipsoid, | ||
const Index & | nelem_p_grid, | ||
const String & | met_profile_path, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ybatchMetProfilesClear.
This method is used for simulating ARTS for metoffice model fields for clear sky conditions.
This method reads in met_amsu_data which contains the lat-lon of the metoffice profile files as a Matrix. It then loops over the number of profiles and corresponding to each longitude create the appropriate profile basename. Then, Corresponding to each basename we have temperature field, altitude field, humidity field and particle number density field. The temperature field and altitude field are stored in the same dimensions as t_field_raw and z_field_raw. The oxygen and nitrogen VMRs are set to constant values of 0.209 and 0.782, respectively and are used along with humidity field to generate vmr_field_raw.
The three fields t_field_raw, z_field_raw, and vmr_field_raw are given as input to met_profile_calc_agenda which is called in this method. See documentation of WSM met_profile_calc_agenda for more information on this agenda.
The method also converts satellite zenith angle to appropriate sensor_los*. It also sets the p_grid and cloudbox_limits from the profiles inside the function
[in,out] | ws | Workspace |
[out] | ybatch | WS Output |
[in] | abs_species | WS Input |
[in] | met_profile_calc_agenda | WS Input |
[in] | f_grid | WS Input |
[in] | met_amsu_data | WS Input |
[in] | sensor_pos | WS Input |
[in] | refellipsoid | WS Input |
[in] | nelem_p_grid | Generic Input |
[in] | met_profile_path | Generic Input |
Definition at line 602 of file m_batch.cc.
References abs, GriddedField3::data, FILE_TYPE_ASCII, GriddedField::get_numeric_grid(), GFIELD3_P_GRID, joker, met_profile_calc_agendaExecute(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), PI, Vector::resize(), Matrix::resize(), VectorNLogSpace(), xml_read_from_file(), and xml_write_to_file().
Referenced by ybatchMetProfilesClear_g().
|
extern |
Referenced by ybatchMetProfiles().
|
extern |
Referenced by ybatchMetProfiles(), and ybatchMetProfilesClear().
|
extern |
Referenced by ybatchMetProfilesClear().
|
extern |
Referenced by ybatchMetProfiles().