ARTS 2.5.0 (git: 9ee3ac6c)
m_rte.cc File Reference

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

#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"
#include "transmissionmatrix.h"
#include <cmath>
#include <stdexcept>

Go to the source code of this file.

Functions

void iyApplyUnit (Matrix &iy, ArrayOfMatrix &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, ArrayOfMatrix &iy_aux, Ppath &ppath, const Index &atmfields_checked, const Index &atmgeom_checked, const ArrayOfString &iy_aux_vars, const Index &iy_id, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &scat_data_checked, const Vector &f_grid, const EnergyLevelMap &nlte_field, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda, const Verbosity &)
 WORKSPACE METHOD: iyCalc. More...
 
void iyEmissionStandard (Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &iy_id, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_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 Ppath &ppath, const Vector &rte_pos2, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const String &rt_integration_option, 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_transmittance, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Verbosity &verbosity)
 WORKSPACE METHOD: iyEmissionStandard. More...
 
void iyIndependentBeamApproximation (Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, GriddedField4 &atm_fields_compact, const Index &iy_id, const Vector &f_grid, 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 Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const EnergyLevelMap &nlte_field, 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 ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const Matrix &particle_masses, const Agenda &ppath_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &iy_agenda_call1, const String &iy_unit, const Tensor3 &iy_transmittance, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index &jacobian_do, const ArrayOfString &iy_aux_vars, const Agenda &iy_independent_beam_approx_agenda, const Index &return_atm1d, const Index &skip_vmr, const Index &skip_pnd, const Index &return_masses, const Verbosity &)
 WORKSPACE METHOD: iyIndependentBeamApproximation. More...
 
void iyLoopFrequencies (Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const ArrayOfString &iy_aux_vars, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index &stokes_dim, const Vector &f_grid, const Agenda &iy_loop_freqs_agenda, const Verbosity &)
 WORKSPACE METHOD: iyLoopFrequencies. More...
 
void iyMC (Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, 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 ArrayOfArrayOfSingleScatteringData &scat_data, const Agenda &iy_space_agenda, const Agenda &surface_rtprop_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, 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 Numeric &mc_taustep_limit, const Index &t_interp_order, const Verbosity &verbosity)
 WORKSPACE METHOD: iyMC. More...
 
void iyReplaceFromAux (Matrix &iy, const ArrayOfMatrix &iy_aux, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const String &aux_var, const Verbosity &)
 WORKSPACE METHOD: iyReplaceFromAux. More...
 
void ppvar_optical_depthFromPpvar_trans_cumulat (Matrix &ppvar_optical_depth, const Tensor4 &ppvar_trans_cumulat, const Verbosity &)
 WORKSPACE METHOD: ppvar_optical_depthFromPpvar_trans_cumulat. More...
 
void yCalc (Workspace &ws, Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, ArrayOfVector &y_aux, Matrix &y_geo, Matrix &jacobian, const Index &atmgeom_checked, const Index &atmfields_checked, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &scat_data_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 Matrix &mblock_dlos_grid, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Matrix &sensor_response_dlos, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &geo_pos_agenda, const Agenda &jacobian_agenda, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, 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 &y_geo, Matrix &jacobian, ArrayOfRetrievalQuantity &jacobian_quantities, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &scat_data_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 Matrix &mblock_dlos_grid, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Matrix &sensor_response_dlos, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &geo_pos_agenda, const Agenda &jacobian_agenda, const Index &jacobian_do, const ArrayOfString &iy_aux_vars, const ArrayOfRetrievalQuantity &jacobian_quantities_copy, 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 Index GFIELD4_FIELD_NAMES
 
const Index GFIELD4_P_GRID
 
const Index GFIELD4_LAT_GRID
 
const Index GFIELD4_LON_GRID
 

Detailed Description

Workspace methods 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

Definition in file m_rte.cc.

Function Documentation

◆ iyApplyUnit()

void iyApplyUnit ( Matrix iy,
ArrayOfMatrix 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 (for passive observations).

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. Also note that this method considers iy_unit, while iy_unit_radar is handled directly by the methods dealing with such simulations.

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

Definition at line 62 of file m_rte.cc.

References ARTS_USER_ERROR_IF, joker, and max.

Referenced by iyApplyUnit_g().

◆ iyCalc()

void iyCalc ( Workspace ws,
Matrix iy,
ArrayOfMatrix iy_aux,
Ppath ppath,
const Index atmgeom_checked,
const Index atmfields_checked,
const ArrayOfString iy_aux_vars,
const Index iy_id,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index scat_data_checked,
const Vector f_grid,
const EnergyLevelMap nlte_field,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const String iy_unit,
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]iy_idWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]scat_data_checkedWS Input
[in]f_gridWS Input
[in]nlte_fieldWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]iy_unitWS Input
[in]iy_main_agendaWS Input

Definition at line 94 of file m_rte.cc.

References ARTS_USER_ERROR_IF, nonstd::isnan(), iy_main_agendaExecute(), and ConstMatrixView::nrows().

Referenced by iyCalc_g().

◆ iyEmissionStandard()

void iyEmissionStandard ( Workspace ws,
Matrix iy,
ArrayOfMatrix iy_aux,
ArrayOfTensor3 diy_dx,
Vector ppvar_p,
Vector ppvar_t,
EnergyLevelMap ppvar_nlte,
Matrix ppvar_vmr,
Matrix ppvar_wind,
Matrix ppvar_mag,
Matrix ppvar_f,
Tensor3 ppvar_iy,
Tensor4 ppvar_trans_cumulat,
Tensor4 ppvar_trans_partial,
const Index iy_id,
const Index stokes_dim,
const Vector f_grid,
const Index atmosphere_dim,
const Vector p_grid,
const Tensor3 t_field,
const EnergyLevelMap nlte_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 Ppath ppath,
const Vector rte_pos2,
const Agenda propmat_clearsky_agenda,
const Agenda water_p_eq_agenda,
const String rt_integration_option,
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_transmittance,
const Numeric rte_alonglos_v,
const Tensor3 surface_props_data,
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). For details se the user guide.

The possible choices for iy_unit are <br> "1" : No conversion, i.e. [W/(m^2 Hz sr)] (radiance per <br> frequency unit). <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). Expressions applied and considerations for the unit conversion of radiances are discussed in Sec. 5.7 of the ARTS-2.0 article.

iy_unit* is only applied if iy_agenda_call1 is 1. This means that no unit ocnversion is applied for internal iterative calls.

Recognised choices for rt_integration_option are: <br> "first order": A first order integration is applied. <br> "second order": A second order integration is applied. <br> "default": Another way to select the first order option.

Some auxiliary radiative transfer quantities can be obtained. Auxiliary quantities are selected by iy_aux_vars and returned by iy_aux. Valid choices for auxiliary data are: <br> "Radiative background": Index value flagging the radiative <br> background. The following coding is used: 0=space, 1=surface <br> and 2=cloudbox. <br> "Optical depth": Scalar optical depth between the observation point <br> and the end of the present propagation path. Calculated based on <br> the (1,1)-element of the transmittance matrix (1-based indexing), <br> i.e. only fully valid for scalar RT. If nothing else is stated, only the first column of iy_aux is filled, i.e. the column matching Stokes element I, while remaing columns are are filled with zeros.

Author
Patrick Eriksson
Richard Larsson
Oliver Lemke
Parameters
[in,out]wsWorkspace
[out]iyWS Output
[out]iy_auxWS Output
[in,out]diy_dxWS Input/Output
[out]ppvar_pWS Output
[out]ppvar_tWS Output
[out]ppvar_nlteWS Output
[out]ppvar_vmrWS Output
[out]ppvar_windWS Output
[out]ppvar_magWS Output
[out]ppvar_fWS Output
[out]ppvar_iyWS Output
[out]ppvar_trans_cumulatWS Output
[out]ppvar_trans_partialWS Output
[in]iy_idWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]t_fieldWS Input
[in]nlte_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]ppathWS Input
[in]rte_pos2WS Input
[in]propmat_clearsky_agendaWS Input
[in]water_p_eq_agendaWS Input
[in]rt_integration_optionWS 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_transmittanceWS Input
[in]rte_alonglos_vWS Input
[in]surface_props_dataWS Input

Definition at line 160 of file m_rte.cc.

References a, adapt_stepwise_partial_derivatives(), ARTS_USER_ERROR, ARTS_USER_ERROR_IF, do_temperature_jacobian(), FOR_ANALYTICAL_JACOBIANS_DO, get_pointers_for_analytical_species(), get_ppath_atmvars(), get_ppath_f(), get_standard_diy_dpath(), get_standard_starting_diy_dx(), get_stepwise_blackbody_radiation(), get_stepwise_clearsky_propmat(), joker, Ppath::los, min, Array< base >::nelem(), ConstVectorView::nelem(), Ppath::np, ns, ppath_what_background(), Tensor4::resize(), Vector::resize(), Tensor3::resize(), Matrix::resize(), stepwise_source(), and Jacobian::Temperature.

Referenced by ARTS::Agenda::iy_main_agenda_emission(), iyEmissionStandard_g(), iyHybrid(), spectral_radiance_fieldClearskyPlaneParallel(), and spectral_radiance_fieldExpandCloudboxField().

◆ iyIndependentBeamApproximation()

void iyIndependentBeamApproximation ( Workspace ws,
Matrix iy,
ArrayOfMatrix iy_aux,
Ppath ppath,
ArrayOfTensor3 diy_dx,
GriddedField4 atm_fields_compact,
const Index iy_id,
const Vector f_grid,
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 Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const EnergyLevelMap nlte_field,
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 ArrayOfIndex cloudbox_limits,
const Tensor4 pnd_field,
const Matrix particle_masses,
const Agenda ppath_agenda,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Index iy_agenda_call1,
const String iy_unit,
const Tensor3 iy_transmittance,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Index jacobian_do,
const ArrayOfString iy_aux_vars,
const Agenda iy_independent_beam_approx_agenda,
const Index return_atm1d,
const Index skip_vmr,
const Index skip_pnd,
const Index return_masses,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyIndependentBeamApproximation.

Samples atmosphere along ppath and make 1D-type RT calculation.

The main application of this method should be to apply 1D scattering solvers on 2D or 3D atmospheres. The 1D calculation is set up inside iy_independent_beam_approx_agenda.

The method calculates the ppath until reaching the surface or the top-of-the atmosphere. If the sensor is inside the atmosphere the ppath is extended from the sensor vertically to cover the remaining part of the atmosphere. All atmospheric fields are interpolated to the obtain ppath, to form a 1D view of the atmosphere. This 1D atmosphere forms the input to iy_independent_beam_approx_agenda

lat_true* and lon_true for the 1D view is set to the intersection with the surface of the ppath described above.

The function accepts that the input atmosphere is 1D, as well as that there is no active cloudbox.

The constructed 1D atmosphere is exported if the GIN return_atm1d is set to 1. The default then is to include all atmospheric fields, but vmr_field and pnd_field can be deselected by two of the GIN-s. The order of the fields is specified by the first grid in the structure member grids. If atm_fields_compact is denoted as A, then A.grids{0}{i} gives the name of field with index i. Each book in vmr_field and pnd_field is stored separately. For example, the first book in pnd_field is stored with the name "Scattering element 0".

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]iyWS Output
[out]iy_auxWS Output
[out]ppathWS Output
[in,out]diy_dxWS Input/Output
[out]atm_fields_compactWS Output
[in]iy_idWS Input
[in]f_gridWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]lat_trueWS Input
[in]lon_trueWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]vmr_fieldWS Input
[in]nlte_fieldWS 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]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]particle_massesWS Input
[in]ppath_agendaWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input
[in]iy_agenda_call1WS Input
[in]iy_unitWS Input
[in]iy_transmittanceWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]jacobian_doWS Input
[in]iy_aux_varsWS Input
[in]iy_independent_beam_approx_agendaWS Input
[in]return_atm1dGeneric Input (Default: "0")
[in]skip_vmrGeneric Input (Default: "0")
[in]skip_pndGeneric Input (Default: "0")
[in]return_massesGeneric Input (Default: "0")

Definition at line 613 of file m_rte.cc.

References abs, ARTS_USER_ERROR_IF, chk_latlon_true(), EnergyLevelMap::Data(), GriddedField4::data, ConstTensor3View::empty(), ConstTensor4View::empty(), Ppath::end_lstep, error_if_limb_ppath(), GFIELD4_FIELD_NAMES, GFIELD4_LAT_GRID, GFIELD4_LON_GRID, GFIELD4_P_GRID, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, interp(), interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interp_cloudfield_gp2itw(), is_gp_inside_cloudbox(), itw2p(), iy_independent_beam_approx_agendaExecute(), joker, ConstTensor4View::nbooks(), ConstMatrixView::ncols(), ConstVectorView::nelem(), Ppath::np, ConstTensor4View::npages(), ConstMatrixView::nrows(), Ppath::pos, pow(), ppath_agendaExecute(), GriddedField4::resize(), Tensor4::resize(), Matrix::resize(), GriddedField::set_grid(), GriddedField::set_grid_name(), and GriddedField::set_name().

Referenced by iyIndependentBeamApproximation_g().

◆ iyLoopFrequencies()

void iyLoopFrequencies ( Workspace ws,
Matrix iy,
ArrayOfMatrix iy_aux,
Ppath ppath,
ArrayOfTensor3 diy_dx,
const ArrayOfString iy_aux_vars,
const Index iy_agenda_call1,
const Tensor3 iy_transmittance,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Index stokes_dim,
const Vector f_grid,
const Agenda iy_loop_freqs_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_loop_freqs_agenda* for each individual value. This method is placed in iy_main_agenda, and the actual radiative transfer <br> method is put in iy_loop_freqs_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.

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]iy_agenda_call1WS Input
[in]iy_transmittanceWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]iy_loop_freqs_agendaWS Input

Definition at line 1046 of file m_rte.cc.

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

Referenced by iyLoopFrequencies_g().

◆ iyMC()

void iyMC ( Workspace ws,
Matrix iy,
ArrayOfMatrix iy_aux,
ArrayOfTensor3 diy_dx,
const Index iy_agenda_call1,
const Tensor3 iy_transmittance,
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 ArrayOfArrayOfSingleScatteringData scat_data,
const Agenda iy_space_agenda,
const Agenda surface_rtprop_agenda,
const Agenda propmat_clearsky_agenda,
const Agenda ppath_step_agenda,
const Numeric ppath_lmax,
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 Numeric mc_taustep_limit,
const Index t_interp_order,
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, mc_max_iter mc_taustep_limit) as for MCGeneral. The arguments are applied for each monochromatic pencil beam calculation individually. As for 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_transmittanceWS 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_dataWS Input
[in]iy_space_agendaWS Input
[in]surface_rtprop_agendaWS Input
[in]propmat_clearsky_agendaWS Input
[in]ppath_step_agendaWS Input
[in]ppath_lmaxWS 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
[in]mc_taustep_limitWS Input
[in]t_interp_orderGeneric Input (Default: "1")

Definition at line 1117 of file m_rte.cc.

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

Referenced by iyMC_g().

◆ iyReplaceFromAux()

void iyReplaceFromAux ( Matrix iy,
const ArrayOfMatrix 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
[in,out]iyWS Input/Output
[in]iy_auxWS Input
[in]iy_aux_varsWS Input
[in]jacobian_doWS Input
[in]aux_varGeneric Input

Definition at line 1307 of file m_rte.cc.

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

Referenced by iyReplaceFromAux_g().

◆ ppvar_optical_depthFromPpvar_trans_cumulat()

void ppvar_optical_depthFromPpvar_trans_cumulat ( Matrix ppvar_optical_depth,
const Tensor4 ppvar_trans_cumulat,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppvar_optical_depthFromPpvar_trans_cumulat.

Sets ppvar_optical_depth according to provided transmittance data.

The values in ppvar_optical_depth are set to -log( ppvar_trans_cumulat(joker,joker,0,0) ).

Author
Patrick Eriksson
Parameters
[out]ppvar_optical_depthWS Output
[in]ppvar_trans_cumulatWS Input

Definition at line 1336 of file m_rte.cc.

References joker, and transform().

Referenced by ppvar_optical_depthFromPpvar_trans_cumulat_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
[in,out]yWS Input/Output
[in,out]jacobianWS Input/Output
[in]y_fWS Input
[in]y_polWS Input
[in]iy_unitWS Input

Definition at line 1916 of file m_rte.cc.

References ARTS_USER_ERROR_IF, and max.

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 y_geo,
Matrix jacobian,
const Index atmgeom_checked,
const Index atmfields_checked,
const Index atmosphere_dim,
const EnergyLevelMap nlte_field,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index scat_data_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 Matrix mblock_dlos_grid,
const Sparse sensor_response,
const Vector sensor_response_f,
const ArrayOfIndex sensor_response_pol,
const Matrix sensor_response_dlos,
const String iy_unit,
const Agenda iy_main_agenda,
const Agenda geo_pos_agenda,
const Agenda jacobian_agenda,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
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.

The content of y_aux follows iy_aux_vars. See the method selected for *iy_main_agenda for allowed choices.

The geo-positions (y_geo) are set based on sensor_response. When an antenna pattern is considered, there are several pencil beams, and thus also several goe-positions, associated with each value of y. The geo-position assigned to a value in y is the geo_pos of the pencil beam related to the highest value in sensor_response. This means that mblock_dlos_grid* must contain the bore-sight direction (0,0), if you want y_geo to exactly match the bore-sight direction.

The Jacobian provided (jacobian) is adopted to selected retrieval units, but no transformations are applied. Transformations are included by calling jacobianAdjustAndTransform.

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]y_geoWS Output
[out]jacobianWS Output
[in]atmgeom_checkedWS Input
[in]atmfields_checkedWS Input
[in]atmosphere_dimWS Input
[in]nlte_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]scat_data_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_dlos_gridWS Input
[in]sensor_responseWS Input
[in]sensor_response_fWS Input
[in]sensor_response_polWS Input
[in]sensor_response_dlosWS Input
[in]iy_unitWS Input
[in]iy_main_agendaWS Input
[in]geo_pos_agendaWS Input
[in]jacobian_agendaWS Input
[in]jacobian_doWS Input
[in]jacobian_quantitiesWS Input
[in]iy_aux_varsWS Input

Definition at line 1346 of file m_rte.cc.

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

Referenced by yCalc_g(), and yCalcAppend().

◆ yCalcAppend()

void yCalcAppend ( Workspace ws,
Vector y,
Vector y_f,
ArrayOfIndex y_pol,
Matrix y_pos,
Matrix y_los,
ArrayOfVector y_aux,
Matrix y_geo,
Matrix jacobian,
ArrayOfRetrievalQuantity jacobian_quantities,
const Index atmgeom_checked,
const Index atmfields_checked,
const Index atmosphere_dim,
const EnergyLevelMap nlte_field,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index scat_data_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 Matrix mblock_dlos_grid,
const Sparse sensor_response,
const Vector sensor_response_f,
const ArrayOfIndex sensor_response_pol,
const Matrix sensor_response_dlos,
const String iy_unit,
const Agenda iy_main_agenda,
const Agenda geo_pos_agenda,
const Agenda jacobian_agenda,
const Index jacobian_do,
const ArrayOfString iy_aux_vars,
const ArrayOfRetrievalQuantity jacobian_quantities_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 transmittance 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 is both in- and output variable. The input version shall match the measurement to be calculated, while the output version matches the output y, the combined, measurements. A copies of jacobian_quantities of the first measurement must be made and shall be provided to the method as jacobian_quantities_copy.

As for yCalc Jacobian transformations are not handled, and the the input Jacobian shall not contain transformations. That is jacobianAdjustAndTransform* shall be called after this method, when the complete Jacobian is at hand.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[in,out]yWS Input/Output
[in,out]y_fWS Input/Output
[in,out]y_polWS Input/Output
[in,out]y_posWS Input/Output
[in,out]y_losWS Input/Output
[in,out]y_auxWS Input/Output
[in,out]y_geoWS Input/Output
[in,out]jacobianWS Input/Output
[in,out]jacobian_quantitiesWS Input/Output
[in]atmgeom_checkedWS Input
[in]atmfields_checkedWS Input
[in]atmosphere_dimWS Input
[in]nlte_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]scat_data_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_dlos_gridWS Input
[in]sensor_responseWS Input
[in]sensor_response_fWS Input
[in]sensor_response_polWS Input
[in]sensor_response_dlosWS Input
[in]iy_unitWS Input
[in]iy_main_agendaWS Input
[in]geo_pos_agendaWS Input
[in]jacobian_agendaWS Input
[in]jacobian_doWS Input
[in]iy_aux_varsWS Input
[in]jacobian_quantities_copyGeneric Input
[in]append_instrument_wfsGeneric Input (Default: "0")

Definition at line 1596 of file m_rte.cc.

References a, ARTS_USER_ERROR, ARTS_USER_ERROR_IF, ConstVectorView::empty(), jac_ranges_indices(), joker, max, ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Absorption::nelem(), ConstMatrixView::nrows(), q1, Vector::resize(), Matrix::resize(), Jacobian::Temperature, and yCalc().

Referenced by yCalcAppend_g().

Variable Documentation

◆ GFIELD4_FIELD_NAMES

const Index GFIELD4_FIELD_NAMES
extern

◆ GFIELD4_LAT_GRID

const Index GFIELD4_LAT_GRID
extern

◆ GFIELD4_LON_GRID

const Index GFIELD4_LON_GRID
extern

◆ GFIELD4_P_GRID

const Index GFIELD4_P_GRID
extern

◆ PI

const Numeric PI
extern

◆ SPEED_OF_LIGHT

const Numeric SPEED_OF_LIGHT
extern