7 const double* depolar_fact,
10 double* rayleigh_cross_section);
23 : pres(Pres), alt(Alt), cache_is_stale(true),
24 a(C.rayleigh_a().
value), b(C.rayleigh_b().
value),
25 depolar_fact(C.rayleigh_depolarization_factor()),
28 pres->add_observer(*
this);
30 a->add_observer(*
this);
42 double rayleigh_cross_section;
47 rayleigh_wrap(&wn, &depolar_fact, &a, &b, &rayleigh_cross_section);
68 double rayleigh_cross_section;
70 rayleigh_wrap(&wn, &depolar_fact, &a, &b, &rayleigh_cross_section);
72 res.
value() *= rayleigh_cross_section;
73 res.
jacobian() *= rayleigh_cross_section;
80 void Rayleigh::fill_cache()
const 91 const double a0 = 6.02297e26;
93 int nvar = pres->pressure_grid().value.number_variable();
94 for(
int i = 0; i < (int) alt.size(); ++i)
95 nvar = std::max(nvar, alt[i]->gravity(pres->pressure_grid()(0)).value.number_variable());
96 part_independent_wn.
resize((
int) alt.size(), pres->number_layer(), nvar);
97 for(
int i = 0; i < part_independent_wn.
cols(); ++i)
98 for(
int j = 0; j < part_independent_wn.
rows(); ++j) {
100 pres->pressure_grid()(i);
102 pres->pressure_grid()(i) + deltap / 2;
104 (molar_weight_dry_air * alt[j]->gravity(play).convert(
Unit(
"m/s^2")).value);
106 cache_is_stale =
false;
#define range_check(V, Min, Max)
Range check.
DoubleWithUnit convert_wave(const Unit &R) const
We often need to handle conversion from wavenumber to/from wavelength.
This is a AutoDerivative that also has units associated with it.
AutoDerivativeWithUnit< T > convert(const Unit &R) const
Convert to the given units.
virtual DoubleWithUnit rayleigh_a() const =0
Rayleigh "a" value.
Rayleigh(const boost::shared_ptr< Pressure > &Pres, const std::vector< boost::shared_ptr< Altitude > > &Alt, const Constant &C)
Constructor.
const Unit Pa("Pa", N/(m *m))
ArrayAd< double, 1 > optical_depth_each_layer(double wn, int spec_index) const
This gives the optical depth for each layer, for the given wave number.
const blitz::Array< T, D+1 > jacobian() const
Apply value function to a blitz array.
const blitz::Array< T, D > & value() const
const Unit inv_cm("cm^-1", pow(cm, -1))
void resize(const blitz::TinyVector< int, D > &Shape, int nvar)
This class contains various constants.
virtual double rayleigh_depolarization_factor() const =0
Rayleigh depolarization factor.
static DoubleWithUnit cross_section(const DoubleWithUnit &W, const Constant &C=DefaultConstant())
Calculate the rayleigh cross section for the given wavenumber/wavelength.
const double molar_weight_dry_air
Molar weight of dry air, in g mol^-1.
We frequently have a double with units associated with it.
Libraries such as boost::units allow unit handling where we know the units at compile time...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
virtual DoubleWithUnit rayleigh_b() const =0
Rayleigh "b" value.
void rayleigh_wrap(const double *wn, const double *depolar_fact, const double *a, const double *b, double *rayleigh_cross_section)
double value(const FullPhysics::AutoDerivative< double > &Ad)