ARTS  2.2.66
m_rte.cc File Reference

Workspace functions for solving clear sky radiative transfer. More...

#include <cmath>
#include <stdexcept>
#include "arts.h"
#include "arts_omp.h"
#include "auto_md.h"
#include "check_input.h"
#include "geodetic.h"
#include "jacobian.h"
#include "logic.h"
#include "math_funcs.h"
#include "messages.h"
#include "montecarlo.h"
#include "physics_funcs.h"
#include "ppath.h"
#include "rte.h"
#include "special_interp.h"

Go to the source code of this file.

Functions

void iyApplyUnit (Matrix &iy, ArrayOfTensor4 &iy_aux, const Index &stokes_dim, const Vector &f_grid, const ArrayOfString &iy_aux_vars, const String &iy_unit, const Verbosity &)
 WORKSPACE METHOD: iyApplyUnit. More...
 
void iyCalc (Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, Ppath &ppath, const Index &atmfields_checked, const Index &atmgeom_checked, const ArrayOfString &iy_aux_vars, const Vector &f_grid, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &iy_main_agenda, const Verbosity &)
 WORKSPACE METHOD: iyCalc. More...
 
void iyEmissionStandard (Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const Agenda &ppath_agenda, const Agenda &blackbody_radiation_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Numeric &rte_alonglos_v, const Numeric &ppath_lraytrace, const Verbosity &verbosity)
 WORKSPACE METHOD: iyEmissionStandard. More...
 
void iyLoopFrequencies (Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const ArrayOfString &iy_aux_vars, const Index &stokes_dim, const Vector &f_grid, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index &jacobian_do, const Agenda &iy_sub_agenda, const Verbosity &)
 WORKSPACE METHOD: iyLoopFrequencies. More...
 
void iyMC (Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, ArrayOfTensor3 &diy_dx, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Vector &rte_pos, const Vector &rte_los, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const Vector &refellipsoid, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &stokes_dim, const Vector &f_grid, const ArrayOfSingleScatteringData &scat_data_array, const Agenda &iy_space_agenda, const Agenda &surface_rtprop_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &ppath_step_agenda, const Numeric &ppath_lraytrace, const Tensor4 &pnd_field, const String &iy_unit, const Numeric &mc_std_err, const Index &mc_max_time, const Index &mc_max_iter, const Index &mc_min_iter, const Verbosity &verbosity)
 WORKSPACE METHOD: iyMC. More...
 
void iyReplaceFromAux (Matrix &iy, const ArrayOfTensor4 &iy_aux, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const String &aux_var, const Verbosity &)
 WORKSPACE METHOD: iyReplaceFromAux. More...
 
void iy_auxFillParticleVariables (ArrayOfTensor4 &iy_aux, const Index &atmfields_checked, const Index &cloudbox_checked, const Index &atmosphere_dim, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const Matrix &particle_masses, const Ppath &ppath, const ArrayOfString &iy_aux_vars, const Verbosity &)
 WORKSPACE METHOD: iy_auxFillParticleVariables. More...
 
void yCalc_mblock_loop_body (bool &failed, String &fail_msg, ArrayOfArrayOfVector &iyb_aux_array, Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, Matrix &jacobian, const Index &atmosphere_dim, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Matrix &sensor_pos, const Matrix &sensor_los, const Matrix &transmitter_pos, const Vector &mblock_za_grid, const Vector &mblock_aa_grid, const Index &antenna_dim, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Vector &sensor_response_za, const Vector &sensor_response_aa, const Agenda &iy_main_agenda, const Agenda &jacobian_agenda, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Verbosity &verbosity, const Index &mblock_index, const Index &n1y, const Index &j_analytical_do)
 
void yCalc (Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, ArrayOfVector &y_aux, Matrix &jacobian, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &atmosphere_dim, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &sensor_checked, const Index &stokes_dim, const Vector &f_grid, const Matrix &sensor_pos, const Matrix &sensor_los, const Matrix &transmitter_pos, const Vector &mblock_za_grid, const Vector &mblock_aa_grid, const Index &antenna_dim, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Vector &sensor_response_za, const Vector &sensor_response_aa, const Agenda &iy_main_agenda, const Agenda &jacobian_agenda, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Verbosity &verbosity)
 WORKSPACE METHOD: yCalc. More...
 
void yCalcAppend (Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, ArrayOfVector &y_aux, Matrix &jacobian, ArrayOfRetrievalQuantity &jacobian_quantities, ArrayOfArrayOfIndex &jacobian_indices, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &atmosphere_dim, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &sensor_checked, const Index &stokes_dim, const Vector &f_grid, const Matrix &sensor_pos, const Matrix &sensor_los, const Matrix &transmitter_pos, const Vector &mblock_za_grid, const Vector &mblock_aa_grid, const Index &antenna_dim, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Vector &sensor_response_za, const Vector &sensor_response_aa, const Agenda &iy_main_agenda, const Agenda &jacobian_agenda, const Index &jacobian_do, const ArrayOfString &iy_aux_vars, const ArrayOfRetrievalQuantity &jacobian_quantities1, const ArrayOfArrayOfIndex &jacobian_indices1, const Index &append_instrument_wfs, const Verbosity &verbosity)
 WORKSPACE METHOD: yCalcAppend. More...
 
void yApplyUnit (Vector &y, Matrix &jacobian, const Vector &y_f, const ArrayOfIndex &y_pol, const String &iy_unit, const Verbosity &)
 WORKSPACE METHOD: yApplyUnit. More...
 

Variables

const Numeric PI
 
const Numeric SPEED_OF_LIGHT
 
const String ABSSPECIES_MAINTAG
 
const String TEMPERATURE_MAINTAG
 
const String WIND_MAINTAG
 

Detailed Description

Workspace functions for solving clear sky radiative transfer.

Author
Patrick Eriksson patri.nosp@m.ck.e.nosp@m.rikss.nosp@m.on@c.nosp@m.halme.nosp@m.rs.s.nosp@m.e
Date
2002-05-11

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_rte.cc.

Function Documentation

◆ iy_auxFillParticleVariables()

void iy_auxFillParticleVariables ( ArrayOfTensor4 iy_aux,
const Index atmfields_checked,
const Index cloudbox_checked,
const Index atmosphere_dim,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Tensor4 pnd_field,
const Matrix particle_masses,
const Ppath ppath,
const ArrayOfString iy_aux_vars,
const Verbosity verbosity 
)

WORKSPACE METHOD: iy_auxFillParticleVariables.

Additional treatment some particle auxiliary variables.

This WSM is intended to complement main radiative transfer methods that does not handle scattering, and thus can not provide auxiliary data for particle properties. The following auxiliary variables are covered: <br> "PND, type X": The particle number density for particle type X <br> (ie. corresponds to book X in pnd_field). Size: [1,1,1,np]. <br> "Mass content, X": The particle content for mass category X. <br> This corresponds to column X in particle_masses (zero- <br> based indexing). Size: [1,1,1,np].

To complement iyEmissionStandard should be the main application. As a preparatory step you need to set up all cloud variables in standard manner. After this you need to set cloudbox_on to zero, and in iy_main_agenda add these lines (after iyEmissionStandard): <br> FlagOn(cloudbox_on) <br> iy_auxFillParticleVariables

Author
Patrick Eriksson
Parameters
[out]iy_auxWS Output
[in]atmfields_checkedWS Input
[in]cloudbox_checkedWS Input
[in]atmosphere_dimWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]particle_massesWS Input
[in]ppathWS Input
[in]iy_aux_varsWS Input

Definition at line 1354 of file m_rte.cc.

References Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_copy(), interp_atmfield_by_itw(), interp_cloudfield_gp2itw(), is_gp_inside_cloudbox(), joker, ConstTensor4View::nbooks(), ConstMatrixView::ncols(), Array< base >::nelem(), and Ppath::np.

Referenced by iy_auxFillParticleVariables_g().

◆ iyApplyUnit()

void iyApplyUnit ( Matrix iy,
ArrayOfTensor4 iy_aux,
const Index stokes_dim,
const Vector f_grid,
const ArrayOfString iy_aux_vars,
const String iy_unit,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyApplyUnit.

Conversion of iy to other spectral units.

The method allows a change of unit, as a post-processing step, ignoring the n2-law of radiance.

The conversion made inside iyEmissionStandard is mimiced, see that method for constraints and selection of output units. Restricted to that the n2-law can be ignored. This assumption is valid if the sensor is placed in space, or if the refractive index only deviates slightly from unity.

It is stressed that there is no automatic check that the method is applied correctly, it is up to the user to ensure that the input data are suitable for the conversion.

Beside iy, these auxilary quantities are modified: <br> "iy", "Error" and "Error (uncorrelated)"

Please note that diy_dx is not handled.

Author
Patrick Eriksson
Parameters
[out]iyWS Output
[out]iy_auxWS Output
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]iy_aux_varsWS Input
[in]iy_unitWS Input

Definition at line 73 of file m_rte.cc.

References apply_iy_unit(), joker, max, and Array< base >::nelem().

Referenced by iyApplyUnit_g().

◆ iyCalc()

void iyCalc ( Workspace ws,
Matrix iy,
ArrayOfTensor4 iy_aux,
Ppath ppath,
const Index atmgeom_checked,
const Index atmfields_checked,
const ArrayOfString iy_aux_vars,
const Vector f_grid,
const Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const Index cloudbox_on,
const Index cloudbox_checked,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Agenda iy_main_agenda,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyCalc.

A single monochromatic pencil beam calculation.

Performs monochromatic radiative transfer calculations for the specified position (rte_pos) and line-of-sight (rte_pos). See iy and associated variables for format of output.

Please note that Jacobian type calculations not are supported. For this use yCalc.

No sensor characteristics are applied. These are most easily incorporated by using yCalc

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]iyWS Output
[out]iy_auxWS Output
[out]ppathWS Output
[in]atmgeom_checkedWS Input
[in]atmfields_checkedWS Input
[in]iy_aux_varsWS Input
[in]f_gridWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]vmr_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]iy_main_agendaWS Input

Definition at line 121 of file m_rte.cc.

References iy_main_agendaExecute().

Referenced by iyCalc_g().

◆ iyEmissionStandard()

void iyEmissionStandard ( Workspace ws,
Matrix iy,
ArrayOfTensor4 iy_aux,
Ppath ppath,
ArrayOfTensor3 diy_dx,
const Index stokes_dim,
const Vector f_grid,
const Index atmosphere_dim,
const Vector p_grid,
const Tensor3 z_field,
const Tensor3 t_field,
const Tensor4 vmr_field,
const ArrayOfArrayOfSpeciesTag abs_species,
const Tensor3 wind_u_field,
const Tensor3 wind_v_field,
const Tensor3 wind_w_field,
const Tensor3 mag_u_field,
const Tensor3 mag_v_field,
const Tensor3 mag_w_field,
const Index cloudbox_on,
const String iy_unit,
const ArrayOfString iy_aux_vars,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
const ArrayOfArrayOfIndex jacobian_indices,
const Agenda ppath_agenda,
const Agenda blackbody_radiation_agenda,
const Agenda propmat_clearsky_agenda,
const Agenda iy_main_agenda,
const Agenda iy_space_agenda,
const Agenda iy_surface_agenda,
const Agenda iy_cloudbox_agenda,
const Index iy_agenda_call1,
const Tensor3 iy_transmission,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Numeric rte_alonglos_v,
const Numeric ppath_lraytrace,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyEmissionStandard.

Standard method for radiative transfer calculations with emission.

Designed to be part of iy_main_agenda. That is, only valid outside the cloudbox (no scattering). Assumes local thermodynamic equilibrium for emission. The basic calculation strategy is to take the average of the absorption and the emission source function at the end points of each step of the propagation path. For details see the user guide.

The internal radiance unit is determined by your definition of blackbody radiation inside the atmospheric and surface source terms. Set iy_unit to "1" if you want this to also be the unit for output radiances. If you want another output unit, you need to make sure that the internal unit is W/m2/Hz/sr. The possible choices for iy_unit are: <br> "1" : No conversion. <br> "RJBT" : Conversion to Rayleigh-Jean brightness <br> temperature. <br> "PlanckBT" : Conversion to Planck brightness temperature. <br> "W/(m^2 m sr)" : Conversion to [W/(m^2 m sr)] (radiance per <br> wavelength unit). <br> "W/(m^2 m-1 sr)": Conversion to [W/(m^2 m-1 sr)] (radiance per <br> wavenumber unit).

Please note that there is no way for ARTS to strictly check the internal unit. In principle, the unit can differ between the elements. The user must makes sure that any unit conversion is applied correctly, and in accordance with the calibration of the instrument of concern. Expressions applied and considerations for the unit conversion of radiances are discussed in Sec. 5.7 of the ARTS-2 article.

The following auxiliary data can be obtained: <br> "Pressure": The pressure along the propagation path. <br> Size: [1,1,1,np]. <br> "Temperature": The temperature along the propagation path. <br> Size: [1,1,1,np]. <br> "VMR, species X": VMR of the species with index X (zero based). <br> For example, adding the string "VMR, species 0" extracts the <br> VMR of the first species. Size: [1,1,1,np]. <br> "Absorption, summed": The total absorption matrix along the <br> path. Size: [nf,ns,ns,np]. <br> "Absorption, species X": The absorption matrix along the path <br> for an individual species (X works as for VMR). <br> Size: [nf,ns,ns,np]. "Radiative background": Index value flagging the radiative <br> background. The following coding is used: 0=space, 1=surface <br> and 2=cloudbox. Size: [nf,1,1,1]. <br> "iy": The radiance at each point along the path (iy_unit is. <br> considered). Size: [nf,ns,1,np]. <br> "Transmission": The transmission matrix from the surface, space <br> or cloudbox, to each propagation path point. The matrix is <br> valid for the photon direction. Size: [nf,ns,ns,np]. "Optical depth": The scalar optical depth between the <br> observation point and the end of the primary propagation path <br> (ie. the optical depth to the surface or space.). Calculated <br> in a pure scalar manner, and not dependent on direction. <br> Size: [nf,1,1,1]. where <br> nf: Number of frequencies. <br> ns: Number of Stokes elements. <br> np: Number of propagation path points.

The auxiliary data are returned in iy_aux with quantities selected by iy_aux_vars. Most variables require that the method is called directly or by iyCalc. For calculations using yCalc, the selection is restricted to the variables marked with *.

In addition, these choices are accepted but no calculations are done: <br> "PND, type X": Size: [0,0,0,0]. <br> "Mass content, X": Size: [0,0,0,0]. See e.g. iyTransmissionStandard for a definition of these variables. To fill these elements of iy_aux (after calling this WSM), use iy_auxFillParticleVariables.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]iyWS Output
[out]iy_auxWS Output
[out]ppathWS Output
[out]diy_dxWS Output
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]z_fieldWS Input
[in]t_fieldWS Input
[in]vmr_fieldWS Input
[in]abs_speciesWS Input
[in]wind_u_fieldWS Input
[in]wind_v_fieldWS Input
[in]wind_w_fieldWS Input
[in]mag_u_fieldWS Input
[in]mag_v_fieldWS Input
[in]mag_w_fieldWS Input
[in]cloudbox_onWS Input
[in]iy_unitWS Input
[in]iy_aux_varsWS Input
[in]jacobian_doWS Input
[in]jacobian_quantitiesWS Input
[in]jacobian_indicesWS Input
[in]ppath_agendaWS Input
[in]blackbody_radiation_agendaWS Input
[in]propmat_clearsky_agendaWS Input
[in]iy_main_agendaWS Input
[in]iy_space_agendaWS Input
[in]iy_surface_agendaWS Input
[in]iy_cloudbox_agendaWS Input
[in]iy_agenda_call1WS Input
[in]iy_transmissionWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]rte_alonglos_vWS Input
[in]ppath_lraytraceWS Input

Definition at line 170 of file m_rte.cc.

References apply_iy_unit(), apply_iy_unit2(), chk_if_std_blackbody_agenda(), diy_from_path_to_rgrids(), emission_rtstep(), Ppath::end_lstep, ext2trans(), find_first(), FOR_ANALYTICAL_JACOBIANS_DO, get_iy_of_background(), get_pointers_for_analytical_jacobians(), get_ppath_abs(), get_ppath_atmvars(), get_ppath_blackrad(), get_ppath_f(), get_ppath_trans(), id_mat(), iy_transmission_mult(), joker, Ppath::lstep, min, mult(), Array< base >::nelem(), ConstVectorView::nelem(), Ppath::np, Ppath::nreal, ns, ppath_agendaExecute(), ppath_what_background(), q, Tensor4::resize(), Vector::resize(), transpose(), and vmrunitscf().

Referenced by iyEmissionStandard_g().

◆ iyLoopFrequencies()

void iyLoopFrequencies ( Workspace ws,
Matrix iy,
ArrayOfTensor4 iy_aux,
Ppath ppath,
ArrayOfTensor3 diy_dx,
const ArrayOfString iy_aux_vars,
const Index stokes_dim,
const Vector f_grid,
const Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const Index cloudbox_on,
const Index iy_agenda_call1,
const Tensor3 iy_transmission,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Index jacobian_do,
const Agenda iy_sub_agenda,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyLoopFrequencies.

Radiative transfer calculations one frequency at the time.

The method loops the frequencies in f_grid and calls iy_sub_agenda* for each individual value. This method is placed in iy_main_agenda, and the actual radiative ransfer method is put in iy_sub_agenda.

A common justification for using the method should be to consider dispersion. By using this method it is ensured that the propagation path for each individual frequency is calculated.

Auxiliary data (defined by iy_aux_vars) can not contain along- the-path quantities (a common ppath is not ensured). The returned ppath* is valid for the last frequency.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]iyWS Output
[out]iy_auxWS Output
[out]ppathWS Output
[out]diy_dxWS Output
[in]iy_aux_varsWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]vmr_fieldWS Input
[in]cloudbox_onWS Input
[in]iy_agenda_call1WS Input
[in]iy_transmissionWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]jacobian_doWS Input
[in]iy_sub_agendaWS Input

Definition at line 1054 of file m_rte.cc.

References iy_sub_agendaExecute(), joker, ConstTensor3View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), q, and Matrix::resize().

Referenced by iyLoopFrequencies_g().

◆ iyMC()

void iyMC ( Workspace ws,
Matrix iy,
ArrayOfTensor4 iy_aux,
ArrayOfTensor3 diy_dx,
const Index iy_agenda_call1,
const Tensor3 iy_transmission,
const Vector rte_pos,
const Vector rte_los,
const ArrayOfString iy_aux_vars,
const Index jacobian_do,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 z_field,
const Tensor3 t_field,
const Tensor4 vmr_field,
const Vector refellipsoid,
const Matrix z_surface,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Index stokes_dim,
const Vector f_grid,
const ArrayOfSingleScatteringData scat_data_array,
const Agenda iy_space_agenda,
const Agenda surface_rtprop_agenda,
const Agenda propmat_clearsky_agenda,
const Agenda ppath_step_agenda,
const Numeric ppath_lraytrace,
const Tensor4 pnd_field,
const String iy_unit,
const Numeric mc_std_err,
const Index mc_max_time,
const Index mc_max_iter,
const Index mc_min_iter,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyMC.

Interface to Monte Carlo part for iy_main_agenda.

Basically an interface to MCGeneral for doing monochromatic pencil beam calculations. This functions allows Monte Carlo (MC) calculations for sets of frequencies and sensor pos/los in a single run. Sensor responses can be included in the standard manner (through yCalc).

This function does not apply the MC approach when it comes to sensor properties. These properties are not considered when tracking photons, which is done in MCGeneral (but then only for the antenna pattern).

Output unit options (iy_unit) exactly as for MCGeneral.

The MC calculation errors are all assumed be uncorrelated and each have a normal distribution. These properties are of relevance when weighting the errors with the sensor repsonse matrix. The seed is reset for each call of MCGeneral to obtain uncorrelated errors.

MC control arguments (mc_std_err, mc_max_time, mc_min_iter and mc_mas_iter) as for MCGeneral. The arguments are applied for each monochromatic pencil beam calculation individually. As or MCGeneral, the value of mc_error shall be adopted to iy_unit*.

The following auxiliary data can be obtained: <br> "Error (uncorrelated)": Calculation error. Size: [nf,ns,1,1]. <br> (The later part of the text string is required. It is used as <br> a flag to yCalc for how to apply the sensor data.) where <br> nf: Number of frequencies. <br> ns: Number of Stokes elements.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]iyWS Output
[out]iy_auxWS Output
[out]diy_dxWS Output
[in]iy_agenda_call1WS Input
[in]iy_transmissionWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]iy_aux_varsWS Input
[in]jacobian_doWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]t_fieldWS Input
[in]vmr_fieldWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]scat_data_arrayWS Input
[in]iy_space_agendaWS Input
[in]surface_rtprop_agendaWS Input
[in]propmat_clearsky_agendaWS Input
[in]ppath_step_agendaWS Input
[in]ppath_lraytraceWS Input
[in]pnd_fieldWS Input
[in]iy_unitWS Input
[in]mc_std_errWS Input
[in]mc_max_timeWS Input
[in]mc_max_iterWS Input
[in]mc_min_iterWS Input

Definition at line 1131 of file m_rte.cc.

References joker, MCGeneral(), MCSetSeedFromTime(), ConstTensor3View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Matrix::resize(), scat_data_array_monoCalc(), and MCAntenna::set_pencil_beam().

Referenced by iyMC_g().

◆ iyReplaceFromAux()

void iyReplaceFromAux ( Matrix iy,
const ArrayOfTensor4 iy_aux,
const ArrayOfString iy_aux_vars,
const Index jacobian_do,
const String aux_var,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyReplaceFromAux.

Change of main output variable.

With this method you can replace the content of iy with one of the auxiliary variables. The selected variable (by aux_var) must be part of iy_aux_vars. The corresponding data from iy_aux are copied to form a new iy (iy_aux is left unchanged). Elements of iy* correponding to Stokes elements not covered by the auxiliary variable are just set to zero.

Jacobian variables are not handled.

Author
Patrick Eriksson
Parameters
[out]iyWS Output
[in]iy_auxWS Input
[in]iy_aux_varsWS Input
[in]jacobian_doWS Input
[in]aux_varGeneric Input

Definition at line 1295 of file m_rte.cc.

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

Referenced by iyReplaceFromAux_g().

◆ yApplyUnit()

void yApplyUnit ( Vector y,
Matrix jacobian,
const Vector y_f,
const ArrayOfIndex y_pol,
const String iy_unit,
const Verbosity verbosity 
)

WORKSPACE METHOD: yApplyUnit.

Conversion of y to other spectral units.

Any conversion to brightness temperature is normally made inside yCalc*. This method makes it possible to also make this conversion after yCalc, but with restrictions for jacobian and with. respect to the n2-law of radiance.

The conversion made inside iyEmissionStandard is mimiced and see that method for constraints and selection of output units. This with the restriction that the n2-law can be ignored. The later is the case if the sensor is placed in space, or if the refractive only devaites slightly from unity.

The method handles y and jacobian in parallel, where the last variable is only considered if it is set. The input data must be in original radiance units. A completely stringent check of this can not be performed.

The method can not be used with jacobian quantities that are not obtained through radiative transfer calculations. One example on quantity that can not be handled is jacobianAddPolyfit. There are no automatic checks warning for incorrect usage!

If you are using this method, iy_unit should be set to "1" when calling yCalc, and be changed before calling this method.

Conversion of y_aux is not supported.

Author
Patrick Eriksson
Parameters
[out]yWS Output
[out]jacobianWS Output
[in]y_fWS Input
[in]y_polWS Input
[in]iy_unitWS Input

Definition at line 2162 of file m_rte.cc.

References apply_iy_unit(), apply_iy_unit2(), joker, max, ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), and transpose().

Referenced by yApplyUnit_g().

◆ yCalc()

void yCalc ( Workspace ws,
Vector y,
Vector y_f,
ArrayOfIndex y_pol,
Matrix y_pos,
Matrix y_los,
ArrayOfVector y_aux,
Matrix jacobian,
const Index atmgeom_checked,
const Index atmfields_checked,
const Index atmosphere_dim,
const Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index sensor_checked,
const Index stokes_dim,
const Vector f_grid,
const Matrix sensor_pos,
const Matrix sensor_los,
const Matrix transmitter_pos,
const Vector mblock_za_grid,
const Vector mblock_aa_grid,
const Index antenna_dim,
const Sparse sensor_response,
const Vector sensor_response_f,
const ArrayOfIndex sensor_response_pol,
const Vector sensor_response_za,
const Vector sensor_response_aa,
const Agenda iy_main_agenda,
const Agenda jacobian_agenda,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
const ArrayOfArrayOfIndex jacobian_indices,
const ArrayOfString iy_aux_vars,
const Verbosity verbosity 
)

WORKSPACE METHOD: yCalc.

Calculation of complete measurement vectors (y).

The method performs radiative transfer calculations from a sensor perspective. Radiative transfer calculations are performed for monochromatic pencil beams, following iy_main_agenda and associated agendas. Obtained radiances are weighted together by sensor_response*, to include the characteristics of the sensor. The measurement vector obtained can contain anything from a single frequency value to a series of measurement scans (each consisting of a series of spectra), all depending on the settings. Spectra and jacobians are calculated in parallel.

The frequency, polarisation etc. for each measurement value is given by y_f, y_pol, y_pos and y_los.

See the method selected for iy_main_agenda for quantities that can be obtained by y_aux. However, in no case data of along-the-path type can be extracted.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]yWS Output
[out]y_fWS Output
[out]y_polWS Output
[out]y_posWS Output
[out]y_losWS Output
[out]y_auxWS Output
[out]jacobianWS Output
[in]atmgeom_checkedWS Input
[in]atmfields_checkedWS Input
[in]atmosphere_dimWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]vmr_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]sensor_checkedWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]transmitter_posWS Input
[in]mblock_za_gridWS Input
[in]mblock_aa_gridWS Input
[in]antenna_dimWS Input
[in]sensor_responseWS Input
[in]sensor_response_fWS Input
[in]sensor_response_polWS Input
[in]sensor_response_zaWS Input
[in]sensor_response_aaWS Input
[in]iy_main_agendaWS Input
[in]jacobian_agendaWS Input
[in]jacobian_doWS Input
[in]jacobian_quantitiesWS Input
[in]jacobian_indicesWS Input
[in]iy_aux_varsWS Input

Definition at line 1583 of file m_rte.cc.

References arts_omp_get_max_threads(), chk_if_in_range(), chk_if_increasing(), CREATE_OUT3, FOR_ANALYTICAL_JACOBIANS_DO, get_rowindex_for_mblock(), Range::get_start(), mult(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), Sparse::nrows(), q, Vector::resize(), Matrix::resize(), and yCalc_mblock_loop_body().

Referenced by yCalc_g(), and yCalcAppend().

◆ yCalc_mblock_loop_body()

void yCalc_mblock_loop_body ( bool &  failed,
String fail_msg,
ArrayOfArrayOfVector iyb_aux_array,
Workspace ws,
Vector y,
Vector y_f,
ArrayOfIndex y_pol,
Matrix y_pos,
Matrix y_los,
Matrix jacobian,
const Index atmosphere_dim,
const Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const Index cloudbox_on,
const Index stokes_dim,
const Vector f_grid,
const Matrix sensor_pos,
const Matrix sensor_los,
const Matrix transmitter_pos,
const Vector mblock_za_grid,
const Vector mblock_aa_grid,
const Index antenna_dim,
const Sparse sensor_response,
const Vector sensor_response_f,
const ArrayOfIndex sensor_response_pol,
const Vector sensor_response_za,
const Vector sensor_response_aa,
const Agenda iy_main_agenda,
const Agenda jacobian_agenda,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
const ArrayOfArrayOfIndex jacobian_indices,
const ArrayOfString iy_aux_vars,
const Verbosity verbosity,
const Index mblock_index,
const Index n1y,
const Index j_analytical_do 
)

◆ yCalcAppend()

void yCalcAppend ( Workspace ws,
Vector y,
Vector y_f,
ArrayOfIndex y_pol,
Matrix y_pos,
Matrix y_los,
ArrayOfVector y_aux,
Matrix jacobian,
ArrayOfRetrievalQuantity jacobian_quantities,
ArrayOfArrayOfIndex jacobian_indices,
const Index atmgeom_checked,
const Index atmfields_checked,
const Index atmosphere_dim,
const Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index sensor_checked,
const Index stokes_dim,
const Vector f_grid,
const Matrix sensor_pos,
const Matrix sensor_los,
const Matrix transmitter_pos,
const Vector mblock_za_grid,
const Vector mblock_aa_grid,
const Index antenna_dim,
const Sparse sensor_response,
const Vector sensor_response_f,
const ArrayOfIndex sensor_response_pol,
const Vector sensor_response_za,
const Vector sensor_response_aa,
const Agenda iy_main_agenda,
const Agenda jacobian_agenda,
const Index jacobian_do,
const ArrayOfString iy_aux_vars,
const ArrayOfRetrievalQuantity jacobian_quantities_copy,
const ArrayOfArrayOfIndex jacobian_indices_copy,
const Index append_instrument_wfs,
const Verbosity verbosity 
)

WORKSPACE METHOD: yCalcAppend.

Replaces yCalc if a measurement shall be appended to an existing one.

The method works basically as yCalc but appends the results to existing data, instead of creating completely new y and its associated variables. This method is required if your measurement consists of data from two instruments using different observation techniques (corresponding to different iyCalc-methods). One such example is if emission and transmission data are combined into a joint retrieval. The method can also be used to get around the constrain that sensor_response is required to be the same for all data.

The new measurement is simply appended to the input y, and the other output variables are treated correspondingly. Data are appended "blindly" in y_aux. That is, data of different type are appended if iy_aux_vars differs between the two measurements, the data are appended strictly following the order. First variable of second measurement is appended to first variable of first measurement, and so on. The number of auxiliary variables can differ between the measurements. Missing data are set to zero.

The set of retrieval quantities can differ between the two calculations. If an atmospheric quantity is part of both Jacobians, the same retrieval grids must be used in both cases. The treatment of instrument related Jacobians (baseline fits, pointing ...) follows the append_instrument_wfs argument.

A difference to yCalc is that jacobian_quantities and jacobian_indices* are both in- and output variables. The input version shall match the measurement to be calculated, while the version matches the output y, the combined, measurements. Copies of jacobian_quantities and * jacobian_indices* of the first measurement must be made and shall be provided to the method as jacobian_quantities_copy* and jacobian_indices_copy.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]yWS Output
[out]y_fWS Output
[out]y_polWS Output
[out]y_posWS Output
[out]y_losWS Output
[out]y_auxWS Output
[out]jacobianWS Output
[out]jacobian_quantitiesWS Output
[out]jacobian_indicesWS Output
[in]atmgeom_checkedWS Input
[in]atmfields_checkedWS Input
[in]atmosphere_dimWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]vmr_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]sensor_checkedWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]transmitter_posWS Input
[in]mblock_za_gridWS Input
[in]mblock_aa_gridWS Input
[in]antenna_dimWS Input
[in]sensor_responseWS Input
[in]sensor_response_fWS Input
[in]sensor_response_polWS Input
[in]sensor_response_zaWS Input
[in]sensor_response_aaWS Input
[in]iy_main_agendaWS Input
[in]jacobian_agendaWS Input
[in]jacobian_doWS Input
[in]iy_aux_varsWS Input
[in]jacobian_quantities_copyGeneric Input
[in]jacobian_indices_copyGeneric Input
[in]append_instrument_wfsGeneric Input (Default: "0")

Definition at line 1852 of file m_rte.cc.

References abs, ABSSPECIES_MAINTAG, joker, max, ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), q1, Vector::resize(), Matrix::resize(), TEMPERATURE_MAINTAG, WIND_MAINTAG, and yCalc().

Referenced by yCalcAppend_g().

Variable Documentation

◆ ABSSPECIES_MAINTAG

const String ABSSPECIES_MAINTAG
extern

Referenced by yCalcAppend().

◆ PI

const Numeric PI
extern

◆ SPEED_OF_LIGHT

const Numeric SPEED_OF_LIGHT
extern

◆ TEMPERATURE_MAINTAG

const String TEMPERATURE_MAINTAG
extern

Referenced by yCalcAppend().

◆ WIND_MAINTAG

const String WIND_MAINTAG
extern

Referenced by yCalcAppend().