66 const Index& stokes_dim,
68 const Index& atmosphere_dim,
79 const Index& cloudbox_on,
82 const Index& use_mean_scat_data,
84 const Matrix& particle_masses,
87 const Index& jacobian_do,
88 const Agenda& ppath_agenda,
89 const Agenda& propmat_clearsky_agenda,
90 const Agenda& iy_transmitter_agenda,
91 const Index& iy_agenda_call1,
101 if( !iy_agenda_call1 )
103 "Recursive usage not possible (iy_agenda_call1 must be 1)" );
104 if( iy_transmission.
ncols() )
105 throw runtime_error(
"*iy_transmission* must be empty" );
108 "The cloudbox must be activated (cloudbox_on must be 1)" );
111 "This method does not provide any jacobians (jacobian_do must be 0)" );
116 0, 0, t_field, z_field, vmr_field,
117 f_grid, ppath_agenda );
127 Index auxPressure = -1,
136 iy_aux.resize( naux );
138 for(
Index i=0; i<naux; i++ )
140 if( iy_aux_vars[i] ==
"Pressure" )
141 { auxPressure = i; iy_aux[i].resize( 1, 1, 1, np ); }
142 else if( iy_aux_vars[i] ==
"Temperature" )
143 { auxTemperature = i; iy_aux[i].resize( 1, 1, 1, np ); }
144 else if( iy_aux_vars[i].substr(0,14) ==
"Mass content, " )
147 istringstream is(iy_aux_vars[i].substr(14,2));
149 if( icont < 0 || icont>=particle_masses.
ncols() )
152 os <<
"You have selected particle mass content category with " 153 <<
"index " << icont <<
".\nThis category is not defined!";
154 throw runtime_error( os.str() );
156 auxPartCont.push_back(i);
157 auxPartContI.push_back(icont);
158 iy_aux[i].resize( 1, 1, 1, np );
160 else if( iy_aux_vars[i].substr(0,10) ==
"PND, type " )
163 istringstream is(iy_aux_vars[i].substr(10,2));
165 if( ip < 0 || ip>=pnd_field.
nbooks() )
168 os <<
"You have selected particle number density field with " 169 <<
"index " << ip <<
".\nThis field is not defined!";
170 throw runtime_error( os.str() );
172 auxPartField.push_back(i);
173 auxPartFieldI.push_back(ip);
174 iy_aux[i].resize( 1, 1, 1, np );
176 else if( iy_aux_vars[i] ==
"Backscattering" )
177 { auxBackScat = i; iy_aux[i].resize( nf, ns, 1, np ); iy_aux[i] = 0; }
178 else if( iy_aux_vars[i] ==
"Transmission" )
179 { auxTrans = i; iy_aux[i].resize( nf, ns, ns, np ); }
180 else if( iy_aux_vars[i] ==
"Round-trip time" )
181 { auxRoTrTime = i; iy_aux[i].resize( 1, 1, 1, np ); }
185 os <<
"In *iy_aux_vars* you have included: \"" << iy_aux_vars[i]
186 <<
"\"\nThis choice is not recognised.";
187 throw runtime_error( os.str() );
198 iy_transmitter_agenda );
199 if( iy0.ncols() != stokes_dim || iy0.nrows() != nf )
200 throw runtime_error(
"The size of *iy* returned from " 201 "*iy_transmitter_agenda* is not correct." );
202 for(
Index iv=0; iv<nf; iv++ )
205 throw runtime_error(
"The *iy* returned from *iy_transmitter_agenda* " 206 "must have the value 1 in the first column." );
212 Matrix ppath_vmr, ppath_pnd, ppath_wind, ppath_mag, ppath_f;
213 Tensor4 ppath_abs, trans_partial, trans_cumulat, pnd_ext_mat;
222 ppath_wind, ppath_mag,
223 ppath, atmosphere_dim, p_grid, t_field, vmr_field,
224 wind_u_field, wind_v_field, wind_w_field,
225 mag_u_field, mag_v_field, mag_w_field );
226 get_ppath_f( ppath_f, ppath, f_grid, atmosphere_dim,
227 rte_alonglos_v, ppath_wind );
229 propmat_clearsky_agenda, ppath,
230 ppath_p, ppath_t, ppath_vmr, ppath_f, ppath_mag,
236 scalar_tau, ppath, ppath_abs, f_grid, stokes_dim );
244 get_ppath_ext( clear2cloudbox, pnd_abs_vec, pnd_ext_mat, scat_data,
245 ppath_pnd, ppath, ppath_t, stokes_dim, ppath_f,
246 atmosphere_dim, cloudbox_limits, pnd_field,
247 use_mean_scat_data, scat_data_array, verbosity );
249 ppath, ppath_abs, f_grid, stokes_dim,
250 clear2cloudbox, pnd_ext_mat );
261 for(
Index iv=0; iv<nf; iv++ )
266 for(
Index ip=0; ip<np; ip++ )
274 if( atmosphere_dim == 3 )
279 if( clear2cloudbox[ip] >= 0 )
281 for(
Index iv=0; iv<nf; iv++ )
286 los_inc[1], scat_data[iv], stokes_dim,
287 ppath_pnd(
joker,ip), ppath_t[ip], verbosity );
290 Vector iy1(stokes_dim), iy2(stokes_dim);
297 if( auxBackScat >= 0 ) {
301 {
for(
Index is1=0; is1<
ns; is1++ ){
302 for(
Index is2=0; is2<
ns; is2++ ){
303 iy_aux[auxTrans](iv,is1,is2,ip) =
304 tr_rev(iv,is1,is2); } } }
318 if( auxPressure >= 0 )
319 { iy_aux[auxPressure](0,0,0,ip) = ppath_p[ip]; }
321 if( auxTemperature >= 0 )
322 { iy_aux[auxTemperature](0,0,0,ip) = ppath_t[ip]; }
324 for(
Index j=0; j<auxPartCont.nelem(); j++ )
325 { iy_aux[auxPartCont[j]](0,0,0,ip) = ppath_pnd(
joker,ip) *
326 particle_masses(
joker,auxPartContI[j]); }
328 for(
Index j=0; j<auxPartField.nelem(); j++ )
329 { iy_aux[auxPartField[j]](0,0,0,ip) = ppath_pnd(auxPartFieldI[j],ip); }
330 if( auxRoTrTime >= 0 )
333 { iy_aux[auxRoTrTime](0,0,0,ip) = 2 * ppath.
end_lstep /
336 { iy_aux[auxRoTrTime](0,0,0,ip) = iy_aux[auxRoTrTime](0,0,0,ip-1)+
345 else if( iy_unit ==
"Ze" )
354 for(
Index iv=0; iv<nf; iv++ )
357 Complex n( complex_n(iv,0), complex_n(iv,1) );
362 Numeric fac = a*la*la*la*la / ( absK * absK );
368 if( auxBackScat >= 0 ) {
375 throw runtime_error(
"For this method, *iy_unit* must be set to \"1\" " 389 const Index& atmfields_checked,
390 const Index& atmgeom_checked,
392 const Index& stokes_dim,
397 const Index& cloudbox_on,
398 const Index& cloudbox_checked,
401 const Index& sensor_checked,
402 const Agenda& iy_main_agenda,
420 if( atmfields_checked != 1 )
421 throw runtime_error(
"The atmospheric fields must be flagged to have " 422 "passed a consistency check (atmfields_checked=1)." );
423 if( atmgeom_checked != 1 )
424 throw runtime_error(
"The atmospheric geometry must be flagged to have " 425 "passed a consistency check (atmgeom_checked=1)." );
426 if( cloudbox_checked != 1 )
427 throw runtime_error(
"The cloudbox must be flagged to have " 428 "passed a consistency check (cloudbox_checked=1)." );
429 if( sensor_checked != 1 )
430 throw runtime_error(
"The sensor variables must be flagged to have " 431 "passed a consistency check (sensor_checked=1)." );
434 bool is_z =
max(range_bins) > 1;
436 throw runtime_error(
"The vector *range_bins* must contain strictly " 437 "increasing values." );
438 if( !is_z &&
min(range_bins) < 0 )
439 throw runtime_error(
"The vector *range_bins* is not allowed to contain " 441 if( sensor_pol_array.
nelem() != nf )
442 throw runtime_error(
"The main length of *sensor_pol_array* must match " 443 "the number of frequencies." );
455 for(
Index i=0; i<nf; i++ )
457 npolcum[i+1] = npolcum[i] + sensor_pol_array[i].
nelem();
458 for(
Index j=0; j<sensor_pol_array[i].
nelem(); j++ )
460 if( s2p[sensor_pol_array[i][j]-1].nelem() > stokes_dim )
461 throw runtime_error(
"Your definition of *sensor_pol_array* " 462 "requires a higher value for *stokes_dim*." );
467 const Index ntot = npos * npolcum[nf] * nbins;
471 y_aux.resize( naux );
472 for(
Index i=0; i<naux; i++ )
474 y_aux[i].resize( ntot );
482 for(
Index p=0; p<npos; p++ )
485 Tensor3 iy_transmission(0,0,0);
493 iy_aux_vars, cloudbox_on, 0, t_field, z_field,
496 rte_pos2, iy_main_agenda );
501 throw runtime_error(
"A path consisting of a single point found. " 502 "This is not allowed." );
503 const bool isupward = ppath.
pos(1,0) > ppath.
pos(0,0);
506 throw runtime_error(
"A path with strictly increasing or decreasing " 507 "altitudes must be obtained (e.g. limb " 508 "measurements are not allowed)." );
509 if( iy.
nrows() != nf*np )
510 throw runtime_error(
"The size of *iy* returned from *iy_main_agenda* " 511 "is not correct (for this method)." );
520 for(
Index i=1; i<np; i++ )
521 { range[i] = range[i-1] + ppath.
lstep[i-1] *
526 for(
Index b=0; b<nbins; b++ )
537 for(
Index i=0; i<np; i++ )
538 {
if( range[i] > ztlow && range[i] < zthigh )
539 { i_in[n_in] = i; n_in += 1; } }
542 for(
Index i=0; i<n_in; i++ )
543 { zt[i+1] = range[i_in[i]]; }
548 Numeric dl1 = range_bins[b+1] - range_bins[b];
549 Numeric dl2 = zt[n_in-1] - zt[0];
557 for(
Index iv=0; iv<nf; iv++ )
562 for(
Index ip=0; ip<sensor_pol_array[iv].
nelem(); ip++ )
566 Vector w = s2p[sensor_pol_array[iv][ip]-1];
568 {
for(
Index j=0; j<np; j++ )
569 { refl[j] += I(j,i) * w[i]; } }
573 interp( rv, itw, refl, gp );
574 Index iout = nbins * ( p*npolcum[nf] +
575 npolcum[iv] + ip ) + b;
576 for(
Index i=0; i<n_in-1; i++ )
577 { y[iout] += (rv[i]+rv[i+1])*(zt[i+1]-zt[i])/(2*dl1); }
580 for(
Index a=0; a<naux; a++ )
582 if( iy_aux[a].npages()==1 && iy_aux[a].nbooks()==1 &&
583 iy_aux[a].nrows() ==1 && iy_aux[a].ncols() ==np )
586 for(
Index i=0; i<n_in-1; i++ )
588 (rv[i]+rv[i+1])*(zt[i+1]-zt[i])/(2*dl2); }
590 else if( iy_aux_vars[a] ==
"Backscattering" )
596 {
for(
Index j=0; j<np; j++ )
597 { refl[j] += I2(i,j) * w[i]; } }
598 interp( rv, itw, refl, gp );
599 for(
Index i=0; i<n_in-1; i++ )
600 { y_aux[a][iout] += (rv[i]+rv[i+1])*
601 (zt[i+1]-zt[i])/(2*dl1); }
606 os <<
"The auxiliary variable " << iy_aux_vars[a]
607 <<
"is not handled by this WSM (but OK when " 608 <<
"using *iyCalc*).";
609 throw runtime_error( os.str() );
INDEX Index
The type to use for all integer numbers and indices.
void ppath_agendaExecute(Workspace &ws, Ppath &ppath, const Numeric ppath_lraytrace, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index cloudbox_on, const Index ppath_inside_cloudbox_do, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Vector &f_grid, const Agenda &input_agenda)
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
A class implementing complex numbers for ARTS.
Index nelem() const
Number of elements.
Declarations having to do with the four output streams.
const Numeric SPEED_OF_LIGHT
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Numeric fac(const Index n)
fac
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
cmplx FADDEEVA() w(cmplx z, double relerr)
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
Index nelem() const
Returns the number of elements.
Array< Index > ArrayOfIndex
An array of Index.
void complex_n_water_liebe93(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_water_liebe93
void iy_main_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index iy_agenda_call1, const Tensor3 &iy_transmission, const ArrayOfString &iy_aux_vars, const Index cloudbox_on, const Index jacobian_do, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Vector &f_grid, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &input_agenda)
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
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix Vector multiplication.
Sensor modelling functions.
The implementation for String, the ARTS string class.
Index ncols() const
Returns the number of columns.
The global header file for ARTS.
std::complex< Numeric > Complex
Index ncols() const
Returns the number of columns.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
NUMERIC Numeric
The type to use for all floating point numbers.
Header file for logic.cc.
This can be used to make arrays out of anything.
void resize(Index n)
Assignment operator from VectorView.
void yCloudRadar(Workspace &ws, Vector &y, ArrayOfVector &y_aux, const Index &atmfields_checked, const Index &atmgeom_checked, const ArrayOfString &iy_aux_vars, const Index &stokes_dim, const Vector &f_grid, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &cloudbox_checked, const Matrix &sensor_pos, const Matrix &sensor_los, const Index &sensor_checked, const Agenda &iy_main_agenda, const ArrayOfArrayOfIndex &sensor_pol_array, const Vector &range_bins, const Verbosity &)
WORKSPACE METHOD: yCloudRadar.
void iyCloudRadar(Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, Ppath &ppath, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const 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 Index &use_mean_scat_data, const ArrayOfSingleScatteringData &scat_data_array, const Matrix &particle_masses, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const Agenda &ppath_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &iy_transmitter_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Vector &rte_pos, const Vector &rte_los, const Numeric &rte_alonglos_v, const Numeric &ppath_lraytrace, const Numeric &ze_tref, const Verbosity &verbosity)
WORKSPACE METHOD: iyCloudRadar.
Index nbooks() const
Returns the number of books.
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
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
void mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
mirror_los
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
void id_mat(MatrixView I)
Identity Matrix.
The structure to describe a propagation path and releated quantities.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
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
void iy_transmitter_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
void stokes2pol(ArrayOfVector &s2p, const Numeric &nv)
stokes2pol
Index nrows() const
Returns the number of rows.
void pha_mat_singleCalc(MatrixView Z, const Numeric za_sca, const Numeric aa_sca, const Numeric za_inc, const Numeric aa_inc, const ArrayOfSingleScatteringData &scat_data_array_mono, const Index stokes_dim, ConstVectorView pnd_vec, const Numeric rtp_temperature, const Verbosity &verbosity)
pha_mat_singleCalc
Declaration of functions in rte.cc.
void resize(Index r, Index c)
Resize function.