ARTS  2.2.66
m_cloudradar.cc
Go to the documentation of this file.
1 /* Copyright (C) 2012
2  Patrick Eriksson <Patrick.Eriksson@chalmers.se>
3  Stefan Buehler <sbuehler(at)ltu.se>
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18  USA. */
19 
20 
21 
22 /*===========================================================================
23  === File description
24  ===========================================================================*/
25 
39 /*===========================================================================
40  === External declarations
41  ===========================================================================*/
42 
43 #include <cmath>
44 #include <stdexcept>
45 #include "arts.h"
46 #include "auto_md.h"
47 #include "complex.h"
48 #include "logic.h"
49 #include "messages.h"
50 #include "montecarlo.h"
51 #include "refraction.h"
52 #include "rte.h"
53 #include "sensor.h"
54 
55 extern const Numeric PI;
56 extern const Numeric SPEED_OF_LIGHT;
57 
58 
59 
60 /* Workspace method: Doxygen documentation will be auto-generated */
62  Workspace& ws,
63  Matrix& iy,
64  ArrayOfTensor4& iy_aux,
65  Ppath& ppath,
66  const Index& stokes_dim,
67  const Vector& f_grid,
68  const Index& atmosphere_dim,
69  const Vector& p_grid,
70  const Tensor3& z_field,
71  const Tensor3& t_field,
72  const Tensor4& vmr_field,
73  const Tensor3& wind_u_field,
74  const Tensor3& wind_v_field,
75  const Tensor3& wind_w_field,
76  const Tensor3& mag_u_field,
77  const Tensor3& mag_v_field,
78  const Tensor3& mag_w_field,
79  const Index& cloudbox_on,
80  const ArrayOfIndex& cloudbox_limits,
81  const Tensor4& pnd_field,
82  const Index& use_mean_scat_data,
83  const ArrayOfSingleScatteringData& scat_data_array,
84  const Matrix& particle_masses,
85  const String& iy_unit,
86  const ArrayOfString& iy_aux_vars,
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,
92  const Tensor3& iy_transmission,
93  const Vector& rte_pos,
94  const Vector& rte_los,
95  const Numeric& rte_alonglos_v,
96  const Numeric& ppath_lraytrace,
97  const Numeric& ze_tref,
98  const Verbosity& verbosity )
99 {
100  // Throw error if unsupported features are requested
101  if( !iy_agenda_call1 )
102  throw runtime_error(
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" );
106  if( !cloudbox_on )
107  throw runtime_error(
108  "The cloudbox must be activated (cloudbox_on must be 1)" );
109  if( jacobian_do )
110  throw runtime_error(
111  "This method does not provide any jacobians (jacobian_do must be 0)" );
112 
113  // Determine propagation path
114  //
115  ppath_agendaExecute( ws, ppath, ppath_lraytrace, rte_pos, rte_los, Vector(0),
116  0, 0, t_field, z_field, vmr_field,
117  f_grid, ppath_agenda );
118 
119  // Some basic sizes
120  //
121  const Index nf = f_grid.nelem();
122  const Index ns = stokes_dim;
123  const Index np = ppath.np;
124 
125 
126  //=== iy_aux part ===========================================================
127  Index auxPressure = -1,
128  auxTemperature = -1,
129  auxBackScat = -1,
130  auxTrans = -1,
131  auxRoTrTime = -1;
132  ArrayOfIndex auxPartCont(0), auxPartContI(0);
133  ArrayOfIndex auxPartField(0), auxPartFieldI(0);
134  //
135  const Index naux = iy_aux_vars.nelem();
136  iy_aux.resize( naux );
137  //
138  for( Index i=0; i<naux; i++ )
139  {
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, " )
145  {
146  Index icont;
147  istringstream is(iy_aux_vars[i].substr(14,2));
148  is >> icont;
149  if( icont < 0 || icont>=particle_masses.ncols() )
150  {
151  ostringstream os;
152  os << "You have selected particle mass content category with "
153  << "index " << icont << ".\nThis category is not defined!";
154  throw runtime_error( os.str() );
155  }
156  auxPartCont.push_back(i);
157  auxPartContI.push_back(icont);
158  iy_aux[i].resize( 1, 1, 1, np );
159  }
160  else if( iy_aux_vars[i].substr(0,10) == "PND, type " )
161  {
162  Index ip;
163  istringstream is(iy_aux_vars[i].substr(10,2));
164  is >> ip;
165  if( ip < 0 || ip>=pnd_field.nbooks() )
166  {
167  ostringstream os;
168  os << "You have selected particle number density field with "
169  << "index " << ip << ".\nThis field is not defined!";
170  throw runtime_error( os.str() );
171  }
172  auxPartField.push_back(i);
173  auxPartFieldI.push_back(ip);
174  iy_aux[i].resize( 1, 1, 1, np );
175  }
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 ); }
182  else
183  {
184  ostringstream os;
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() );
188  }
189  }
190  //===========================================================================
191 
192 
193  // Transmitted signal
194  //
195  Matrix iy0;
196  //
197  iy_transmitter_agendaExecute( ws, iy0, f_grid, rte_pos, rte_los,
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++ )
203  {
204  if( iy0(iv,0) != 1 )
205  throw runtime_error( "The *iy* returned from *iy_transmitter_agenda* "
206  "must have the value 1 in the first column." );
207  }
208 
209  // Get atmospheric and RT quantities for each ppath point/step
210  //
211  Vector ppath_p, ppath_t;
212  Matrix ppath_vmr, ppath_pnd, ppath_wind, ppath_mag, ppath_f;
213  Tensor4 ppath_abs, trans_partial, trans_cumulat, pnd_ext_mat;
214  Tensor5 dummy_abs_per_species;
215  Vector scalar_tau;
216  ArrayOfIndex clear2cloudbox;
218  //
219  if( np > 1 )
220  {
221  get_ppath_atmvars( ppath_p, ppath_t, ppath_vmr,
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 );
228  get_ppath_abs( ws, ppath_abs, dummy_abs_per_species,
229  propmat_clearsky_agenda, ppath,
230  ppath_p, ppath_t, ppath_vmr, ppath_f, ppath_mag,
231  f_grid, stokes_dim, ArrayOfIndex(0) );
232  if( !cloudbox_on )
233  {
234  ArrayOfArrayOfIndex extmat_case;
235  get_ppath_trans( trans_partial, extmat_case, trans_cumulat,
236  scalar_tau, ppath, ppath_abs, f_grid, stokes_dim );
237  }
238  else
239  {
240  // Extract basic scattering data
241  ArrayOfArrayOfIndex extmat_case;
242  Tensor3 pnd_abs_vec;
243  //
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 );
248  get_ppath_trans2( trans_partial, extmat_case, trans_cumulat, scalar_tau,
249  ppath, ppath_abs, f_grid, stokes_dim,
250  clear2cloudbox, pnd_ext_mat );
251  }
252  }
253 
254 
255  // Size iy and set to zero (as not filled if pnd=0)
256  iy.resize( nf*np, ns );
257  iy = 0;
258 
259  // Transmission for reversed direction
260  Tensor3 tr_rev( nf, ns, ns );
261  for( Index iv=0; iv<nf; iv++ )
262  { id_mat( tr_rev(iv,joker,joker) ); }
263 
264 
265  // Loop ppath steps
266  for( Index ip=0; ip<np; ip++ )
267  {
268  // Direction of outgoing scattered radiation (which is reverse to LOS).
269  Vector los_sca;
270  mirror_los( los_sca, ppath.los(ip,joker), atmosphere_dim );
271 
272  // Obtain a length-2 vector for incoming direction
273  Vector los_inc;
274  if( atmosphere_dim == 3 )
275  { los_inc = ppath.los(ip,joker); }
276  else // Mirror back to get a correct 3D LOS
277  { mirror_los( los_inc, los_sca, 3 ); }
278 
279  if( clear2cloudbox[ip] >= 0 )
280  {
281  for( Index iv=0; iv<nf; iv++ )
282  {
283  // Obtain scattering matrix
284  Matrix P(ns,ns);
285  pha_mat_singleCalc( P, los_sca[0], los_sca[1], los_inc[0],
286  los_inc[1], scat_data[iv], stokes_dim,
287  ppath_pnd(joker,ip), ppath_t[ip], verbosity );
288 
289  // Combine iy0, double transmission and scattering matrix
290  Vector iy1(stokes_dim), iy2(stokes_dim);
291  mult( iy1, tr_rev(iv,joker,joker), iy0(iv,joker) );
292  mult( iy2, P, iy1 );
293  mult( iy(iv*np+ip,joker), trans_cumulat(iv,joker,joker,ip), iy2 );
294 
295  //=== iy_aux part ===========================================
296  // Backscattering
297  if( auxBackScat >= 0 ) {
298  mult( iy_aux[auxBackScat](iv,joker,0,ip), P, iy0(iv,joker) ); }
299  // Transmission
300  if( auxTrans >= 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); } } }
305 
306  // Update tr_rev
307  if( ip<np-1 )
308  {
309  Matrix tmp = tr_rev(iv,joker,joker);
310  mult( tr_rev(iv,joker,joker),
311  trans_partial(iv,joker,joker,ip), tmp );
312  }
313  }
314  }
315 
316  //=== iy_aux part ===================================================
317  // Pressure
318  if( auxPressure >= 0 )
319  { iy_aux[auxPressure](0,0,0,ip) = ppath_p[ip]; }
320  // Temperature
321  if( auxTemperature >= 0 )
322  { iy_aux[auxTemperature](0,0,0,ip) = ppath_t[ip]; }
323  // Particle mass content
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]); }
327  // Particle field
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 )
331  {
332  if( ip == 0 )
333  { iy_aux[auxRoTrTime](0,0,0,ip) = 2 * ppath.end_lstep /
334  SPEED_OF_LIGHT; }
335  else
336  { iy_aux[auxRoTrTime](0,0,0,ip) = iy_aux[auxRoTrTime](0,0,0,ip-1)+
337  ppath.lstep[ip-1] * ( ppath.ngroup[ip-1]+ppath.ngroup[ip] ) /
338  SPEED_OF_LIGHT; }
339  }
340  //===================================================================
341  }
342 
343  if( iy_unit == "1" )
344  {}
345  else if( iy_unit == "Ze" )
346  {
347  // Get refractive index for water
348  Matrix complex_n;
349  complex_n_water_liebe93( complex_n, f_grid, ze_tref );
350 
351  // Common conversion factor
352  const Numeric a = 4e18/(PI*PI*PI*PI);
353 
354  for( Index iv=0; iv<nf; iv++ )
355  {
356  // Calculate the dielectric factor
357  Complex n( complex_n(iv,0), complex_n(iv,1) );
358  Complex n2 = n*n;
359  Complex K = ( n2 - Numeric(1.0) ) / ( n2 + Numeric(2.0) );
360  Numeric absK = abs( K );
361  Numeric la = SPEED_OF_LIGHT / f_grid[iv];
362  Numeric fac = a*la*la*la*la / ( absK * absK ); // Alalalala!
363 
364  iy(Range(iv*np,np),joker) *= fac;
365 
366  //=== iy_aux part ===========================================
367  // Backscattering
368  if( auxBackScat >= 0 ) {
369  iy_aux[auxBackScat](iv,joker,joker,joker) *= fac; }
370 
371  }
372  }
373  else
374  {
375  throw runtime_error( "For this method, *iy_unit* must be set to \"1\" "
376  "or \"Ze\"." );
377  }
378 }
379 
380 
381 
382 
383 
384 /* Workspace method: Doxygen documentation will be auto-generated */
386  Workspace& ws,
387  Vector& y,
388  ArrayOfVector& y_aux,
389  const Index& atmfields_checked,
390  const Index& atmgeom_checked,
391  const ArrayOfString& iy_aux_vars,
392  const Index& stokes_dim,
393  const Vector& f_grid,
394  const Tensor3& t_field,
395  const Tensor3& z_field,
396  const Tensor4& vmr_field,
397  const Index& cloudbox_on,
398  const Index& cloudbox_checked,
399  const Matrix& sensor_pos,
400  const Matrix& sensor_los,
401  const Index& sensor_checked,
402  const Agenda& iy_main_agenda,
403  const ArrayOfArrayOfIndex& sensor_pol_array,
404  const Vector& range_bins,
405  const Verbosity& )
406 {
407  // Important sizes
408  const Index npos = sensor_pos.nrows();
409  const Index nbins = range_bins.nelem() - 1;
410  const Index nf = f_grid.nelem();
411  const Index naux = iy_aux_vars.nelem();
412 
413  //---------------------------------------------------------------------------
414  // Input checks
415  //---------------------------------------------------------------------------
416 
417  // Basics
418  //
419  chk_if_in_range( "stokes_dim", stokes_dim, 1, 4 );
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)." );
432 
433  // Method specific variables
434  bool is_z = max(range_bins) > 1;
435  if( !is_increasing( range_bins ) )
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 "
440  "negative times." );
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." );
444 
445 
446  //---------------------------------------------------------------------------
447  // The calculations
448  //---------------------------------------------------------------------------
449 
450  // Conversion from Stokes to sensor_pol
451  ArrayOfVector s2p;
452  stokes2pol( s2p, 0.5 );
453 
454  ArrayOfIndex npolcum(nf+1); npolcum[0]=0;
455  for( Index i=0; i<nf; i++ )
456  {
457  npolcum[i+1] = npolcum[i] + sensor_pol_array[i].nelem();
458  for( Index j=0; j<sensor_pol_array[i].nelem(); j++ )
459  {
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*." );
463  }
464  }
465 
466  // Size output arguments, and set to 0
467  const Index ntot = npos * npolcum[nf] * nbins;
468  y.resize( ntot );
469  y = 0;
470  //
471  y_aux.resize( naux );
472  for( Index i=0; i<naux; i++ )
473  {
474  y_aux[i].resize( ntot );
475  y_aux[i] = 0;
476  }
477 
478 
479  // Are range_bins z or t?
480 
481  // Loop positions
482  for( Index p=0; p<npos; p++ )
483  {
484  // RT part
485  Tensor3 iy_transmission(0,0,0);
486  ArrayOfTensor3 diy_dx;
487  Vector rte_pos2(0);
488  Matrix iy;
489  Ppath ppath;
490  ArrayOfTensor4 iy_aux;
491  //
492  iy_main_agendaExecute( ws, iy, iy_aux, ppath, diy_dx, 1, iy_transmission,
493  iy_aux_vars, cloudbox_on, 0, t_field, z_field,
494  vmr_field, f_grid,
495  sensor_pos(p,joker), sensor_los(p,joker),
496  rte_pos2, iy_main_agenda );
497 
498  // Check if path and size OK
499  const Index np = ppath.np;
500  if( np == 1 )
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);
504  if( !( ( isupward & is_increasing( ppath.pos(joker,0) ) ) ||
505  ( !isupward & is_decreasing( ppath.pos(joker,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)." );
512 
513  // Range of ppath, in altitude or time
514  Vector range(np);
515  if( is_z)
516  { range = ppath.pos(joker,0); }
517  else
518  { // Calculate round-trip time
519  range[0] = 2 * ppath.end_lstep / SPEED_OF_LIGHT;
520  for( Index i=1; i<np; i++ )
521  { range[i] = range[i-1] + ppath.lstep[i-1] *
522  ( ppath.ngroup[i-1]+ppath.ngroup[i] ) / SPEED_OF_LIGHT; }
523  }
524 
525  // Loop radar bins
526  for( Index b=0; b<nbins; b++ )
527  {
528  // Get effective limits for bin
529  Numeric ztlow = max( range_bins[b], min(range) );
530  Numeric zthigh = min( range_bins[b+1], max(range) );
531 
532  if( ztlow < zthigh ) // Otherwise bin outside range of ppath
533  {
534  // Get ppath altitudes inside bin + edges
535  Index n_in = 0;
536  ArrayOfIndex i_in(np);
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; } }
540  Vector zt(n_in+2);
541  zt[0] = ztlow;
542  for( Index i=0; i<n_in; i++ )
543  { zt[i+1] = range[i_in[i]]; }
544  zt[n_in+1] = zthigh;
545  n_in += 2;
546 
547  // Height of layer, for reflectivity and aux, respectively
548  Numeric dl1 = range_bins[b+1] - range_bins[b];
549  Numeric dl2 = zt[n_in-1] - zt[0];
550 
551  // Convert to interpolation weights
552  ArrayOfGridPos gp( n_in );
553  gridpos( gp, range, zt );
554  Matrix itw( n_in, 2 );
555  interpweights( itw, gp );
556 
557  for( Index iv=0; iv<nf; iv++ )
558  {
559  // Pick out part of iy for frequency
560  Matrix I = iy( Range(iv*np,np), joker );
561 
562  for( Index ip=0; ip<sensor_pol_array[iv].nelem(); ip++ )
563  {
564  // Extract reflectivity for recieved polarisation
565  Vector refl( np, 0 );
566  Vector w = s2p[sensor_pol_array[iv][ip]-1];
567  for( Index i=0; i<w.nelem(); i++ ) // Note that w can
568  { for( Index j=0; j<np; j++ ) // be shorter than
569  { refl[j] += I(j,i) * w[i]; } } // stokes_dim (and
570  // dot product can
571  // Interpolate and sum up not be used)
572  Vector rv( n_in );
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); }
578 
579  // Same for aux variables
580  for( Index a=0; a<naux; a++ )
581  {
582  if( iy_aux[a].npages()==1 && iy_aux[a].nbooks()==1 &&
583  iy_aux[a].nrows() ==1 && iy_aux[a].ncols() ==np )
584  {
585  interp( rv, itw, iy_aux[a](0,0,0,joker), gp );
586  for( Index i=0; i<n_in-1; i++ )
587  { y_aux[a][iout] +=
588  (rv[i]+rv[i+1])*(zt[i+1]-zt[i])/(2*dl2); }
589  }
590  else if( iy_aux_vars[a] == "Backscattering" )
591  {
592  // I2 matches I, but is transposed
593  Matrix I2 = iy_aux[a](iv,joker,0,joker);
594  refl = 0;
595  for( Index i=0; i<w.nelem(); i++ )
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); }
602  }
603  else
604  {
605  ostringstream os;
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() );
610  }
611  }
612  }
613  }
614  }
615  }
616  }
617 }
618 
619 
620 
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
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)
Definition: auto_md.cc:14625
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
Definition: rte.cc:1690
A class implementing complex numbers for ARTS.
The Agenda class.
Definition: agenda_class.h:44
Index nelem() const
Number of elements.
Definition: array.h:176
Declarations having to do with the four output streams.
const Numeric SPEED_OF_LIGHT
Matrix los
Definition: ppath.h:68
The Vector class.
Definition: matpackI.h:556
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Numeric fac(const Index n)
fac
Definition: math_funcs.cc:68
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Definition: logic.cc:275
The Tensor4 class.
Definition: matpackIV.h:383
The range class.
Definition: matpackI.h:148
Vector lstep
Definition: ppath.h:70
cmplx FADDEEVA() w(cmplx z, double relerr)
Definition: Faddeeva.cc:679
Matrix pos
Definition: ppath.h:67
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
Definition: rte.cc:1351
Vector ngroup
Definition: ppath.h:75
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:180
Array< Index > ArrayOfIndex
An array of Index.
Definition: array.h:40
Numeric end_lstep
Definition: ppath.h:73
void complex_n_water_liebe93(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_water_liebe93
Definition: refraction.cc:78
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)
Definition: auto_md.cc:13776
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
Definition: rte.cc:1233
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix Vector multiplication.
Definition: matpackI.cc:1648
Sensor modelling functions.
The implementation for String, the ARTS string class.
Definition: mystring.h:63
Index ncols() const
Returns the number of columns.
Definition: matpackI.cc:838
The Tensor3 class.
Definition: matpackIII.h:348
The global header file for ARTS.
std::complex< Numeric > Complex
Definition: complex.h:32
Index ncols() const
Returns the number of columns.
Definition: matpackIII.h:149
#define max(a, b)
Definition: continua.cc:20461
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
#define abs(x)
Definition: continua.cc:20458
const Joker joker
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
The Matrix class.
Definition: matpackI.h:788
Header file for logic.cc.
This can be used to make arrays out of anything.
Definition: array.h:40
void chk_if_in_range(const String &x_name, const Index &x, const Index &x_low, const Index &x_high)
chk_if_in_range
Definition: check_input.cc:101
void resize(Index n)
Assignment operator from VectorView.
Definition: matpackI.cc:798
#define ns
Definition: continua.cc:21931
#define min(a, b)
Definition: continua.cc:20460
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.
Definition: m_cloudradar.cc:61
Index np
Definition: ppath.h:61
Workspace class.
Definition: workspace_ng.h:47
Index nbooks() const
Returns the number of books.
Definition: matpackIV.cc:63
Refraction functions.
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
Definition: rte.cc:1546
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
Definition: logic.cc:324
void mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
mirror_los
Definition: rte.cc:2389
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
Definition: rte.cc:1856
void id_mat(MatrixView I)
Identity Matrix.
Definition: lin_alg.cc:299
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:59
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
Definition: rte.cc:1770
void iy_transmitter_agendaExecute(Workspace &ws, Matrix &iy, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
Definition: auto_md.cc:14171
void stokes2pol(ArrayOfVector &s2p, const Numeric &nv)
stokes2pol
Definition: sensor.cc:1196
const Numeric PI
Index nrows() const
Returns the number of rows.
Definition: matpackI.cc:832
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
Definition: montecarlo.cc:928
The Tensor5 class.
Definition: matpackV.h:451
Declaration of functions in rte.cc.
void resize(Index r, Index c)
Resize function.
Definition: matpackI.cc:1580