ARTS 2.5.11 (git: 6827797f)
sun.cc File Reference

Functions needed for radiative transfer with direct sources. More...

#include "sun.h"
#include "auto_md.h"
#include "agenda_class.h"
#include "arts_conversions.h"
#include "check_input.h"
#include "debug.h"
#include "matpack_data.h"
#include "messages.h"
#include "physics_funcs.h"
#include "propagationmatrix.h"
#include "geodetic.h"
#include "arts.h"
#include "workspace_ng.h"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const Sun &sun)
 
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.
 
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.
 
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.
 
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.
 
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.
 
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
 

Detailed Description

Functions needed for radiative transfer with direct sources.

Author
Jon Petersen jon.p.nosp@m.eter.nosp@m.sen@s.nosp@m.tudi.nosp@m.um.un.nosp@m.i-ha.nosp@m.mburg.nosp@m..de Manfred Brath manfr.nosp@m.ed.b.nosp@m.rath@.nosp@m.uni-.nosp@m.hambu.nosp@m.rg.d.nosp@m.e
Date
2021-02-22

Definition in file sun.cc.

Function Documentation

◆ get_direct_radiation()

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.

Parameters
[in,out]wsARTS workspace.
[out]direct_radiationMatrix Transmitted monochromatic irradiance spectrum of sun.
[out]ddirect_radiation_dxArray of Tensor3 Jacobian of transmitted monochromatic irradiance spectrum of sun.
[in]stokes_dimAs the WSV.
[in]f_gridAs the WSV.
[in]atmosphere_dimAs the WSV.
[in]p_gridAs the WSV.
[in]lat_gridAs the WSV.
[in]lon_gridAs the WSV.
[in]t_fieldAs the WSV.
[in]nlte_fieldAs the WSV.
[in]vmr_fieldAs the WSV.
[in]abs_speciesAs the WSV.
[in]wind_u_fieldAs the WSV.
[in]wind_v_fieldAs the WSV.
[in]wind_w_fieldAs the WSV.
[in]mag_u_fieldAs the WSV.
[in]mag_v_fieldAs the WSV.
[in]mag_w_fieldAs the WSV.
[in]cloudbox_onAs the WSV.
[in]cloudbox_limitsAs the WSV.
[in]gas_scattering_doAs the WSV.
[in]irradiance_flagIndex Flag indicating if the transmitted radiation is spectral irradiance (1) or if it is spectral radiance (0).
[in]sun_ppathsArrayOfPpath Propagation path towards each sun.
[in]sunsAs the WSV.
[in]suns_visibleArrayOfIndex Flag indicating if eah sun is visible.
[in]refellipsoidAs the WSV.
[in]pnd_fieldAs the WSV.
[in]dpnd_field_dxAs the WSV.
[in]scat_speciesAs the WSV.
[in]scat_dataAs the WSV.
[in]jacobian_doAs the WSV.
[in]jacobian_quantitiesAs the WSV.
[in]propmat_clearsky_agendaAs the WSV.
[in]water_p_eq_agendaAs the WSV.
[in]gas_scattering_agendaAs the WSV.
[in]ppath_step_agendaAs the WSV.
[in]rte_alonglos_vAs the WSV.
[in]verbosityVerbosity.

Definition at line 195 of file sun.cc.

References distance3D(), get_sun_radiation(), iyTransmissionStandard(), Array< base >::nelem(), pos2refell_r(), and refell2r().

Referenced by iyClearsky(), and iySurfaceLambertianDirect().

◆ get_scattered_sunsource()

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.

Parameters
[in,out]wsARTS workspace.
[out]scattered_sunlightRadiationVector scattered monochromatic radiance spectrum of sun.
[in]f_gridVector frequency grid.
[in]pNumeric pressure at location of scattering.
[in]TNumeric temperature at location of scattering.
[in]vmrVector volume mixing ratios of absorption species at location of scattering.
[in]transmitted_sunlightMatrix transmitted monochromatic irradiance spectrum of sun at location of scattering.
[in]gas_scattering_los_inVector incoming direction of the transmitted sun irradiance spectrum.
[in]gas_scattering_los_outoutgoing direction of the transmitted sun irradiance spectrum.
[in]gas_scattering_agendaAgenda agenda calculating the gas scattering cross sectionand matrix.

Definition at line 45 of file sun.cc.

References gas_scattering_agendaExecute(), and RadiationVector::leftMul().

Referenced by iyClearsky().

◆ get_sun_background()

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.

iy is zero if there is no sun in the line of sight at TOA.

Parameters
[out]iyMatrix radiance spectrum of suns.
[out]suns_visibleIndex indicating if suns are in los
[in]sunsArray of sun (structures).
[in]ppathPropagation path as the WSV.
[in]f_gridVector as the WSV.
[in]stokes_dimIndex as the WSV.
[in]atmosphere_dimIndex as the WSV.
[in]refellipsoidVector as the WSV.

Definition at line 96 of file sun.cc.

References get_sun_radiation(), Ppath::los, Array< base >::nelem(), Ppath::np, Ppath::pos, and ppath_what_background().

Referenced by iyClearsky(), and surface_get_incoming_direct().

◆ get_sun_ppaths()

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.

Parameters
[in,out]wsARTS workspace.
[out]sun_ppathsArrayOfPpath Propagation path towards each sun.
[out]suns_visibleArrayOfIndex Flag indicating if eah sun is visible.
[out]sun_rte_losArrayOfVector Incoming direction of the each transmitted sun radiation.
[in]rte_posAs the WSV.
[in]sunsAs the WSV.
[in]f_gridAs the WSV.
[in]atmosphere_dimAs the WSV.
[in]p_gridAs the WSV.
[in]lat_gridAs the WSV.
[in]lon_gridAs the WSV.
[in]z_fieldAs the WSV.
[in]z_surfaceAs the WSV.
[in]refellipsoidAs the WSV.
[in]ppath_lmaxAs the WSV.
[in]ppath_lraytraceAs the WSV.
[in]ppath_step_agendaAs the WSV.
[in]verbosityVerbosity.

Definition at line 371 of file sun.cc.

References Array< base >::nelem(), Ppath::np, pos2refell_r(), ppath_what_background(), ppathFromRtePos2(), and rte_losGeometricFromRtePosToRtePos2().

Referenced by iyClearsky(), and iySurfaceLambertianDirect().

◆ get_sun_radiation()

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.

Parameters
[in,out]iyMatrix of sun.
[out]suns_visibleIndex indicating if sun are in los
[in]sunSun-structure.
[in]rtp_posThe position of the ppath point.
[in]rtp_losThe line of sight of the ppath.
[in]refellipsoidAs the WSV with the same name.

Definition at line 126 of file sun.cc.

References Sun::distance, Sun::latitude, Sun::longitude, poslos2cart(), Sun::radius, refell2r(), Sun::spectrum, and sph2cart().

Referenced by get_direct_radiation(), and get_sun_background().

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Sun sun 
)

Definition at line 35 of file sun.cc.

◆ regrid_sun_spectrum()

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

Regrids a given spectrum from a griddedfield2 to the f_grid. if the f_grid covers a larger range as the given one, one can choose between two padding options: zeros: Intensities outside the given spectrum are set to zero planck: Intensities outside the given spectrum are initilizied with the black body value at that frequency.

Parameters
[in]sun_spectrum_rawgf2 of the given spectrum.
[in]f_gridf_grid for the calculation.
[in]stokes_dimstokes_dim for the calculation.
[in]temperatureTemperature for the planck padding.
Returns
interpolated spectrum
Author
Jon Petersen
Date
2022-01-19

Definition at line 446 of file sun.cc.

References ARTS_USER_ERROR, chk_interpolation_grids(), CREATE_OUTS, GriddedField2::data, GriddedField::get_numeric_grid(), gridpos(), interp(), interpweights(), Array< base >::nelem(), and planck().

Referenced by sunsAddSingleFromGrid(), and sunsAddSingleFromGridAtLocation().