669 const Index& stokes_dim,
671 const Index& atmosphere_dim,
683 const Index& cloudbox_on,
690 const Index& jacobian_do,
693 const Agenda& propmat_clearsky_agenda,
694 const Agenda& water_p_eq_agenda,
695 const Agenda& iy_transmitter_agenda,
696 const Index& iy_agenda_call1,
697 const Tensor3& iy_transmission,
710 if (!iy_agenda_call1)
712 "Recursive usage not possible (iy_agenda_call1 must be 1)");
713 if (!iy_transmission.
empty())
714 throw runtime_error(
"*iy_transmission* must be empty");
715 if (rbi < 1 || rbi > 9)
717 "ppath.background is invalid. Check your " 718 "calculation of *ppath*?");
720 if (dpnd_field_dx.
nelem() != jacobian_quantities.
nelem())
722 "*dpnd_field_dx* not properly initialized:\n" 723 "Number of elements in dpnd_field_dx must be equal number of jacobian" 724 " quantities.\n(Note: jacobians have to be defined BEFORE *pnd_field*" 725 " is calculated/set.");
733 ppath.
pos(np - 1,
Range(0, atmosphere_dim)),
735 iy_transmitter_agenda);
738 os <<
"The size of *iy* returned from *iy_transmitter_agenda* is\n" 740 <<
" expected size = [" << nf <<
"," << stokes_dim <<
"]\n" 741 <<
" size of iy = [" << iy.
nrows() <<
"," << iy.
ncols() <<
"]\n";
742 throw runtime_error(os.
str());
746 Index j_analytical_do = 0;
749 const Index nq = j_analytical_do ? jacobian_quantities.
nelem() : 0;
751 ArrayOfIndex jac_species_i(nq), jac_scat_i(nq), jac_is_t(nq), jac_wind_i(nq);
754 if (j_analytical_do) {
779 Index auxOptDepth = -1;
782 iy_aux[
i].resize(nf, ns);
785 if (iy_aux_vars[
i] ==
"Radiative background")
787 else if (iy_aux_vars[
i] ==
"Optical depth")
791 os <<
"The only allowed strings in *iy_aux_vars* are:\n" 792 <<
" \"Radiative background\"\n" 793 <<
" \"Optical depth\"\n" 794 <<
"but you have selected: \"" << iy_aux_vars[
i] <<
"\"";
795 throw runtime_error(os.
str());
801 ppvar_trans_cumulat.
resize(np, nf, ns, ns);
815 if (np == 1 && rbi == 1) {
826 ppvar_iy.
resize(nf, ns, np);
850 ppvar_f, ppath, f_grid, atmosphere_dim, rte_alonglos_v, ppvar_wind);
865 clear2cloudy.resize(np);
866 for (
Index ip = 0; ip < np; ip++) clear2cloudy[ip] = -1;
879 Index temperature_derivative_position = -1;
882 if (j_analytical_do) {
891 temperature_derivative_position = iq;
892 do_hse = jacobian_quantities[iq].Subtag() ==
898 for (
Index ip = 0; ip < np; ip++) {
905 propmat_clearsky_agenda,
908 ppvar_mag(
joker, ip),
911 ppvar_vmr(
joker, ip),
917 if (j_analytical_do) {
923 ppvar_vmr(
joker, ip),
933 if (clear2cloudy[ip] + 1) {
944 ppvar_t[
Range(ip, 1)],
949 if (j_analytical_do) {
957 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip - 1]) : 0;
959 do_hse ? ppath.
lstep[ip - 1] / (2.0 * ppvar_t[ip]) : 0;
970 temperature_derivative_position);
973 swap(K_past, K_this);
974 swap(dK_past_dx, dK_this_dx);
982 if (auxOptDepth >= 0) {
983 for (
Index iv = 0; iv < nf; iv++)
984 iy_aux[auxOptDepth](iv, 0) = -std::log(tot_tra[np - 1](iv, 0, 0));
987 lvl_rad[np - 1] = iy;
990 for (
Index ip = np - 2; ip >= 0; ip--) {
991 lvl_rad[ip] = lvl_rad[ip + 1];
1001 dlyr_tra_above[ip + 1],
1002 dlyr_tra_below[ip + 1],
1008 for (
Index ip = 0; ip < lvl_rad.
nelem(); ip++) {
1011 if (j_analytical_do)
1017 if (j_analytical_do) {
1032 jacobian_quantities,
1040 const Index& stokes_dim,
1046 if (instrument_pol.
nelem() != nf)
1047 throw runtime_error(
1048 "The length of *f_grid* and the number of elements " 1049 "in *instrument_pol* must be equal.");
1051 iy.
resize(nf, stokes_dim);
1060 const Index& stokes_dim,
1066 if (instrument_pol.
nelem() != 1)
1067 throw runtime_error(
1068 "The number of elements in *instrument_pol* must be 1.");
1070 iy.
resize(nf, stokes_dim);
INDEX Index
The type to use for all integer numbers and indices.
Class to keep track of Transmission Matrices for Stokes Dim 1-4.
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)
Determines the Doppler shifted frequencies along the propagation path.
A class implementing complex numbers for ARTS.
void get_stepwise_clearsky_propmat(Workspace &ws, PropagationMatrix &K, StokesVector &S, Index <e, ArrayOfPropagationMatrix &dK_dx, ArrayOfStokesVector &dS_dx, const Agenda &propmat_clearsky_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, ConstVectorView ppath_f_grid, ConstVectorView ppath_magnetic_field, ConstVectorView ppath_line_of_sight, const EnergyLevelMap &ppath_nlte, ConstVectorView ppath_vmrs, const Numeric &ppath_temperature, const Numeric &ppath_pressure, const ArrayOfIndex &jacobian_species, const bool &jacobian_do)
Gets the clearsky propgation matrix and NLTE contributions.
Index nelem() const
Number of elements.
Declarations having to do with the four output streams.
Matrix los
Line-of-sight at each ppath point.
Routines for setting up the jacobian.
void stepwise_transmission(TransmissionMatrix &T, ArrayOfTransmissionMatrix &dT1, ArrayOfTransmissionMatrix &dT2, const PropagationMatrix &K1, const PropagationMatrix &K2, const ArrayOfPropagationMatrix &dK1, const ArrayOfPropagationMatrix &dK2, const Numeric &r, const Numeric &dr_dtemp1, const Numeric &dr_dtemp2, const Index temp_deriv_pos)
Set the stepwise transmission matrix.
Vector lstep
The length between ppath points.
Linear algebra functions.
bool empty() const
Check if variable is empty.
void get_ppath_cloudvars(ArrayOfIndex &clear2cloudy, Matrix &ppath_pnd, ArrayOfMatrix &ppath_dpnd_dx, const Ppath &ppath, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx)
Determines the particle fields along a propagation path.
void rtmethods_jacobian_init(ArrayOfIndex &jac_species_i, ArrayOfIndex &jac_scat_i, ArrayOfIndex &jac_is_t, ArrayOfIndex &jac_wind_i, ArrayOfIndex &jac_mag_i, ArrayOfIndex &jac_other, ArrayOfTensor3 &diy_dx, ArrayOfTensor3 &diy_dpath, const Index &ns, const Index &nf, const Index &np, const Index &nq, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const ArrayOfString &scat_species, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &iy_agenda_call1, const bool is_active)
This function fixes the initial steps around Jacobian calculations, to be done inside radiative trans...
Matrix pos
The distance between start pos and the last position in pos.
void iyTransmissionStandard(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, Tensor3 &ppvar_iy, 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 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 Verbosity &)
WORKSPACE METHOD: iyTransmissionStandard.
void get_ppath_atmvars(Vector &ppath_p, Vector &ppath_t, EnergyLevelMap &ppath_nlte, Matrix &ppath_vmr, Matrix &ppath_wind, Matrix &ppath_mag, const Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstTensor3View t_field, const EnergyLevelMap &nlte_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)
Determines pressure, temperature, VMR, winds and magnetic field for each propgataion path point...
Stokes vector is as Propagation matrix but only has 4 possible values.
#define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do)
Index nelem() const
Returns the number of elements.
Array< RadiationVector > ArrayOfRadiationVector
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Sensor modelling functions.
Index ncols() const
Returns the number of columns.
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
The global header file for ARTS.
_CS_string_type str() const
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
Array< TransmissionMatrix > ArrayOfTransmissionMatrix
void get_stepwise_scattersky_propmat(StokesVector &ap, PropagationMatrix &Kp, ArrayOfStokesVector &dap_dx, ArrayOfPropagationMatrix &dKp_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, ConstMatrixView ppath_1p_pnd, const ArrayOfMatrix &ppath_dpnd_dx, const Index ppath_1p_id, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstVectorView ppath_line_of_sight, ConstVectorView ppath_temperature, const Index &atmosphere_dim, const bool &jacobian_do)
Computes the contribution by scattering at propagation path point.
NUMERIC Numeric
The type to use for all floating point numbers.
Radiation Vector for Stokes dimension 1-4.
void resize(Index p, Index r, Index c)
Resize function.
Header file for logic.cc.
This can be used to make arrays out of anything.
const Numeric SPEED_OF_LIGHT
void update_radiation_vector(RadiationVector &I, ArrayOfRadiationVector &dI1, ArrayOfRadiationVector &dI2, const RadiationVector &J1, const RadiationVector &J2, const ArrayOfRadiationVector &dJ1, const ArrayOfRadiationVector &dJ2, const TransmissionMatrix &T, const TransmissionMatrix &PiT, const ArrayOfTransmissionMatrix &dT1, const ArrayOfTransmissionMatrix &dT2, const RadiativeTransferSolver solver)
Update the Radiation Vector.
void iy_transmitterMultiplePol(Matrix &iy, const Index &stokes_dim, const Vector &f_grid, const ArrayOfIndex &instrument_pol, const Verbosity &)
WORKSPACE METHOD: iy_transmitterMultiplePol.
void resize(Index n)
Resize function.
void rtmethods_jacobian_finalisation(Workspace &ws, ArrayOfTensor3 &diy_dx, ArrayOfTensor3 &diy_dpath, const Index &ns, const Index &nf, const Index &np, const Index &atmosphere_dim, const Ppath &ppath, const Vector &ppvar_p, const Vector &ppvar_t, const Matrix &ppvar_vmr, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Agenda &water_p_eq_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex jac_species_i, const ArrayOfIndex jac_is_t)
This function fixes the last steps to made on the Jacobian in some radiative transfer WSMs...
void adapt_stepwise_partial_derivatives(ArrayOfPropagationMatrix &dK_dx, ArrayOfStokesVector &dS_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, ConstVectorView ppath_f_grid, ConstVectorView ppath_line_of_sight, ConstVectorView ppath_vmrs, const Numeric &ppath_temperature, const Numeric &ppath_pressure, const ArrayOfIndex &jacobian_species, const ArrayOfIndex &jacobian_wind, const Index <e, const Index &atmosphere_dim, const bool &jacobian_do)
Adapts clearsky partial derivatives.
Index np
Number of points describing the ppath.
void stokes2pol(VectorView w, const Index &stokes_dim, const Index &ipol_1based, const Numeric nv)
stokes2pol
void iy_transmitterSinglePol(Matrix &iy, const Index &stokes_dim, const Vector &f_grid, const ArrayOfIndex &instrument_pol, const Verbosity &)
WORKSPACE METHOD: iy_transmitterSinglePol.
The structure to describe a propagation path and releated quantities.
void iy_transmitter_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
Index nrows() const
Returns the number of rows.
void resize(Index b, Index p, Index r, Index c)
Resize function.
Declaration of functions in rte.cc.
void resize(Index r, Index c)
Resize function.