ARTS
2.4.0(git:4fb77825)
|
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 | 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 ArrayOfArrayOfSingleScatteringData &scat_data, 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... | |
void | DOBatchCalc (Workspace &ws, ArrayOfTensor7 &dobatch_cloudbox_field, ArrayOfTensor5 &dobatch_radiance_field, ArrayOfTensor4 &dobatch_irradiance_field, ArrayOfTensor5 &dobatch_spectral_irradiance_field, const Index &ybatch_start, const Index &ybatch_n, const Agenda &dobatch_calc_agenda, const Index &robust, const Verbosity &verbosity) |
WORKSPACE METHOD: DOBatchCalc. 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 DOBatchCalc | ( | Workspace & | ws, |
ArrayOfTensor7 & | dobatch_cloudbox_field, | ||
ArrayOfTensor5 & | dobatch_radiance_field, | ||
ArrayOfTensor4 & | dobatch_irradiance_field, | ||
ArrayOfTensor5 & | dobatch_spectral_irradiance_field, | ||
const Index & | ybatch_start, | ||
const Index & | ybatch_n, | ||
const Agenda & | dobatch_calc_agenda, | ||
const Index & | robust, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: DOBatchCalc.
Performs batch calculations for radiation fields.
We perform ybatch_n jobs, starting at index ybatch_start. (Zero based indexing, as usual.) The output arrays will have ybatch_n elements. Indices in the output array start with zero, independent of ybatch_start.
WARNING, MEMORY INTENSIVE!!!: Since the outputs of this methods can be very large, make sure you only pass back output you need. Estimate the size of your output by looking at the dimensions beforehand. If you only want to pass back some fields, make sure to empty the others at the end of your dobatch_calc_agenda. E.g.: Tensor7SetConstant(cloudbox_field, 0, 0, 0, 0, 0, 0, 0, 0.)
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 dobatch_calc_agenda. <br> b. If ybatch_index = ybatch_start, resizes the output <br> arrays based on ybatch_n. <br> c. Copies calculated fields to ybatch_index - ybatch_start <br> of output arrays. <br> d. Adds 1 to ybatch_index.
Beside the dobatch_calc_agenda, the WSVs ybatch_start and ybatch_n must be set before calling this method.
The input variable ybatch_start is set to a default of zero in general.arts*.
[in,out] | ws | Workspace |
[out] | dobatch_cloudbox_field | WS Output |
[out] | dobatch_radiance_field | WS Output |
[out] | dobatch_irradiance_field | WS Output |
[out] | dobatch_spectral_irradiance_field | WS Output |
[in] | ybatch_start | WS Input |
[in] | ybatch_n | WS Input |
[in] | dobatch_calc_agenda | WS Input |
[in] | robust | Generic Input (Default: "0") |
Definition at line 652 of file m_batch.cc.
References arts_omp_get_thread_num(), ARTS::Var::cloudbox_field(), CREATE_OUTS, ARTS::Var::dobatch_calc_agenda(), dobatch_calc_agendaExecute(), ARTS::Var::dobatch_cloudbox_field(), ARTS::Var::dobatch_irradiance_field(), ARTS::Var::dobatch_radiance_field(), ARTS::Var::dobatch_spectral_irradiance_field(), ARTS::Var::irradiance_field(), ARTS::Var::radiance_field(), ARTS::Var::spectral_irradiance_field(), ARTS::Var::ybatch_index(), ARTS::Var::ybatch_n(), and ARTS::Var::ybatch_start().
Referenced by DOBatchCalc_g().
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 62 of file m_batch.cc.
References CREATE_OUT1, ARTS::Var::forloop_agenda(), forloop_agendaExecute(), and Zeeman::start().
Referenced by ForLoop_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 79 of file m_batch.cc.
References arts_omp_get_thread_num(), CREATE_OUTS, ARTS::Var::jacobian(), ARTS::Var::y(), ARTS::Var::y_aux(), ARTS::Var::ybatch(), ARTS::Var::ybatch_aux(), ARTS::Var::ybatch_calc_agenda(), ybatch_calc_agendaExecute(), ARTS::Var::ybatch_index(), ARTS::Var::ybatch_jacobians(), ARTS::Var::ybatch_n(), and ARTS::Var::ybatch_start().
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 ArrayOfArrayOfSingleScatteringData & | scat_data, | ||
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 | WS Input |
[in] | nelem_p_grid | Generic Input |
[in] | met_profile_path | Generic Input |
[in] | met_profile_pnd_path | Generic Input |
Definition at line 238 of file m_batch.cc.
References abs, ARTS::Var::abs_species(), ARTS::Var::atmosphere_dim(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), cloudboxSetManually(), data, DEG2RAD, ARTS::Var::f_grid(), GFIELD3_P_GRID, joker, ARTS::Var::lat(), ARTS::Var::lat_grid(), ARTS::Var::lon(), ARTS::Var::lon_grid(), ARTS::Var::met_amsu_data(), ARTS::Var::met_profile_calc_agenda(), met_profile_calc_agendaExecute(), ConstVectorView::nelem(), ARTS::Var::p_grid(), ARTS::Var::pnd_field_raw(), RAD2DEG, ARTS::Var::refellipsoid(), ARTS::Var::scat_data(), ARTS::Var::sensor_los(), ARTS::Var::sensor_pos(), ARTS::Var::t_field_raw(), TotalNumberOfElements(), VectorNLogSpace(), ARTS::Var::verbosity(), ARTS::Var::vmr_field_raw(), xml_read_from_file(), ARTS::Var::y(), ARTS::Var::ybatch(), ARTS::Var::z_field_raw(), and ARTS::Var::z_surface().
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 476 of file m_batch.cc.
References abs, ARTS::Var::abs_species(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), ARTS::Var::f_grid(), FILE_TYPE_ASCII, GFIELD3_P_GRID, joker, ARTS::Var::lat(), ARTS::Var::lon(), ARTS::Var::met_amsu_data(), ARTS::Var::met_profile_calc_agenda(), met_profile_calc_agendaExecute(), ConstVectorView::nelem(), ARTS::Var::p_grid(), PI, ARTS::Var::pnd_field_raw(), ARTS::Var::refellipsoid(), ARTS::Var::sensor_los(), ARTS::Var::sensor_pos(), ARTS::Var::t_field_raw(), VectorNLogSpace(), ARTS::Var::verbosity(), ARTS::Var::vmr_field_raw(), xml_read_from_file(), xml_write_to_file(), ARTS::Var::y(), ARTS::Var::ybatch(), ARTS::Var::z_field_raw(), and ARTS::Var::z_surface().
Referenced by ybatchMetProfilesClear_g().
|
extern |
Referenced by ybatchMetProfiles().
|
extern |
Referenced by ybatchMetProfiles(), and ybatchMetProfilesClear().
|
extern |
Referenced by ybatchMetProfilesClear().
|
extern |
Referenced by ybatchMetProfiles().