ARTS
2.2.66
|
Functions to solve radiative transfer tasks. More...
#include <cmath>
#include <stdexcept>
#include "auto_md.h"
#include "check_input.h"
#include "geodetic.h"
#include "logic.h"
#include "math_funcs.h"
#include "montecarlo.h"
#include "physics_funcs.h"
#include "ppath.h"
#include "rte.h"
#include "special_interp.h"
#include "lin_alg.h"
Go to the source code of this file.
Functions | |
void | adjust_los (VectorView los, const Index &atmosphere_dim) |
adjust_los More... | |
void | apply_iy_unit (MatrixView iy, const String &y_unit, ConstVectorView f_grid, const Numeric &n, const ArrayOfIndex &i_pol) |
apply_iy_unit More... | |
void | apply_iy_unit2 (Tensor3View J, ConstMatrixView iy, const String &y_unit, ConstVectorView f_grid, const Numeric &n, const ArrayOfIndex &i_pol) |
apply_iy_unit2 More... | |
void | bending_angle1d (Numeric &alpha, const Ppath &ppath) |
bending_angle1d More... | |
void | defocusing_general_sub (Workspace &ws, Vector &pos, Vector &rte_los, Index &background, ConstVectorView rte_pos, const Numeric &lo0, const Agenda &ppath_step_agenda, const Numeric &ppath_lraytrace, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Verbosity &verbosity) |
defocusing_general_sub More... | |
void | defocusing_general (Workspace &ws, Numeric &dlf, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Ppath &ppath, const Numeric &ppath_lraytrace, const Numeric &dza, const Verbosity &verbosity) |
defocusing_general More... | |
void | defocusing_sat2sat (Workspace &ws, Numeric &dlf, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Ppath &ppath, const Numeric &ppath_lraytrace, const Numeric &dza, const Verbosity &verbosity) |
defocusing_sat2sat More... | |
Numeric | dotprod_with_los (ConstVectorView los, const Numeric &u, const Numeric &v, const Numeric &w, const Index &atmosphere_dim) |
dotprod_with_los More... | |
void | emission_rtstep (Matrix &iy, const Index &stokes_dim, ConstVectorView bbar, ArrayOfIndex &extmat_case, ConstTensor3View t) |
emission_rtstep More... | |
void | ext2trans (MatrixView trans_mat, Index &icase, ConstMatrixView ext_mat, const Numeric &lstep) |
void | get_iy (Workspace &ws, Matrix &iy, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, const Index &cloudbox_on, ConstVectorView f_grid, ConstVectorView rte_pos, ConstVectorView rte_los, ConstVectorView rte_pos2, const Agenda &iy_main_agenda) |
get_iy More... | |
void | get_iy_of_background (Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, ConstTensor3View iy_transmission, const Index &jacobian_do, const Ppath &ppath, ConstVectorView rte_pos2, const Index &atmosphere_dim, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, const Index &cloudbox_on, const Index &stokes_dim, ConstVectorView f_grid, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Verbosity &verbosity) |
get_iy_of_background More... | |
void | get_ppath_atmvars (Vector &ppath_p, Vector &ppath_t, Matrix &ppath_vmr, Matrix &ppath_wind, Matrix &ppath_mag, const Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstTensor3View wind_u_field, ConstTensor3View wind_v_field, ConstTensor3View wind_w_field, ConstTensor3View mag_u_field, ConstTensor3View mag_v_field, ConstTensor3View mag_w_field) |
get_ppath_atmvars More... | |
void | get_ppath_abs (Workspace &ws, Tensor4 &ppath_abs, Tensor5 &abs_per_species, const Agenda &propmat_clearsky_agenda, const Ppath &ppath, ConstVectorView ppath_p, ConstVectorView ppath_t, ConstMatrixView ppath_vmr, ConstMatrixView ppath_f, ConstMatrixView ppath_mag, ConstVectorView f_grid, const Index &stokes_dim, const ArrayOfIndex &ispecies) |
get_ppath_abs More... | |
void | get_ppath_blackrad (Workspace &ws, Matrix &ppath_blackrad, const Agenda &blackbody_radiation_agenda, const Ppath &ppath, ConstVectorView ppath_t, ConstMatrixView ppath_f) |
get_ppath_blackrad More... | |
void | get_ppath_ext (ArrayOfIndex &clear2cloudbox, Tensor3 &pnd_abs_vec, Tensor4 &pnd_ext_mat, Array< ArrayOfSingleScatteringData > &scat_data, Matrix &ppath_pnd, const Ppath &ppath, ConstVectorView ppath_t, const Index &stokes_dim, ConstMatrixView ppath_f, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const Index &use_mean_scat_data, const ArrayOfSingleScatteringData &scat_data_array, const Verbosity &verbosity) |
get_ppath_ext More... | |
void | get_ppath_f (Matrix &ppath_f, const Ppath &ppath, ConstVectorView f_grid, const Index &atmosphere_dim, const Numeric &rte_alonglos_v, ConstMatrixView ppath_wind) |
get_ppath_f More... | |
void | get_ppath_trans (Tensor4 &trans_partial, ArrayOfArrayOfIndex &extmat_case, Tensor4 &trans_cumulat, Vector &scalar_tau, const Ppath &ppath, ConstTensor4View &ppath_abs, ConstVectorView f_grid, const Index &stokes_dim) |
get_ppath_trans More... | |
void | get_ppath_trans2 (Tensor4 &trans_partial, ArrayOfArrayOfIndex &extmat_case, Tensor4 &trans_cumulat, Vector &scalar_tau, const Ppath &ppath, ConstTensor4View &ppath_abs, ConstVectorView f_grid, const Index &stokes_dim, const ArrayOfIndex &clear2cloudbox, ConstTensor4View pnd_ext_mat) |
get_ppath_trans2 More... | |
Range | get_rowindex_for_mblock (const Sparse &sensor_response, const Index &mblock_index) |
get_rowindex_for_mblock More... | |
void | iyb_calc_za_loop_body (bool &failed, String &fail_msg, ArrayOfArrayOfTensor4 &iy_aux_array, Workspace &ws, Vector &iyb, ArrayOfMatrix &diyb_dx, const Index &mblock_index, const Index &atmosphere_dim, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, const Index &cloudbox_on, const Index &stokes_dim, ConstVectorView f_grid, ConstMatrixView sensor_pos, ConstMatrixView sensor_los, ConstMatrixView transmitter_pos, ConstVectorView mblock_za_grid, ConstVectorView mblock_aa_grid, const Index &antenna_dim, const Agenda &iy_main_agenda, const Index &j_analytical_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Index &naa, const Index &iza, const Index &nf) |
void | iyb_calc (Workspace &ws, Vector &iyb, ArrayOfVector &iyb_aux, ArrayOfMatrix &diyb_dx, const Index &mblock_index, const Index &atmosphere_dim, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, const Index &cloudbox_on, const Index &stokes_dim, ConstVectorView f_grid, ConstMatrixView sensor_pos, ConstMatrixView sensor_los, ConstMatrixView transmitter_pos, ConstVectorView mblock_za_grid, ConstVectorView mblock_aa_grid, const Index &antenna_dim, const Agenda &iy_main_agenda, const Index &j_analytical_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Verbosity &verbosity) |
iyb_calc More... | |
void | iy_transmission_mult (Tensor3 &iy_trans_total, ConstTensor3View iy_trans_old, ConstTensor3View iy_trans_new) |
iy_transmission_mult More... | |
void | los3d (Vector &los3d, ConstVectorView los, const Index &atmosphere_dim) |
iy_transmission_mult_scalar_tau los3d More... | |
void | mirror_los (Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim) |
mirror_los More... | |
void | pos2true_latlon (Numeric &lat, Numeric &lon, const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true, ConstVectorView pos) |
pos2true_latlon More... | |
void | surface_calc (Matrix &iy, ConstTensor3View I, ConstMatrixView surface_los, ConstTensor4View surface_rmatrix, ConstMatrixView surface_emission) |
surface_calc More... | |
void | vectorfield2los (Numeric &l, Vector &los, const Numeric &u, const Numeric &v, const Numeric &w) |
vectorfield2los More... | |
Variables | |
const Numeric | SPEED_OF_LIGHT |
void adjust_los | ( | VectorView | los, |
const Index & | atmosphere_dim | ||
) |
adjust_los
Ensures that the zenith and azimuth angles of a line-of-sight vector are inside defined ranges.
This function should not be used blindly, just when you know that the out-of-bounds values are obtained by an OK operation. As when making a disturbance calculation where e.g. the zenith angle is shifted with a small value. This function then handles the case when the original zenith angle is 0 or 180 and the disturbance then moves the angle outside the defined range.
los | In/Out: LOS vector, defined as e.g. rte_los. |
atmosphere_dim | As the WSV. |
Definition at line 81 of file rte.cc.
References abs, cart2zaaa(), dx, and zaaa2cart().
Referenced by defocusing_general_sub(), defocusing_sat2sat(), iyb_calc_za_loop_body(), and raytrace_3d_linear_basic().
void apply_iy_unit | ( | MatrixView | iy, |
const String & | y_unit, | ||
ConstVectorView | f_grid, | ||
const Numeric & | n, | ||
const ArrayOfIndex & | i_pol | ||
) |
apply_iy_unit
Performs conversion from radiance to other units, as well as applies refractive index to fulfill the n2-law of radiance.
Use apply_iy_unit2 for conversion of jacobian data.
iy | In/Out: Tensor3 with data to be converted, where column dimension corresponds to Stokes dimensionality and row dimension corresponds to frequency. |
y_unit | As the WSV. |
f_grid | As the WSV. |
n | Refractive index at the observation position. |
i_pol | Polarisation indexes. See documentation of y_pol. |
Definition at line 127 of file rte.cc.
References invplanck(), invrayjean(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), ns, and SPEED_OF_LIGHT.
Referenced by fos(), iyApplyUnit(), iyEmissionStandard(), and yApplyUnit().
void apply_iy_unit2 | ( | Tensor3View | J, |
ConstMatrixView | iy, | ||
const String & | y_unit, | ||
ConstVectorView | f_grid, | ||
const Numeric & | n, | ||
const ArrayOfIndex & | i_pol | ||
) |
apply_iy_unit2
Largely as apply_iy_unit but operates on jacobian data.
The associated spectrum data iy must be in radiance. That is, the spectrum can only be converted to Tb after the jacobian data.
J | In/Out: Tensor3 with data to be converted, where column dimension corresponds to Stokes dimensionality and row dimension corresponds to frequency. |
iy | Associated radiance data. |
y_unit | As the WSV. |
f_grid | As the WSV. |
n | Refractive index at the observation position. |
i_pol | Polarisation indexes. See documentation of y_pol. |
Definition at line 232 of file rte.cc.
References dinvplanckdI(), invrayjean(), ConstMatrixView::ncols(), ConstTensor3View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstMatrixView::nrows(), ConstTensor3View::nrows(), ns, and SPEED_OF_LIGHT.
Referenced by iyEmissionStandard(), and yApplyUnit().
bending_angle1d
Calculates the bending angle for a 1D atmosphere.
The expression used assumes a 1D atmosphere, that allows the bending angle to be calculated by start and end LOS. This is an approximation for 2D and 3D, but a very small one and the function should in general be OK also for 2D and 3D.
The expression is taken from Kursinski et al., The GPS radio occultation technique, TAO, 2000.
ppath | Propagation path. |
Definition at line 353 of file rte.cc.
References abs, Ppath::dim, Ppath::end_los, Ppath::end_pos, sphdist(), Ppath::start_los, and Ppath::start_pos.
Referenced by defocusing_sat2sat(), and iyRadioLink().
void defocusing_general | ( | Workspace & | ws, |
Numeric & | dlf, | ||
const Agenda & | ppath_step_agenda, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface, | ||
const Ppath & | ppath, | ||
const Numeric & | ppath_lraytrace, | ||
const Numeric & | dza, | ||
const Verbosity & | verbosity | ||
) |
defocusing_general
Defocusing for arbitrary geometry (zenith angle part only)
Estimates the defocusing loss factor by calculating two paths with zenith angle off-sets. The distance between the two path at the optical path length between the transmitter and the receiver, divided with the corresponding distance for free space propagation, gives the defocusing loss.
The azimuth (gain) factor is not calculated. The path calculations are here done starting from the transmitter, which is the reversed direction compared to the ordinary path calculations starting at the receiver.
ppath_step_agenda | As the WSV with the same name. |
atmosphere_dim | As the WSV with the same name. |
p_grid | As the WSV with the same name. |
lat_grid | As the WSV with the same name. |
lon_grid | As the WSV with the same name. |
t_field | As the WSV with the same name. |
z_field | As the WSV with the same name. |
vmr_field | As the WSV with the same name. |
f_grid | As the WSV with the same name. |
refellipsoid | As the WSV with the same name. |
z_surface | As the WSV with the same name. |
ppath | As the WSV with the same name. |
ppath_lraytrace | As the WSV with the same name. |
dza | Size of angular shift to apply. |
verbosity | As the WSV with the same name. |
Definition at line 530 of file rte.cc.
References defocusing_general_sub(), DEG2RAD, distance2D(), distance3D(), Ppath::end_lstep, Ppath::end_pos, Ppath::lstep, max, mirror_los(), Ppath::np, Ppath::nreal, refell2r(), Ppath::start_los, Ppath::start_lstep, and Ppath::start_pos.
Referenced by iyRadioLink().
void defocusing_general_sub | ( | Workspace & | ws, |
Vector & | pos, | ||
Vector & | rte_los, | ||
Index & | background, | ||
ConstVectorView | rte_pos, | ||
const Numeric & | lo0, | ||
const Agenda & | ppath_step_agenda, | ||
const Numeric & | ppath_lraytrace, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface, | ||
const Verbosity & | verbosity | ||
) |
defocusing_general_sub
Just to avoid duplicatuion of code in defocusing_general.
rte_los is mainly an input, but is also returned "adjusted" (with zenith and azimuth angles inside defined ranges)
pos | Out: Position of ppath at optical distance lo0 |
rte_los | In/out: Direction for transmitted signal (disturbed from nominal value) |
rte_pos | Out: Position of transmitter. |
background | Out: Raditaive background of ppath. |
lo0 | Optical path length between transmitter and receiver. |
ppath_step_agenda | As the WSV with the same name. |
atmosphere_dim | As the WSV with the same name. |
p_grid | As the WSV with the same name. |
lat_grid | As the WSV with the same name. |
lon_grid | As the WSV with the same name. |
t_field | As the WSV with the same name. |
z_field | As the WSV with the same name. |
vmr_field | As the WSV with the same name. |
f_grid | As the WSV with the same name. |
refellipsoid | As the WSV with the same name. |
z_surface | As the WSV with the same name. |
verbosity | As the WSV with the same name. |
Definition at line 404 of file rte.cc.
References adjust_los(), cart2pol(), cart2sph(), dx, Ppath::end_lstep, gridpos(), interp(), interpweights(), joker, Ppath::los, Ppath::lstep, max, Ppath::np, Ppath::nreal, Ppath::pos, poslos2cart(), ppath_calc(), ppath_what_background(), Ppath::r, and Vector::resize().
Referenced by defocusing_general().
void defocusing_sat2sat | ( | Workspace & | ws, |
Numeric & | dlf, | ||
const Agenda & | ppath_step_agenda, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface, | ||
const Ppath & | ppath, | ||
const Numeric & | ppath_lraytrace, | ||
const Numeric & | dza, | ||
const Verbosity & | verbosity | ||
) |
defocusing_sat2sat
Calculates defocusing for limb measurements between two satellites.
The expressions used assume a 1D atmosphere, and can only be applied on limb sounding geometry. The function works for 2D and 3D and should give OK estimates. Both the zenith angle (loss) and azimuth angle (gain) terms are considered.
The expressions is taken from Kursinski et al., The GPS radio occultation technique, TAO, 2000.
ppath_step_agenda | As the WSV with the same name. |
atmosphere_dim | As the WSV with the same name. |
p_grid | As the WSV with the same name. |
lat_grid | As the WSV with the same name. |
lon_grid | As the WSV with the same name. |
t_field | As the WSV with the same name. |
z_field | As the WSV with the same name. |
vmr_field | As the WSV with the same name. |
f_grid | As the WSV with the same name. |
refellipsoid | As the WSV with the same name. |
z_surface | As the WSV with the same name. |
ppath | As the WSV with the same name. |
ppath_lraytrace | As the WSV with the same name. |
dza | Size of angular shift to apply. |
verbosity | As the WSV with the same name. |
Definition at line 663 of file rte.cc.
References adjust_los(), bending_angle1d(), Ppath::constant, DEG2RAD, Ppath::end_los, Ppath::end_lstep, Ppath::end_pos, find_tanpoint(), Ppath::lstep, Ppath::np, ppath_calc(), ppath_what_background(), Ppath::start_los, and Ppath::start_lstep.
Referenced by iyRadioLink().
Numeric dotprod_with_los | ( | ConstVectorView | los, |
const Numeric & | u, | ||
const Numeric & | v, | ||
const Numeric & | w, | ||
const Index & | atmosphere_dim | ||
) |
dotprod_with_los
Calculates the dot product between a field and a LOS
The line-of-sight shall be given as in the ppath structure (i.e. the viewing direction), but the dot product is calculated for the photon direction. The field is specified by its three components.
The returned value can be written as |f|*cos(theta), where |f| is the field strength, and theta the angle between the field and photon vectors.
los | Pppath line-of-sight. |
u | U-component of field. |
v | V-component of field. |
w | W-component of field. |
atmosphere_dim | As the WSV. |
Definition at line 776 of file rte.cc.
References DEG2RAD, mirror_los(), and w().
Referenced by get_ppath_f(), and propmat_clearskyAddFaraday().
void emission_rtstep | ( | Matrix & | iy, |
const Index & | stokes_dim, | ||
ConstVectorView | bbar, | ||
ArrayOfIndex & | extmat_case, | ||
ConstTensor3View | t | ||
) |
emission_rtstep
Radiative transfer over a step, with emission.
In scalar notation, this is done: iy = iy*t + bbar*(1-t)
The calculations are done differently for extmat_case 1 and 2/3.
Frequency is throughout leftmost dimension.
iy | In/out: Radiance values |
stokes_dim | In: As the WSV. |
bbar | In: Average of emission source function |
extmat_case | In: As returned by get_ppath_trans, but just for the frequency of cocncern. |
t | In: Transmission matrix of the step. |
Definition at line 822 of file rte.cc.
References joker, mult(), ConstTensor3View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor3View::npages(), and ConstTensor3View::nrows().
Referenced by fos(), and iyEmissionStandard().
void ext2trans | ( | MatrixView | trans_mat, |
Index & | icase, | ||
ConstMatrixView | ext_mat, | ||
const Numeric & | lstep | ||
) |
Converts an extinction matrix to a transmission matrix
The function performs the calculations differently depending on the conditions, to improve the speed. There are three cases:
If the structure of ext_mat is known, icase can be set to "case index" (1, 2 or 3) and some time is saved. This includes that no asserts are performed on ext_mat.
Otherwise, icase must be set to 0. ext_mat is then analysed and icase is set by the function and is returned.
trans_mat must be sized before calling the function.
trans_mat | Input/Output: Transmission matrix of slab. |
icase | Input/Output: Index giving ext_mat case. |
ext_mat | Input: Averaged extinction matrix. |
lstep | Input: The length of the RTE step. |
Definition at line 903 of file rte.cc.
References is_singular(), matrix_exp(), ConstMatrixView::ncols(), ConstMatrixView::nrows(), and q.
Referenced by fos(), get_ppath_trans(), get_ppath_trans2(), iyEmissionStandard(), iyTransmissionStandard(), main(), mcPathTraceGeneral(), and rte_step_doit().
void get_iy | ( | Workspace & | ws, |
Matrix & | iy, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
const Index & | cloudbox_on, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | rte_pos, | ||
ConstVectorView | rte_los, | ||
ConstVectorView | rte_pos2, | ||
const Agenda & | iy_main_agenda | ||
) |
get_iy
Basic call of iy_main_agenda.
This function is an interface to iy_main_agenda that can be used when only iy is of interest. That is, jacobian and auxilary parts are deactivated/ignored.
ws | Out: The workspace |
iy | Out: As the WSV. |
t_field | As the WSV. |
z_field | As the WSV. |
vmr_field | As the WSV. |
cloudbox_on | As the WSV. |
rte_pos | As the WSV. |
rte_los | As the WSV. |
iy_main_agenda | As the WSV. |
Definition at line 1046 of file rte.cc.
References iy_main_agendaExecute().
Referenced by CloudboxGetIncoming(), CloudboxGetIncoming1DAtm(), and CloudboxGetIncoming2().
void get_iy_of_background | ( | Workspace & | ws, |
Matrix & | iy, | ||
ArrayOfTensor3 & | diy_dx, | ||
ConstTensor3View | iy_transmission, | ||
const Index & | jacobian_do, | ||
const Ppath & | ppath, | ||
ConstVectorView | rte_pos2, | ||
const Index & | atmosphere_dim, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
const Index & | cloudbox_on, | ||
const Index & | stokes_dim, | ||
ConstVectorView | f_grid, | ||
const Agenda & | iy_main_agenda, | ||
const Agenda & | iy_space_agenda, | ||
const Agenda & | iy_surface_agenda, | ||
const Agenda & | iy_cloudbox_agenda, | ||
const Verbosity & | verbosity | ||
) |
get_iy_of_background
Determines iy of the "background" of a propgation path.
The task is to determine iy and related variables for the background, or to continue the raditiave calculations "backwards". The details here depends on the method selected for the agendas.
Each background is handled by an agenda. Several of these agandes can involve recursive calls of iy_main_agenda.
ws | Out: The workspace |
iy | Out: As the WSV. |
diy_dx | Out: As the WSV. |
iy_transmission | As the WSV. |
jacobian_do | As the WSV. |
ppath | As the WSV. |
atmosphere_dim | As the WSV. |
t_field | As the WSV. |
z_field | As the WSV. |
vmr_field | As the WSV. |
cloudbox_on | As the WSV. |
stokes_dim | As the WSV. |
f_grid | As the WSV. |
iy_main_agenda | As the WSV. |
iy_space_agenda | As the WSV. |
iy_surface_agenda | As the WSV. |
iy_cloudbox_agenda | As the WSV. |
Definition at line 1106 of file rte.cc.
References Ppath::background, chk_not_empty(), CREATE_OUT3, iy_cloudbox_agendaExecute(), iy_space_agendaExecute(), iy_surface_agendaExecute(), joker, Ppath::los, ConstMatrixView::ncols(), ConstVectorView::nelem(), Ppath::np, ConstMatrixView::nrows(), Ppath::pos, ppath_what_background(), and Vector::resize().
Referenced by fos(), and iyEmissionStandard().
void get_ppath_abs | ( | Workspace & | ws, |
Tensor4 & | ppath_abs, | ||
Tensor5 & | abs_per_species, | ||
const Agenda & | propmat_clearsky_agenda, | ||
const Ppath & | ppath, | ||
ConstVectorView | ppath_p, | ||
ConstVectorView | ppath_t, | ||
ConstMatrixView | ppath_vmr, | ||
ConstMatrixView | ppath_f, | ||
ConstMatrixView | ppath_mag, | ||
ConstVectorView | f_grid, | ||
const Index & | stokes_dim, | ||
const ArrayOfIndex & | ispecies | ||
) |
get_ppath_abs
Determines the "clearsky" absorption along a propagation path.
ppath_abs* returns the summed absorption and has dimensions [ frequency, stokes, stokes, ppath point ]
abs_per_species* can hold absorption for individual species. The species to include ar selected by ispecies. For example, to store first and third species in abs_per_species, set ispecies to [0][2].
The output variables are sized inside the function. The dimension order is [ absorption species, frequency, stokes, stokes, ppath point ]
ws | Out: The workspace |
ppath_abs | Out: Summed absorption at each ppath point |
abs_per_species | Out: Absorption for "ispecies" |
propmat_clearsky_agenda | As the WSV. |
ppath | As the WSV. |
ppath_p | Pressure for each ppath point. |
ppath_t | Temperature for each ppath point. |
ppath_vmr | VMR values for each ppath point. |
ppath_f | See get_ppath_f. |
ppath_mag | See get_ppath_atmvars. |
f_grid | As the WSV. |
stokes_dim | As the WSV. |
ispecies | Index of species to store in abs_per_species |
Definition at line 1351 of file rte.cc.
References DEBUG_ONLY, joker, Ppath::los, max, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Ppath::np, ConstTensor4View::npages(), ConstMatrixView::nrows(), ConstTensor4View::nrows(), propmat_clearsky_agendaExecute(), Tensor4::resize(), and Tensor5::resize().
Referenced by fos(), iyCloudRadar(), iyEmissionStandard(), iyRadioLink(), and iyTransmissionStandard().
void get_ppath_atmvars | ( | Vector & | ppath_p, |
Vector & | ppath_t, | ||
Matrix & | ppath_vmr, | ||
Matrix & | ppath_wind, | ||
Matrix & | ppath_mag, | ||
const Ppath & | ppath, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstTensor3View | wind_u_field, | ||
ConstTensor3View | wind_v_field, | ||
ConstTensor3View | wind_w_field, | ||
ConstTensor3View | mag_u_field, | ||
ConstTensor3View | mag_v_field, | ||
ConstTensor3View | mag_w_field | ||
) |
get_ppath_atmvars
Determines pressure, temperature, VMR, winds and magnetic field for each propgataion path point.
The output variables are sized inside the function. For VMR the dimensions are [ species, propagation path point ].
ppath_p | Out: Pressure for each ppath point. |
ppath_t | Out: Temperature for each ppath point. |
ppath_vmr | Out: VMR values for each ppath point. |
ppath_wind | Out: Wind vector for each ppath point. |
ppath_mag | Out: Mag. field vector for each ppath point. |
ppath | As the WSV. |
atmosphere_dim | As the WSV. |
p_grid | As the WSV. |
lat_grid | As the WSV. |
lon_grid | As the WSV. |
t_field | As the WSV. |
vmr_field | As the WSV. |
wind_u_field | As the WSV. |
wind_v_field | As the WSV. |
wind_w_field | As the WSV. |
mag_u_field | As the WSV. |
mag_v_field | As the WSV. |
mag_w_field | As the WSV. |
Definition at line 1233 of file rte.cc.
References Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), Ppath::np, ConstTensor3View::npages(), ns, Vector::resize(), and Matrix::resize().
Referenced by fos(), iyCloudRadar(), iyEmissionStandard(), iyRadioLink(), and iyTransmissionStandard().
void get_ppath_blackrad | ( | Workspace & | ws, |
Matrix & | ppath_blackrad, | ||
const Agenda & | blackbody_radiation_agenda, | ||
const Ppath & | ppath, | ||
ConstVectorView | ppath_t, | ||
ConstMatrixView | ppath_f | ||
) |
get_ppath_blackrad
Determines blackbody radiation along the propagation path.
The output variable is sized inside the function. The dimension order is [ frequency, ppath point ]
ws | Out: The workspace |
ppath_blackrad | Out: Emission source term at each ppath point |
blackbody_radiation_agenda | As the WSV. |
ppath_t | Temperature for each ppath point. |
ppath_f | See get_ppath_f. |
Definition at line 1487 of file rte.cc.
References blackbody_radiation_agendaExecute(), joker, Ppath::np, ConstMatrixView::nrows(), and Matrix::resize().
Referenced by fos(), and iyEmissionStandard().
void get_ppath_ext | ( | ArrayOfIndex & | clear2cloudbox, |
Tensor3 & | pnd_abs_vec, | ||
Tensor4 & | pnd_ext_mat, | ||
Array< ArrayOfSingleScatteringData > & | scat_data, | ||
Matrix & | ppath_pnd, | ||
const Ppath & | ppath, | ||
ConstVectorView | ppath_t, | ||
const Index & | stokes_dim, | ||
ConstMatrixView | ppath_f, | ||
const Index & | atmosphere_dim, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Tensor4 & | pnd_field, | ||
const Index & | use_mean_scat_data, | ||
const ArrayOfSingleScatteringData & | scat_data_array, | ||
const Verbosity & | verbosity | ||
) |
get_ppath_ext
Determines the particle properties along a propagation path.
Note that the extinction for all particle types is summed. And that all frequencies are filled for pnd_abs_vec and pnd_ext_mat even if use_mean_scat_data is true (but data equal for all frequencies).
ws | Out: The workspace |
clear2cloudbox | Out: Mapping of index. See code for details. |
pnd_abs_vec | Out: Absorption vectors for particles (defined only where particles are found) |
pnd_ext_vec | Out: Extinction matrices for particles (defined only where particles are found) |
scat_data | Out: Extracted scattering data. Length of array affected by use_mean_scat_data. |
ppath_pnd | Out. The particle number density for each point (also outside cloudbox). |
ppath | As the WSV. |
ppath_t | Temperature for each ppath point. |
stokes_dim | As the WSV. |
f_grid | As the WSV. |
cloubox_limits | As the WSV. |
pnd_field | As the WSV. |
use_mean_scat_data | As the WSV. |
scat_data_array | As the WSV. |
Definition at line 1546 of file 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, Ppath::los, max, mean(), mirror_los(), ConstTensor4View::nbooks(), Ppath::np, ConstMatrixView::nrows(), opt_propCalc(), Tensor4::resize(), Tensor3::resize(), Matrix::resize(), and scat_data_array_monoCalc().
Referenced by fos(), iyCloudRadar(), iyRadioLink(), and iyTransmissionStandard().
void get_ppath_f | ( | Matrix & | ppath_f, |
const Ppath & | ppath, | ||
ConstVectorView | f_grid, | ||
const Index & | atmosphere_dim, | ||
const Numeric & | rte_alonglos_v, | ||
ConstMatrixView | ppath_wind | ||
) |
get_ppath_f
Determines the Doppler shifted frequencies along the propagation path.
ppath_doppler [ nf + np ]
ppath_f | Out: Doppler shifted f_grid |
ppath | Propagation path. |
f_grid | Original f_grid. |
atmosphere_dim | As the WSV. |
rte_alonglos_v | As the WSV. |
ppath_wind | See get_ppath_atmvars. |
Definition at line 1690 of file rte.cc.
References dotprod_with_los(), joker, Ppath::los, ConstVectorView::nelem(), Ppath::np, Matrix::resize(), and SPEED_OF_LIGHT.
Referenced by fos(), iyCloudRadar(), iyEmissionStandard(), iyRadioLink(), and iyTransmissionStandard().
void get_ppath_trans | ( | Tensor4 & | trans_partial, |
ArrayOfArrayOfIndex & | extmat_case, | ||
Tensor4 & | trans_cumulat, | ||
Vector & | scalar_tau, | ||
const Ppath & | ppath, | ||
ConstTensor4View & | ppath_abs, | ||
ConstVectorView | f_grid, | ||
const Index & | stokes_dim | ||
) |
get_ppath_trans
Determines the transmission in different ways for a clear-sky RT integration.
The argument trans_partial holds the transmission for each propagation path step. It has np-1 columns.
The structure of average extinction matrix for each step is returned in extmat_case. The dimension of this variable is [np-1,nf]. For the coding see ext2trans.
The argument trans_cumalat holds the transmission between the path point with index 0 and each propagation path point. The transmission is valid for the photon travelling direction. It has np columns.
The output variables are sized inside the function. The dimension order is [ frequency, stokes, stokes, ppath point ]
The scalar optical thickness is calculated in parallel.
trans_partial | Out: Transmission for each path step. |
extmat_case | Out: Corresponds to icase of ext2trans. |
trans_cumulat | Out: Transmission to each path point. |
scalar_tau | Out: Total (scalar) optical thickness of path |
ppath | As the WSV. |
ppath_abs | See get_ppath_abs. |
f_grid | As the WSV. |
stokes_dim | As the WSV. |
Definition at line 1770 of file rte.cc.
References ext2trans(), id_mat(), joker, Ppath::lstep, mult(), ConstVectorView::nelem(), Ppath::np, Tensor4::resize(), and Vector::resize().
Referenced by fos(), iyCloudRadar(), iyEmissionStandard(), iyRadioLink(), and iyTransmissionStandard().
void get_ppath_trans2 | ( | Tensor4 & | trans_partial, |
ArrayOfArrayOfIndex & | extmat_case, | ||
Tensor4 & | trans_cumulat, | ||
Vector & | scalar_tau, | ||
const Ppath & | ppath, | ||
ConstTensor4View & | ppath_abs, | ||
ConstVectorView | f_grid, | ||
const Index & | stokes_dim, | ||
const ArrayOfIndex & | clear2cloudbox, | ||
ConstTensor4View | pnd_ext_mat | ||
) |
get_ppath_trans2
Determines the transmission in different ways for a cloudy RT integration.
This function works as get_ppath_trans, but considers also particle extinction. See get_ppath_trans for format of output data.
trans_partial | Out: Transmission for each path step. |
trans_cumulat | Out: Transmission to each path point. |
scalar_tau | Out: Total (scalar) optical thickness of path |
ppath | As the WSV. |
ppath_abs | See get_ppath_abs. |
f_grid | As the WSV. |
stokes_dim | As the WSV. |
clear2cloudbox | See get_ppath_ext. |
pnd_ext_mat | See get_ppath_ext. |
Definition at line 1856 of file rte.cc.
References ext2trans(), id_mat(), joker, Ppath::lstep, mult(), ConstVectorView::nelem(), Ppath::np, Tensor4::resize(), and Vector::resize().
Referenced by fos(), iyCloudRadar(), iyRadioLink(), and iyTransmissionStandard().
get_rowindex_for_mblock
Returns the "range" of y corresponding to a measurement block
sensor_response | As the WSV. |
mblock_index | Index of the measurement block. |
Definition at line 1960 of file rte.cc.
References Sparse::nrows().
Referenced by jacobianCalcAbsSpeciesPerturbations(), jacobianCalcFreqShift(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), jacobianCalcSinefit(), jacobianCalcTemperaturePerturbations(), yCalc(), and yCalc_mblock_loop_body().
void iy_transmission_mult | ( | Tensor3 & | iy_trans_total, |
ConstTensor3View | iy_trans_old, | ||
ConstTensor3View | iy_trans_new | ||
) |
iy_transmission_mult
Multiplicates iy_transmission with (vector) transmissions.
That is, a multiplication of iy_transmission with another variable having same structure and holding transmission values.
The "new path" is assumed to be further away from the sensor than the propagtion path already included in iy_transmission. That is, the operation can be written as:
Ttotal = Told * Tnew
where Told is the transmission corresponding to iy_transmission and Tnew corresponds to tau.
iy_trans_new* is sized by the function.
iy_trans_total | Out: Updated version of iy_transmission |
iy_trans_old | A variable matching *iy_transmission. |
iy_trans_new | A variable matching *iy_transmission. |
Definition at line 2309 of file rte.cc.
References joker, mult(), ConstTensor3View::ncols(), ConstTensor3View::npages(), ConstTensor3View::nrows(), ns, and Tensor3::resize().
Referenced by fos(), iyEmissionStandard(), and iySurfaceRtpropAgenda().
void iyb_calc | ( | Workspace & | ws, |
Vector & | iyb, | ||
ArrayOfVector & | iyb_aux, | ||
ArrayOfMatrix & | diyb_dx, | ||
const Index & | mblock_index, | ||
const Index & | atmosphere_dim, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
const Index & | cloudbox_on, | ||
const Index & | stokes_dim, | ||
ConstVectorView | f_grid, | ||
ConstMatrixView | sensor_pos, | ||
ConstMatrixView | sensor_los, | ||
ConstMatrixView | transmitter_pos, | ||
ConstVectorView | mblock_za_grid, | ||
ConstVectorView | mblock_aa_grid, | ||
const Index & | antenna_dim, | ||
const Agenda & | iy_main_agenda, | ||
const Index & | j_analytical_do, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const ArrayOfArrayOfIndex & | jacobian_indices, | ||
const ArrayOfString & | iy_aux_vars, | ||
const Verbosity & | verbosity | ||
) |
iyb_calc
Calculation of pencil beam monochromatic spectra for 1 measurement block.
All in- and output variables as the WSV with the same name.
Definition at line 2101 of file rte.cc.
References arts_omp_get_max_threads(), CREATE_OUT3, FOR_ANALYTICAL_JACOBIANS_DO, iyb_calc_za_loop_body(), min, Array< base >::nelem(), ConstVectorView::nelem(), q, and Vector::resize().
Referenced by jacobianCalcAbsSpeciesPerturbations(), jacobianCalcPointingZaRecalc(), jacobianCalcTemperaturePerturbations(), and yCalc_mblock_loop_body().
void iyb_calc_za_loop_body | ( | bool & | failed, |
String & | fail_msg, | ||
ArrayOfArrayOfTensor4 & | iy_aux_array, | ||
Workspace & | ws, | ||
Vector & | iyb, | ||
ArrayOfMatrix & | diyb_dx, | ||
const Index & | mblock_index, | ||
const Index & | atmosphere_dim, | ||
ConstTensor3View | t_field, | ||
ConstTensor3View | z_field, | ||
ConstTensor4View | vmr_field, | ||
const Index & | cloudbox_on, | ||
const Index & | stokes_dim, | ||
ConstVectorView | f_grid, | ||
ConstMatrixView | sensor_pos, | ||
ConstMatrixView | sensor_los, | ||
ConstMatrixView | transmitter_pos, | ||
ConstVectorView | mblock_za_grid, | ||
ConstVectorView | mblock_aa_grid, | ||
const Index & | antenna_dim, | ||
const Agenda & | iy_main_agenda, | ||
const Index & | j_analytical_do, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const ArrayOfArrayOfIndex & | jacobian_indices, | ||
const ArrayOfString & | iy_aux_vars, | ||
const Index & | naa, | ||
const Index & | iza, | ||
const Index & | nf | ||
) |
Definition at line 1969 of file rte.cc.
References adjust_los(), FOR_ANALYTICAL_JACOBIANS_DO, iy_main_agendaExecute(), joker, map_daa(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstMatrixView::nrows(), and q.
Referenced by iyb_calc().
void los3d | ( | Vector & | los3d, |
ConstVectorView | los, | ||
const Index & | atmosphere_dim | ||
) |
iy_transmission_mult_scalar_tau los3d
Converts any LOS vector to the implied 3D LOS vector.
The output argument, los3d, is a vector with length 2, with azimuth angle set and zenith angle always >= 0.
los3d | Out: The line-of-sight in 3D |
los | A line-of-sight |
atmosphere_dim | As the WSV. |
Definition at line 2348 of file rte.cc.
References abs.
void mirror_los | ( | Vector & | los_mirrored, |
ConstVectorView | los, | ||
const Index & | atmosphere_dim | ||
) |
mirror_los
Determines the backward direction for a given line-of-sight.
This function can be used to get the LOS to apply for extracting single scattering properties, if the propagation path LOS is given.
A viewing direction of aa=0 is assumed for 1D. This corresponds to positive za for 2D.
los_mirrored | Out: The line-of-sight for reversed direction. |
los | A line-of-sight |
atmosphere_dim | As the WSV. |
Definition at line 2389 of file rte.cc.
References Vector::resize().
Referenced by defocusing_general(), dotprod_with_los(), fos(), get_ppath_ext(), iyCloudRadar(), propmat_clearskyAddParticles(), and propmat_clearskyAddZeeman().
void pos2true_latlon | ( | Numeric & | lat, |
Numeric & | lon, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lat_true, | ||
ConstVectorView | lon_true, | ||
ConstVectorView | pos | ||
) |
pos2true_latlon
Determines the true alt and lon for an "ARTS position"
The function disentangles if the geographical position shall be taken from lat_grid and lon_grid, or lat_true and lon_true.
lat | Out: True latitude. |
lon | Out: True longitude. |
atmosphere_dim | As the WSV. |
lat_grid | As the WSV. |
lat_true | As the WSV. |
lon_true | As the WSV. |
pos | A position, as defined for rt calculations. |
Definition at line 2438 of file rte.cc.
References gridpos(), interp(), interpweights(), and ConstVectorView::nelem().
Referenced by surface_complex_refr_indexFromGriddedField5(), surface_reflectivityFromGriddedField6(), surface_scalar_reflectivityFromGriddedField4(), and z_fieldFromHSE().
void surface_calc | ( | Matrix & | iy, |
ConstTensor3View | I, | ||
ConstMatrixView | surface_los, | ||
ConstTensor4View | surface_rmatrix, | ||
ConstMatrixView | surface_emission | ||
) |
surface_calc
Weights together downwelling radiation and surface emission.
iy* must have correct size when function is called.
iy | In/Out: Radiation matrix, amtching the WSV with the same name. |
I | Input: Downwelling radiation, with dimensions matching: (surface_los, f_grid, stokes_dim) |
surface_los | Input: As the WSV with the same name. |
surface_rmatrix | Input: As the WSV with the same name. |
surface_emission | Input: As the WSV with the same name. |
Definition at line 2496 of file rte.cc.
References joker, mult(), ConstTensor3View::ncols(), ConstMatrixView::nrows(), and ConstTensor3View::nrows().
Referenced by iySurfaceRtpropAgenda().
void vectorfield2los | ( | Numeric & | l, |
Vector & | los, | ||
const Numeric & | u, | ||
const Numeric & | v, | ||
const Numeric & | w | ||
) |
vectorfield2los
Calculates the size and direction of a vector field defined as u, v and w components.
l | Size/magnitude of the vector. |
los | Out: The direction, as a LOS vector |
u | Zonal component of the vector field |
v | N-S component of the vector field |
w | Vertical component of the vector field |
Definition at line 2542 of file rte.cc.
References Vector::resize(), and w().
|
extern |
Referenced by apply_iy_unit(), apply_iy_unit2(), and get_ppath_f().