5 #include <boost/progress.hpp> 12 .def(luabind::constructor<
const blitz::Array<double, 1>&,
13 const blitz::Array<bool, 1>&,
24 (
const blitz::Array<double, 1>& Coeff,
25 const blitz::Array<bool, 1>& Used_flag,
31 const Unit& Retrieval_unit)
33 lza(Lza), reference(Reference), retrieval_unit(Retrieval_unit),
34 spec_index(Spec_index), stokes_coef(Stokes_coef)
51 double lza_sec = 1.0 / cos(lza.convert(
units::rad).value);
54 Logger::info() <<
"Adding fluorescence to band: " + boost::lexical_cast<std::string>(spec_index + 1) +
"\n";
67 Array<double, 1> spec_samp_wn =
72 for(
int wn_idx = 0; wn_idx < spec_samp_wn.rows(); wn_idx++) {
77 fluor_effect_rt.
resize(spec_samp_wn.rows(),
80 fluor_effect_rt(wn_idx) = f_surf * exp(-1 * o2_col_abs * lza_sec);
93 if (rt_solar_rad.rows() != f_contrib_ad.rows()) {
94 std::stringstream err_msg;
95 err_msg <<
"Interpolated fluorescence size: " << f_contrib_ad.rows()
96 <<
" does not match radiance size: " << rt_solar_rad.rows();
101 if(rt_solar_rad.number_variable() == 0 && f_contrib_ad.number_variable() > 0) {
102 rt_solar_rad.resize_number_variable(f_contrib_ad.number_variable());
105 for(
int wn_idx = 0; wn_idx < rt_solar_rad.rows(); wn_idx++) {
106 rt_solar_rad(wn_idx) = rt_solar_rad(wn_idx) +
107 stokes_coef->stokes_coefficient()(spec_index, 0) * f_contrib_ad(wn_idx);
116 atm_oco, stokes_coef, lza, spec_index,
117 reference, retrieval_unit));
123 Os <<
"FluorescenceEffect" << std::endl
124 <<
" Coefficient: " << coefficient().value() <<
"\n" 125 <<
" Retrieval flag: " << used_flag_value() <<
"\n" 126 <<
" Zenith angle: " << lza <<
"\n" 127 <<
" Reference point: " << reference <<
"\n";
128 opad << *stokes_coef;
const SpectralDomain high_resolution_grid(int Spec_index) const
The high resolution grid, possibly nonuniform.
This is a filtering stream that adds a pad to the front of every line written out.
virtual void apply_effect(Spectrum &Spec, const ForwardModelSpectralGrid &Forward_model_grid) const
Apply correction to spectrum in place.
As a design principle, we have each base class with the absolutely minimum interface needed for use f...
This is the Forward Model spectral grid.
This is the base of the exception hierarchy for Full Physics code.
double conversion(const Unit &Dunit_from, const Unit &Dunit_to)
Return conversion factor to go from one unit to another.
Spectrum interpolate_spectrum(const Spectrum &Spec_in, int Spec_index) const
Interpolate a spectrum to the high_resolution_interpolated_grid() sampling.
const SpectralRange & spectral_range() const
Spectral range (e.g, radiance values)
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Implements adding the effect of fluorescence to A-Band spectrum by using a retrievable across the ban...
Apply value function to a blitz array.
virtual void print(std::ostream &Os) const
This class models models any effects that need to be applied to high resolution spectra after the rad...
FluorescenceEffect(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const boost::shared_ptr< RtAtmosphere > &Atm, const boost::shared_ptr< StokesCoefficient > &Stokes_coef, const DoubleWithUnit &Lza, const int Spec_index, const DoubleWithUnit &Reference, const Unit &Retrieval_unit)
const Unit inv_cm("cm^-1", pow(cm, -1))
void resize(const blitz::TinyVector< int, D > &Shape, int nvar)
const Unit & units() const
Units of data.
FunctionTimer function_timer(bool Auto_log=false) const
Function timer.
This is a full spectrum, which contains a SpectralRange and SpectralDomain.
virtual boost::shared_ptr< SpectrumEffect > clone() const
Clone a SpectrumEffect object.
int number_variable() const
Number of variables in gradient.
We frequently have a double with units associated with it.
We have a number of different spectrums that appear in different parts of the code.
const ArrayAd< double, 1 > & data_ad() const
Underlying data, possibly with a Jacobian.
This is a simple timer class that can be used to accumulate the time spent in multiple calls to a fun...
Libraries such as boost::units allow unit handling where we know the units at compile time...
blitz::Array< double, 1 > wavenumber(const Unit &Units=units::inv_cm) const
Return data as wavenumbers.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
virtual boost::shared_ptr< ArrayAdCache< double, double, 1 > > & column_optical_depth_cache()
const T & value() const
Convert to type T.
#define REGISTER_LUA_END()
Caches ArrayAd objects using a std::map.
This class maintains the atmosphere portion of the state, and uses this to set up the atmosphere and ...
Helper class for AccumulatedTimer.
const Unit rad("rad", 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0)