ARTS 2.5.11 (git: 725533f0)
sun.cc
Go to the documentation of this file.
1/*===========================================================================
2 === File description
3 ===========================================================================*/
4
14#include "sun.h"
15#include "auto_md.h"
16#include "agenda_class.h"
17#include "arts_conversions.h"
18#include "check_input.h"
19#include "debug.h"
20#include "matpack_data.h"
21#include "messages.h"
22#include "physics_funcs.h"
23#include "propagationmatrix.h"
24#include "geodetic.h"
25#include "arts.h"
26#include "workspace_ng.h"
27
28using Constant::sigma;
29using Constant::pi;
30
31/*===========================================================================
32 === The functions
33 ===========================================================================*/
34
35std::ostream& operator<<(std::ostream& os, const Sun& sun) {
36 os << "Sun: " << sun.description;
37 os << " Radius: " << sun.radius << "m ";
38 os << " Distance: " << sun.distance << "m \n";
39 os << " Latitude: " << sun.latitude << "° \n";
40 os << " Longitude: " << sun.longitude << "° \n";
41 os << " Spectrum [W/m2/Hz]: \n" << sun.spectrum ;
42 return os;
43}
44
46 RadiationVector& scattered_sunlight,
47 const Vector& f_grid,
48 const Numeric& p,
49 const Numeric& T,
50 const Vector& vmr,
51 const Matrix& transmitted_sunlight,
52 const Vector& gas_scattering_los_in,
53 const Vector& gas_scattering_los_out,
54 const Agenda& gas_scattering_agenda) {
55 PropagationMatrix K_sca;
56 TransmissionMatrix gas_scattering_mat;
57 Vector sca_fct_dummy;
58
59 // calculate gas scattering properties
61 K_sca,
62 gas_scattering_mat,
63 sca_fct_dummy,
64 f_grid,
65 p,
66 T,
67 vmr,
68 gas_scattering_los_in,
69 gas_scattering_los_out,
70 0,
71 gas_scattering_agenda);
72
73 //some basic quantities
74 Index ns = transmitted_sunlight.ncols();
75 Index nf = f_grid.nelem();
76
77 //allocate and resize
78 RadiationVector scattered_sunlight_temp(1, ns);
79
80 Matrix mat_temp(1, ns,0.);
81 // Calculate the scattered radiation
82 for (Index i_f = 0; i_f < nf; i_f++) {
83 mat_temp(0,joker) = transmitted_sunlight(i_f, joker);
84 scattered_sunlight_temp = mat_temp;//transmitted_sunlight(i_f, joker);
85 scattered_sunlight_temp.leftMul(gas_scattering_mat);
86
87 for (Index j = 0; j < ns; j++) {
88 scattered_sunlight(i_f, j) =
89 scattered_sunlight_temp(0, j) * K_sca.Kjj(0, 0)[i_f] /(4*pi);
90 }
91 }
92
93 //TODO: Include jacobian mechanism
94}
95
96void get_sun_background(Matrix& iy,
97 Index& suns_visible,
98 const ArrayOfSun& suns,
99 const Ppath& ppath,
100 const Vector& f_grid,
101 const Index& stokes_dim,
102 const Index& atmosphere_dim,
103 const Vector& refellipsoid) {
104 const Index np = ppath.np;
105
106 //set visibilty flag to default
107 suns_visible = 0;
108
109 //allocate iy and set it to zero
110 iy.resize(f_grid.nelem(), stokes_dim);
111 iy=0.;
112
113 Vector rtp_pos, rtp_los;
114 rtp_pos.resize(atmosphere_dim);
115 rtp_pos = ppath.pos(np - 1, Range(0, atmosphere_dim));
116 rtp_los.resize(ppath.los.ncols());
117 rtp_los = ppath.los(np - 1, joker);
118
119 if (ppath_what_background(ppath) == 9 || ppath_what_background(ppath) == 1){
120 for (Index i_sun = 0; i_sun < suns.nelem(); i_sun++) {
121 get_sun_radiation(iy, suns_visible, suns[i_sun], rtp_pos, rtp_los, refellipsoid);
122 }
123 }
124}
125
126void get_sun_radiation(Matrix& iy,
127 Index& suns_visible,
128 const Sun& sun,
129 const Vector& rtp_pos,
130 const Vector& rtp_los,
131 const Vector& refellipsoid) {
132
133 //Calculate earth centric radial component of sun_pos and rtp_pos.
134 const Numeric R_sun = sun.distance;
135 const Numeric R_rte = refell2r(refellipsoid, rtp_pos[1]) + rtp_pos[0];
136
137 //Transform to cartesian coordinate system
138 Numeric r_sun_x, r_sun_y, r_sun_z;
139 Numeric r_rte_x, r_rte_y, r_rte_z;
140 Numeric r_los_x, r_los_y, r_los_z;
141
142 // r_sun
143 sph2cart(r_sun_x, r_sun_y, r_sun_z, R_sun, sun.latitude, sun.longitude);
144
145 // r_rte, r_los
146 poslos2cart(r_rte_x,
147 r_rte_y,
148 r_rte_z,
149 r_los_x,
150 r_los_y,
151 r_los_z,
152 R_rte,
153 rtp_pos[1],
154 rtp_pos[2],
155 rtp_los[0],
156 rtp_los[1]);
157
158 //Calculate vector of line of sight and unit vector pointing from
159 //ppath point to the sun.
160 const Numeric r_ps_x = r_sun_x - r_rte_x;
161 const Numeric r_ps_y = r_sun_y - r_rte_y;
162 const Numeric r_ps_z = r_sun_z - r_rte_z;
163
164 //abs value of r_ps
165 const Numeric r_ps =
166 sqrt(r_ps_x * r_ps_x + r_ps_y * r_ps_y + r_ps_z * r_ps_z);
167
168 //abs value of r_los
169 const Numeric r_glos =
170 sqrt(r_los_x * r_los_x + r_los_y * r_los_y + r_los_z * r_los_z);
171
172 //Calculate angle beta between line of sight and the line between ppath point and the sun
173 //using scalar product
174 const Numeric cos_beta =
175 (r_ps_x * r_los_x + r_ps_y * r_los_y + r_ps_z * r_los_z) / (r_ps * r_glos);
176 const Numeric beta = acos(cos_beta);
177
178 // angular radius of sun
179 const Numeric alpha = atan(sun.radius / r_ps);
180
181 //Check if we see the sun. We see the sun if the angle beta is smaller than
182 // the angular radius alpha of the sun.
183 if (beta <= alpha) {
184 //Here we assume that the sun radiates isotropically.
185 Matrix sun_radiance = sun.spectrum;
186 sun_radiance /= pi;
187
188 iy += sun_radiance;
189
190 // visibility flag
191 suns_visible = 1;
192 }
193}
194
196 ArrayOfMatrix& direct_radiation,
197 ArrayOfArrayOfTensor3& ddirect_radiation_dx,
198 const Index& stokes_dim,
199 const Vector& f_grid,
200 const Index& atmosphere_dim,
201 const Vector& p_grid,
202 const Vector& lat_grid,
203 const Vector& lon_grid,
204 const Tensor3& t_field,
205 const EnergyLevelMap& nlte_field,
206 const Tensor4& vmr_field,
207 const ArrayOfArrayOfSpeciesTag& abs_species,
208 const Tensor3& wind_u_field,
209 const Tensor3& wind_v_field,
210 const Tensor3& wind_w_field,
211 const Tensor3& mag_u_field,
212 const Tensor3& mag_v_field,
213 const Tensor3& mag_w_field,
214 const Index& cloudbox_on,
215 const ArrayOfIndex& cloudbox_limits,
216 const Index& gas_scattering_do,
217 const Index& irradiance_flag,
218 const ArrayOfPpath& sun_ppaths,
219 const ArrayOfSun& suns,
220 const ArrayOfIndex& suns_visible,
221 const Vector& refellipsoid,
222 const Tensor4& pnd_field,
223 const ArrayOfTensor4& dpnd_field_dx,
224 const ArrayOfString& scat_species,
225 const ArrayOfArrayOfSingleScatteringData& scat_data,
226 const Index& jacobian_do,
227 const ArrayOfRetrievalQuantity& jacobian_quantities,
228 const Agenda& propmat_clearsky_agenda,
229 const Agenda& water_p_eq_agenda,
230 const Agenda& gas_scattering_agenda,
231 const Numeric& rte_alonglos_v,
232 const Verbosity& verbosity) {
233 Vector sun_pos(3);
234
235 //dummy variables needed for the output and input of iyTransmission and
236 // gas_scattering_agenda
237 ArrayOfMatrix iy_aux_dummy;
238 ArrayOfString iy_aux_vars_dummy;
239 Vector ppvar_p_dummy;
240 Vector ppvar_t_dummy;
241 EnergyLevelMap ppvar_nlte_dummy;
242 Matrix ppvar_vmr_dummy;
243 Matrix ppvar_wind_dummy;
244 Matrix ppvar_mag_dummy;
245 Matrix ppvar_pnd_dummy;
246 Matrix ppvar_f_dummy;
247 Tensor3 ppvar_iy_dummy;
248 Tensor4 ppvar_trans_cumulat_dummy;
249 Tensor4 ppvar_trans_partial_dummy;
250
251 direct_radiation.resize(suns.nelem(),Matrix(f_grid.nelem(), stokes_dim, 0.));
252
253 Matrix radiation_toa;
254 Matrix radiation_trans;
255 ArrayOfTensor3 dradiation_trans;
256 Vector rtp_pos, rtp_los;
257 Index np;
258
259 for (Index i_sun = 0; i_sun < suns.nelem(); i_sun++) {
260 np = sun_ppaths[i_sun].np;
261
262 if (suns_visible[i_sun]) {
263 sun_pos = {suns[i_sun].distance,
264 suns[i_sun].latitude,
265 suns[i_sun].longitude};
266
267 // we need the distance to the sun relative to the surface
268 sun_pos[0] =
269 sun_pos[0] -
271 atmosphere_dim, refellipsoid, lat_grid, lon_grid, sun_pos);
272
273
274 if (irradiance_flag) {
275 //Get the spectral irradiance
276
277 //get the TOA distance to earth center.
278 Numeric R_TOA =
279 refell2r(refellipsoid, sun_ppaths[i_sun].pos(np - 1, 1)) +
280 sun_ppaths[i_sun].pos(np - 1, 0);
281
282 //get the distance between sun and sun_ppath at TOA
283 Numeric R_Sun2Toa;
284 distance3D(R_Sun2Toa,
285 R_TOA,
286 sun_ppaths[i_sun].pos(np - 1, 1),
287 sun_ppaths[i_sun].pos(np - 1, 2),
288 sun_pos[0],
289 sun_pos[1],
290 sun_pos[2]);
291
292 // Scale the incoming sun_irradiance spectrum
293 radiation_toa = suns[i_sun].spectrum;
294 radiation_toa *= suns[i_sun].radius * suns[i_sun].radius;
295 radiation_toa /= (suns[i_sun].radius * suns[i_sun].radius +
296 R_Sun2Toa * R_Sun2Toa);
297 } else {
298 //Get the spectral radiance instead
299
300 //Set sun position
301 rtp_pos.resize(atmosphere_dim);
302 rtp_pos = sun_ppaths[i_sun].pos(np - 1, Range(0, atmosphere_dim));
303 rtp_los.resize(sun_ppaths[i_sun].los.ncols());
304 rtp_los = sun_ppaths[i_sun].los(np - 1, joker);
305
306 radiation_toa.resize(f_grid.nelem(), stokes_dim);
307 radiation_toa = 0;
308
309 Index visible;
310 get_sun_radiation(radiation_toa, visible, suns[i_sun], rtp_pos, rtp_los, refellipsoid);
311 }
312
313
315 radiation_trans,
316 iy_aux_dummy,
317 dradiation_trans,
318 ppvar_p_dummy,
319 ppvar_t_dummy,
320 ppvar_nlte_dummy,
321 ppvar_vmr_dummy,
322 ppvar_wind_dummy,
323 ppvar_mag_dummy,
324 ppvar_pnd_dummy,
325 ppvar_f_dummy,
326 ppvar_iy_dummy,
327 ppvar_trans_cumulat_dummy,
328 ppvar_trans_partial_dummy,
329 stokes_dim,
330 f_grid,
331 atmosphere_dim,
332 p_grid,
333 t_field,
334 nlte_field,
335 vmr_field,
336 abs_species,
337 wind_u_field,
338 wind_v_field,
339 wind_w_field,
340 mag_u_field,
341 mag_v_field,
342 mag_w_field,
343 cloudbox_on,
344 cloudbox_limits,
345 gas_scattering_do,
346 pnd_field,
347 dpnd_field_dx,
348 scat_species,
349 scat_data,
350 iy_aux_vars_dummy,
351 jacobian_do,
352 jacobian_quantities,
353 sun_ppaths[i_sun],
354 radiation_toa,
355 propmat_clearsky_agenda,
356 water_p_eq_agenda,
357 gas_scattering_agenda,
358 1,
359 Tensor3(),
360 rte_alonglos_v,
361 verbosity);
362
363 if (jacobian_do && dradiation_trans.nelem()){
364 ddirect_radiation_dx[i_sun] = dradiation_trans;
365 }
366 direct_radiation[i_sun] = radiation_trans;
367 }
368 }
369}
370
372 ArrayOfPpath& sun_ppaths,
373 ArrayOfIndex& suns_visible,
374 ArrayOfVector& sun_rte_los,
375 const Vector& rte_pos,
376 const ArrayOfSun& suns,
377 const Vector& f_grid,
378 const Index& atmosphere_dim,
379 const Vector& p_grid,
380 const Vector& lat_grid,
381 const Vector& lon_grid,
382 const Tensor3& z_field,
383 const Matrix& z_surface,
384 const Vector& refellipsoid,
385 const Numeric& ppath_lmax,
386 const Numeric& ppath_lraytrace,
387 const Agenda& ppath_step_agenda,
388 const Verbosity& verbosity) {
389 Vector sun_pos(3);
390 Vector sun_rte_los_isun(2);
391 Numeric ppath_lraytrace2 = ppath_lraytrace;
392 Ppath sun_ppath;
393
394 for (Index i_sun = 0; i_sun < suns.nelem(); i_sun++) {
395 sun_pos = {suns[i_sun].distance,
396 suns[i_sun].latitude,
397 suns[i_sun].longitude};
398
399 // we need the distance to the sun relative to the surface
400 sun_pos[0] =
401 sun_pos[0] -
403 atmosphere_dim, refellipsoid, lat_grid, lon_grid, sun_pos);
404
405 // get the line of sight direction from sun i_sun to ppath point
407 atmosphere_dim,
408 lat_grid,
409 lon_grid,
410 refellipsoid,
411 rte_pos,
412 sun_pos,
413 verbosity);
414
415 // calculate ppath (sun path) from sun to ppath point
417 sun_ppath,
418 sun_rte_los_isun,
419 ppath_lraytrace2,
420 ppath_step_agenda,
421 atmosphere_dim,
422 p_grid,
423 lat_grid,
424 lon_grid,
425 z_field,
426 f_grid,
427 refellipsoid,
428 z_surface,
429 rte_pos,
430 sun_pos,
431 ppath_lmax,
432 2e-5,
433 5.,
434 0.5,
435 verbosity);
436
437 sun_ppaths[i_sun] = sun_ppath;
438 sun_rte_los[i_sun] = sun_rte_los_isun;
439
440 // Check that sun path hast more than 1 ppath points and that space is background
441 suns_visible[i_sun] =
442 sun_ppath.np > 1 && ppath_what_background(sun_ppath) == 9;
443 }
444}
445
446Matrix regrid_sun_spectrum(const GriddedField2 &sun_spectrum_raw,
447 const Vector &f_grid,
448 const Index &stokes_dim,
449 const Numeric &temperature,
450 const Verbosity &verbosity){
452
453 const Index nf = f_grid.nelem();
454 const Vector data_f_grid = sun_spectrum_raw.get_numeric_grid(0);
455 const Numeric data_fmin = data_f_grid[0];
456 const Numeric data_fmax = data_f_grid[data_f_grid.nelem() - 1];
457
458 // Result array
459 Matrix int_data(f_grid.nelem(), stokes_dim, 0.);
460
461 if (out3.sufficient_priority()) {
462 ostringstream os;
463 os << " f_grid: " << f_grid[0] << " - " << f_grid[nf - 1]
464 << " Hz\n"
465 << " data_f_grid: " << data_fmin << " - " << data_fmax << " Hz\n";
466 out3 << os.str();
467 }
468
469 const Numeric* f_grid_begin = f_grid.unsafe_data_handle();
470 const Numeric* f_grid_end = f_grid_begin + f_grid.nelem();
471 const Index i_fstart = std::distance(
472 f_grid_begin, std::lower_bound(f_grid_begin, f_grid_end, data_fmin));
473 const Index i_fstop =
474 std::distance(
475 f_grid_begin,
476 std::upper_bound(f_grid_begin + i_fstart, f_grid_end, data_fmax)) -
477 1;
478
479 // Ignore band if all frequencies are below or above data_f_grid:
480 if (i_fstart == nf || i_fstop == -1) {
481 out3 << "All frequencies are below or above the sun spectrum data";
482 }
483
484 const Index f_extent = i_fstop - i_fstart + 1;
485
486 if (out3.sufficient_priority()) {
487 ostringstream os;
488 os << " " << f_extent << " frequency extraction points starting at "
489 << "frequency index " << i_fstart << ".\n";
490 out3 << os.str();
491 }
492
493 // If f_extent is less than one, then the entire data_f_grid is between two
494 // grid points of f_grid. (So that we do not have any f_grid points inside
495 // data_f_grid.) Return also in this case.
496 if (f_extent < 1){
497 out3 << "The entire data lies inbetween two f_grid points (So no f_grid"
498 << " point inside the data_f_grid)";
499 }
500
501 // This is the part of f_grid that lies inside the spectrum data band
502 const ConstVectorView f_grid_active = f_grid[Range(i_fstart, f_extent)];
503
504 // Determine the index of the first grid points in the spectrum band that
505 // lies outside or on the boundary of the part of f_grid that lies inside
506 // the spectral band.
507 const Numeric f_grid_fmin = f_grid[i_fstart];
508 const Numeric f_grid_fmax = f_grid[i_fstop];
509
510 const Numeric* data_f_grid_begin = data_f_grid.unsafe_data_handle();
511 const Numeric* data_f_grid_end = data_f_grid_begin + data_f_grid.size() - 1;
512 const Index i_data_fstart =
513 std::distance(
514 data_f_grid_begin,
515 std::upper_bound(data_f_grid_begin, data_f_grid_end, f_grid_fmin)) -
516 1;
517 const Index i_data_fstop = std::distance(
518 data_f_grid_begin,
519 std::upper_bound(
520 data_f_grid_begin + i_data_fstart, data_f_grid_end, f_grid_fmax));
521
522 // Extent for active data frequency vector:
523 const Index data_f_extent = i_data_fstop - i_data_fstart + 1;
524
525 // For this range the interpolation will find place.
526 const Range active_range(i_data_fstart, data_f_extent);
527 const ConstVectorView data_f_grid_active = data_f_grid[active_range];
528
529 // Check if frequency is inside the range covered by the data:
530 chk_interpolation_grids("Frequency interpolation for cross sections",
531 data_f_grid,
532 f_grid_active);
533
534 {
535 // Find frequency grid positions:
536 ArrayOfGridPos f_gp(f_grid_active.nelem());
537 gridpos(f_gp, data_f_grid_active, f_grid_active, 0);
538
539 Matrix itw(f_gp.nelem(), 2);
540 interpweights(itw, f_gp);
541
542 for(int i=0; i < stokes_dim; i++){
543 interp(int_data(Range(i_fstart, f_extent),i), itw,
544 sun_spectrum_raw.data(active_range, i), f_gp);
545 }
546 }
547
548 // Padding
549 if (f_extent < nf){
550 if (temperature == -1){
552 "f_grid is (partially) outside the sun spectrum data"
553 "Set temperature to zero to have a padding of "
554 "0 or a fitting effective temperature"
555 "For further information take a look at the "
556 "documentation for regrid_sun_spectrum")
557 }
558 if (temperature > 0){
559 for (int i=0; i < i_fstart; i++){
560 int_data(i,0) = planck(f_grid[i], temperature);
561 }
562 for (Index i=f_extent; i < nf; i++){
563 int_data(i,0) = planck(f_grid[i], temperature);
564 }
565 }
566 }
567
568 return int_data;
569}
570
Declarations for agendas.
The global header file for ARTS.
Common ARTS conversions.
void gas_scattering_agendaExecute(Workspace &ws, PropagationMatrix &gas_scattering_coef, TransmissionMatrix &gas_scattering_mat, Vector &gas_scattering_fct_legendre, const Vector &f_grid, const Numeric rtp_pressure, const Numeric rtp_temperature, const Vector &rtp_vmr, const Vector &gas_scattering_los_in, const Vector &gas_scattering_los_out, const Index gas_scattering_output_type, const Agenda &input_agenda)
Definition auto_md.cc:26834
void chk_interpolation_grids(const String &which_interpolation, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac, const bool islog)
Check interpolation grids.
The Agenda class.
This can be used to make arrays out of anything.
Definition array.h:31
Index nelem() const ARTS_NOEXCEPT
Definition array.h:75
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
Workspace class.
Helper macros for debugging.
#define ARTS_USER_ERROR(...)
Definition debug.h:153
void distance3D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &r2, const Numeric &lat2, const Numeric &lon2)
distance3D
Definition geodetic.cc:652
void sph2cart(Numeric &x, Numeric &y, Numeric &z, const Numeric &r, const Numeric &lat, const Numeric &lon)
sph2cart
Definition geodetic.cc:1349
Numeric refell2r(ConstVectorView refellipsoid, const Numeric &lat)
refell2r
Definition geodetic.cc:1248
Numeric pos2refell_r(const Index &atmosphere_dim, ConstVectorView refellipsoid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView rte_pos)
pos2refell_r
Definition geodetic.cc:1194
void poslos2cart(Numeric &x, Numeric &z, Numeric &dx, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &za)
poslos2cart
Definition geodetic.cc:338
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
void rte_losGeometricFromRtePosToRtePos2(Vector &rte_los, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Vector &rte_pos, const Vector &rte_pos2, const Verbosity &)
WORKSPACE METHOD: rte_losGeometricFromRtePosToRtePos2.
Definition m_ppath.cc:2040
void ppathFromRtePos2(Workspace &ws, Ppath &ppath, Vector &rte_los, Numeric &ppath_lraytrace, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &f_grid, const Vector &refellipsoid, const Matrix &z_surface, const Vector &rte_pos, const Vector &rte_pos2, const Numeric &ppath_lmax, const Numeric &za_accuracy, const Numeric &pplrt_factor, const Numeric &pplrt_lowest, const Verbosity &verbosity)
WORKSPACE METHOD: ppathFromRtePos2.
Definition m_ppath.cc:858
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, Tensor4 &ppvar_trans_partial, 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 Index &gas_scattering_do, 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 Matrix &iy_transmitter, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &gas_scattering_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Numeric &rte_alonglos_v, const Verbosity &)
WORKSPACE METHOD: iyTransmissionStandard.
Declarations having to do with the four output streams.
#define CREATE_OUTS
Definition messages.h:191
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
constexpr Numeric sigma
Stefan-Boltzmann constant convenience name [W/(K^4*m^2)].
Numeric planck(const Numeric &f, const Numeric &t)
planck
This file contains declerations of functions of physical character.
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Definition ppath.cc:1460
The structure to describe a propagation path and releated quantities.
Matrix los
Line-of-sight at each ppath point.
Index np
Number of points describing the ppath.
Matrix pos
The distance between start pos and the last position in pos.
Radiation Vector for Stokes dimension 1-4.
void leftMul(const TransmissionMatrix &T)
Multiply radiation vector from the left.
The structure to describe a propagation path and releated quantities.
Definition sun.h:38
String description
Sun description.
Definition sun.h:40
Matrix spectrum
Sun spectrum, monochrmatic radiance spectrum at the surface of the sun.
Definition sun.h:42
Numeric latitude
latitude of the sun in the sky of the planet
Definition sun.h:48
Numeric longitude
longitude of the sun in the sky of the planet
Definition sun.h:50
Numeric distance
distance from center of planet to center of sun
Definition sun.h:46
Numeric radius
Sun radius.
Definition sun.h:44
Class to keep track of Transmission Matrices for Stokes Dim 1-4.
void get_direct_radiation(Workspace &ws, ArrayOfMatrix &direct_radiation, ArrayOfArrayOfTensor3 &ddirect_radiation_dx, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_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 Index &gas_scattering_do, const Index &irradiance_flag, const ArrayOfPpath &sun_ppaths, const ArrayOfSun &suns, const ArrayOfIndex &suns_visible, const Vector &refellipsoid, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &gas_scattering_agenda, const Numeric &rte_alonglos_v, const Verbosity &verbosity)
Calculates the transmitted sun radiation at the end position of the ppath.
Definition sun.cc:195
std::ostream & operator<<(std::ostream &os, const Sun &sun)
Definition sun.cc:35
void get_sun_ppaths(Workspace &ws, ArrayOfPpath &sun_ppaths, ArrayOfIndex &suns_visible, ArrayOfVector &sun_rte_los, const Vector &rte_pos, const ArrayOfSun &suns, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &z_surface, const Vector &refellipsoid, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Agenda &ppath_step_agenda, const Verbosity &verbosity)
Calculates the ppath towards the suns from a given position and indicates if sun is visible or not.
Definition sun.cc:371
void get_sun_radiation(Matrix &iy, Index &suns_visible, const Sun &sun, const Vector &rtp_pos, const Vector &rtp_los, const Vector &refellipsoid)
Checks and adds sun radiance if sun is in line of sight.
Definition sun.cc:126
Matrix regrid_sun_spectrum(const GriddedField2 &sun_spectrum_raw, const Vector &f_grid, const Index &stokes_dim, const Numeric &temperature, const Verbosity &verbosity)
regrid_sun_spectrum
Definition sun.cc:446
void get_scattered_sunsource(Workspace &ws, RadiationVector &scattered_sunlight, const Vector &f_grid, const Numeric &p, const Numeric &T, const Vector &vmr, const Matrix &transmitted_sunlight, const Vector &gas_scattering_los_in, const Vector &gas_scattering_los_out, const Agenda &gas_scattering_agenda)
Calculates the radiance spectrum of sun which is scattered by the atmospheric gases.
Definition sun.cc:45
void get_sun_background(Matrix &iy, Index &suns_visible, const ArrayOfSun &suns, const Ppath &ppath, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &refellipsoid)
Gets the sun background for a given ppath.
Definition sun.cc:96
Declaration of functions in star.cc.
This file contains the Workspace class.