ARTS  2.3.1285(git:92a29ea9-dirty)
m_cloudradar.cc File Reference

Workspace functions related to simulation of cloud radars. More...

#include <cmath>
#include <stdexcept>
#include "arts.h"
#include "auto_md.h"
#include "logic.h"
#include "messages.h"
#include "montecarlo.h"
#include "propagationmatrix.h"
#include "rte.h"
#include "sensor.h"

Go to the source code of this file.

Functions

void iyActiveSingleScat (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_pnd, Matrix &ppvar_f, Tensor4 &ppvar_trans_cumulat, 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 ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_transmitter_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Numeric &rte_alonglos_v, const Index &trans_in_jacobian, const Numeric &pext_scaling, const Index &t_interp_order, const Verbosity &verbosity)
 WORKSPACE METHOD: iyActiveSingleScat. More...
 
void iyActiveSingleScat2 (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_pnd, Matrix &ppvar_f, Tensor4 &ppvar_trans_cumulat, 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 ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_transmitter_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Numeric &rte_alonglos_v, const Index &trans_in_jacobian, const Numeric &pext_scaling, const Index &t_interp_order, const Verbosity &verbosity)
 WORKSPACE METHOD: iyActiveSingleScat2. More...
 
void yActive (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 String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Matrix &sensor_pos, const Matrix &sensor_los, const Index &sensor_checked, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Agenda &iy_main_agenda, const Agenda &geo_pos_agenda, const ArrayOfArrayOfIndex &instrument_pol_array, const Vector &range_bins, const Numeric &ze_tref, const Numeric &k2, const Numeric &dbze_min, const Verbosity &)
 WORKSPACE METHOD: yActive. More...
 

Variables

const Numeric PI
 
const Numeric SPEED_OF_LIGHT
 
const String SCATSPECIES_MAINTAG
 

Detailed Description

Workspace functions related to simulation of cloud radars.

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
2010-10-31

Definition in file m_cloudradar.cc.

Function Documentation

◆ iyActiveSingleScat()

void iyActiveSingleScat ( 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_pnd,
Matrix ppvar_f,
Tensor4 ppvar_trans_cumulat,
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 ArrayOfIndex cloudbox_limits,
const Tensor4 pnd_field,
const ArrayOfTensor4 dpnd_field_dx,
const ArrayOfString scat_species,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_data_checked,
const ArrayOfString iy_aux_vars,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Ppath ppath,
const Agenda propmat_clearsky_agenda,
const Agenda water_p_eq_agenda,
const Agenda iy_transmitter_agenda,
const Index iy_agenda_call1,
const Tensor3 iy_transmission,
const Numeric rte_alonglos_v,
const Index trans_in_jacobian,
const Numeric pext_scaling,
const Index t_interp_order,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyActiveSingleScat.

Simulation of radar/lidar, restricted to single scattering.

The WSM treats e.g. radar measurements of cloud and precipitation, on the condition that multiple scattering can be ignored. Beside the direct backsacttering, the two-way attenuation by gases and particles is considered. Surface scattering is ignored.

The method could potentially be used for lidars, but multiple scattering poses here a must stronger constrain for the range of applications.

The method can be used with iyCalc, but not with yCalc. In the later case, use instead yActive.

The method returns the backscattering for each point of ppath. Several frequencies can be treated in parallel. The size of iy is [ nf*np, stokes_dim ], where nf is the length of f_grid and np is the number of path points. The data are stored in blocks of [ np, stokes_dim ]. That is, all the results for the first frequency occupy the np first rows of iy etc.

The polarisation state of the transmitted pulse is taken from iy_transmitter_agenda*. If the radar transmits several polarisations at the same frequency, you need to handle this by using two frequencies in f_grid, but these can be almost identical.

This method does not consider iy_unit. Unit changes are insted applied in *yActive. The output of this method matches the option "1".

Transmission is handled in a slightly simplified manner for efficiency reasons. First of all, the transmission matrix is assumed to be the same in both directions between the sensor and the point of back-scattering. This should in general be true, but exceptions could exist. The extinction due to particles can also be scaled, which could be of interest when e.g. characterising inversions.

Further, for Jacobian calculations the default is to assume that the transmission is unaffected by the retrieval quantities. This is done to save computational time, and should be a valid approximation for the single-scattering conditions. Set trans_in_jacobian to 1 to obtain the more accurate Jacobian.

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> "Backscattering": The unattenuated backscattering. That is, as <br> iy but with no attenuated applied. Here all columns are filled. <br> "Optical depth": Scalar, total and two-way, optical depth between <br> sensor and each point of the propagation path. Calculated based on <br> the (1,1)-element of the transmission matrix (1-based indexing), <br> i.e. only fully valid for scalar RT. <br> "Particle extinction": As "Optical depth", but only with particle <br> attenuation included. That is, gas absorption is ignored. 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
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_pndWS Output
[out]ppvar_fWS Output
[out]ppvar_trans_cumulatWS Output
[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]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]dpnd_field_dxWS Input
[in]scat_speciesWS Input
[in]scat_dataWS Input
[in]scat_data_checkedWS Input
[in]iy_aux_varsWS Input
[in]jacobian_doWS Input
[in]jacobian_quantitiesWS Input
[in]ppathWS Input
[in]propmat_clearsky_agendaWS Input
[in]water_p_eq_agendaWS Input
[in]iy_transmitter_agendaWS Input
[in]iy_agenda_call1WS Input
[in]iy_transmissionWS Input
[in]rte_alonglos_vWS Input
[in]trans_in_jacobianGeneric Input (Default: "0")
[in]pext_scalingGeneric Input (Default: "1")
[in]t_interp_orderGeneric Input (Default: "1")

Definition at line 49 of file m_cloudradar.cc.

References abs, adapt_stepwise_partial_derivatives(), chk_if_in_range(), ConstTensor3View::empty(), FOR_ANALYTICAL_JACOBIANS_DO, get_ppath_atmvars(), get_ppath_cloudvars(), get_ppath_f(), get_stepwise_clearsky_propmat(), get_stepwise_scattersky_propmat(), i, iy_transmitter_agendaExecute(), J, joker, Ppath::los, min, ConstTensor4View::nbooks(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Ppath::np, ConstMatrixView::nrows(), ns, Ppath::pos, ppath_what_background(), Tensor4::resize(), Tensor5::resize(), Vector::resize(), Matrix::resize(), rtmethods_jacobian_init(), S, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and TotalNumberOfElements().

Referenced by iyActiveSingleScat_g().

◆ iyActiveSingleScat2()

void iyActiveSingleScat2 ( 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_pnd,
Matrix ppvar_f,
Tensor4 ppvar_trans_cumulat,
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 ArrayOfIndex cloudbox_limits,
const Tensor4 pnd_field,
const ArrayOfTensor4 dpnd_field_dx,
const ArrayOfString scat_species,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index scat_data_checked,
const ArrayOfString iy_aux_vars,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Ppath ppath,
const Agenda propmat_clearsky_agenda,
const Agenda water_p_eq_agenda,
const Agenda iy_transmitter_agenda,
const Index iy_agenda_call1,
const Tensor3 iy_transmission,
const Numeric rte_alonglos_v,
const Index trans_in_jacobian,
const Numeric pext_scaling,
const Index t_interp_order,
const Verbosity verbosity 
)

WORKSPACE METHOD: iyActiveSingleScat2.

TESTING

Author
Patrick Eriksson
Richard Larsson
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_pndWS Output
[out]ppvar_fWS Output
[out]ppvar_trans_cumulatWS Output
[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]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]dpnd_field_dxWS Input
[in]scat_speciesWS Input
[in]scat_dataWS Input
[in]scat_data_checkedWS Input
[in]iy_aux_varsWS Input
[in]jacobian_doWS Input
[in]jacobian_quantitiesWS Input
[in]ppathWS Input
[in]propmat_clearsky_agendaWS Input
[in]water_p_eq_agendaWS Input
[in]iy_transmitter_agendaWS Input
[in]iy_agenda_call1WS Input
[in]iy_transmissionWS Input
[in]rte_alonglos_vWS Input
[in]trans_in_jacobianGeneric Input (Default: "0")
[in]pext_scalingGeneric Input (Default: "1")
[in]t_interp_orderGeneric Input (Default: "1")

Definition at line 680 of file m_cloudradar.cc.

References abs, adapt_stepwise_partial_derivatives(), chk_if_in_range(), ConstTensor3View::empty(), FOR_ANALYTICAL_JACOBIANS_DO, get_ppath_atmvars(), get_ppath_cloudvars(), get_ppath_f(), get_stepwise_clearsky_propmat(), get_stepwise_scattersky_propmat(), i, iy_transmitter_agendaExecute(), joker, Ppath::los, min, ConstTensor4View::nbooks(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Ppath::np, ConstMatrixView::nrows(), ns, Ppath::pos, ppath_what_background(), Tensor4::resize(), Vector::resize(), Matrix::resize(), rtmethods_jacobian_init(), S, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), Temperature, and TotalNumberOfElements().

Referenced by iyActiveSingleScat2_g().

◆ yActive()

void yActive ( 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 String iy_unit,
const ArrayOfString iy_aux_vars,
const Index stokes_dim,
const Vector f_grid,
const Index atmosphere_dim,
const EnergyLevelMap nlte_field,
const Index cloudbox_on,
const Index cloudbox_checked,
const Matrix sensor_pos,
const Matrix sensor_los,
const Index sensor_checked,
const Index jacobian_do,
const ArrayOfRetrievalQuantity jacobian_quantities,
const Agenda iy_main_agenda,
const Agenda geo_pos_agenda,
const ArrayOfArrayOfIndex instrument_pol_array,
const Vector range_bins,
const Numeric ze_tref,
const Numeric k2,
const Numeric dbze_min,
const Verbosity verbosity 
)

WORKSPACE METHOD: yActive.

Replaces yCalc for radar/lidar calculations.

The output format for iy when simulating radars and lidars differs from the standard one, and yCalc can not be used for such simulations. This method works largely as yCalc, but is tailored to handle the output from iyActiveSingleScat.

The method requires additional information about the sensor, regarding its recieving properties. First of all, recieved polarisation states are taken from instrument_pol_array. Note that this WSV allows to define several measured polarisations for each transmitted signal. For example, it is possible to simulate transmission of V and measuring backsacttered V and H.

Secondly, the range averaging is described by range_bins. These bins can either be specified in altitude or two-way travel time. In both case, the edges of the range bins shall be specified. All data (including auxiliary variables) are returned as the average inside the bins. If a bin is totally outside the model atmosphere, NaN is returned.

The options for iy_unit are: <br> "1" : Backscatter coefficient. Unit is 1/(m*sr). At zero <br> attenuation, this equals the scattering matrix value for <br> the backward direction. See further AUG. <br> "Ze" : Equivalent reflectivity. Unit is mm^6/m^3. Conversion <br> formula is given below. <br> "dBZe": 10*log10(Ze/Z0), where Z0 is 1 mm^6/m^3.

The conversion from backscatter coefficient to Ze is: <br> Ze = 1e18 * lambda^4 / (k2 * pi^5) * sum(sigma), where sum(sigma) = 4 * pi * b, and b is the backscatter coefficient.

The reference dielectric factor can either specified directly by the argument k2. For example, to mimic the CloudSat data, k2 shall be set to 0.75 (citaion needed). If k2 is set to be negative (which is defualt), k2 is calculated as: <br> k2 = abs( (n^2-1)/(n^2+2) )^2, where n is the refractive index of liquid water at temperature ze_tref* and the frequency of the radar, calculated by the MPM93 parameterization.

A lower limit for dBZe is applied (dbze_min). The main reason is to handle the fact dBZe is not defined for Ze=0, and dBZe is set to the clip value when Ze < 10^(dbze_min/10).

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]iy_unitWS Input
[in]iy_aux_varsWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]atmosphere_dimWS Input
[in]nlte_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]sensor_checkedWS Input
[in]jacobian_doWS Input
[in]jacobian_quantitiesWS Input
[in]iy_main_agendaWS Input
[in]geo_pos_agendaWS Input
[in]instrument_pol_arrayWS Input
[in]range_binsWS Input
[in]ze_trefGeneric Input (Default: "273.15")
[in]k2Generic Input (Default: "-1")
[in]dbze_minGeneric Input (Default: "-99")

Definition at line 1190 of file m_cloudradar.cc.

References chk_if_in_range(), chk_if_increasing(), ConstVectorView::empty(), Ppath::end_lstep, error_if_limb_ppath(), FOR_ANALYTICAL_JACOBIANS_DO, i, integration_bin_by_vecmult(), is_increasing(), iy_main_agendaExecute(), jac_ranges_indices(), joker, Ppath::lstep, max, min, mult(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Ppath::ngroup, Ppath::np, ConstMatrixView::nrows(), Ppath::pos, pow(), Vector::resize(), Matrix::resize(), SPEED_OF_LIGHT, stokes2pol(), and ze_cfac().

Referenced by yActive_g().

Variable Documentation

◆ PI

const Numeric PI

◆ SCATSPECIES_MAINTAG

const String SCATSPECIES_MAINTAG

◆ SPEED_OF_LIGHT

const Numeric SPEED_OF_LIGHT

Referenced by yActive().