10 const blitz::Array<double, 1>& Sza,
28 const blitz::Array<double, 1>& Sza)
32 atm->add_observer(*
this);
35 chapman_cache_stale.resize(Sza.rows());
36 chapman_cache_stale =
true;
38 chapman_boa.resize(Sza.rows());
42 const blitz::Array<double, 1>& Sza,
44 : spec_bound(Spec_bound), atm(Atm), sza(Sza)
47 atm->add_observer(*
this);
51 chapman_cache_stale =
true;
56 void ChapmanBoaRT::compute_chapman_factors(
const int spec_idx)
const {
58 if(chapman_cache_stale(spec_idx)) {
61 double rfindex_param = 0.000288;
65 bool can_use_oco_refr = atm->absorber_ptr()->gas_index(
"CO2") != -1 and
66 atm->absorber_ptr()->gas_index(
"H2O") != -1;
69 Array<AutoDerivative<double>, 1> height_grid( atm->altitude(spec_idx).convert(
units::km).value.to_array() );
70 Array<AutoDerivative<double>, 1> press_grid( atm->pressure_ptr()->pressure_grid().convert(
units::Pa).value.to_array() );
71 Array<AutoDerivative<double>, 1> temp_grid(press_grid.rows());
72 Array<AutoDerivative<double>, 1> co2_vmr(press_grid.rows());
73 Array<AutoDerivative<double>, 1> h2o_vmr(press_grid.rows());
74 for(
int i = 0; i < temp_grid.rows(); ++i) {
78 if(can_use_oco_refr) {
79 co2_vmr(i) = atm->absorber_ptr()->absorber_vmr(
"CO2")->
80 volume_mixing_ratio(press_grid(i));
81 h2o_vmr(i) = atm->absorber_ptr()->absorber_vmr(
"H2O")->
82 volume_mixing_ratio(press_grid(i));
87 double ref_wavelength;
97 refr_index.reset(
new OcoRefractiveIndex(ref_wavelength, press_grid, temp_grid, co2_vmr, h2o_vmr));
104 chapman_boa[spec_idx].reset(
new ChapmanBOA(rearth, sza(spec_idx), height_grid, refr_index) );
107 chapman_cache_stale(spec_idx) =
false;
113 int Spec_index,
bool Skip_jacobian)
const 132 compute_chapman_factors(Spec_index);
138 for(
int i = 0; i <
wn.rows(); ++i) {
139 trans(i, 0) =
value( chapman_boa[Spec_index]->transmittance(atm->optical_depth_wrt_state_vector(
wn(i), Spec_index).to_array(), 0) );
151 compute_chapman_factors(Spec_index);
157 for(
int i = 0; i <
wn.extent(firstDim); ++i) {
158 AutoDerivative<double> trans_wn = chapman_boa[Spec_index]->transmittance(atm->optical_depth_wrt_state_vector(
wn(i), Spec_index).to_array(), 0);
160 trans_jac(i, 0) = trans_wn;
169 Os <<
"ChapmanBoaRT";
172 Os <<
"\nAtmosphere:\n";
173 opad << *atm <<
"\n";
static AccumulatedTimer timer
This is a AutoDerivative that also has units associated with it.
This is a filtering stream that adds a pad to the front of every line written out.
boost::shared_ptr< RadiativeTransfer > chapman_boa_rt_create(const boost::shared_ptr< RtAtmosphere > &Atm, const blitz::Array< double, 1 > &Sza, const SpectralBound &Spec_bound)
const DoubleWithUnit wgs84_a(6378137.0000, units::m)
Equatorial radius.
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
const Unit Pa("Pa", N/(m *m))
Computes refractive index per level/layer using a simple approximation using pressure and temperature...
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
ChapmanBoaRT(const boost::shared_ptr< AtmosphereOco > &Atm, const blitz::Array< double, 1 > &Sza)
virtual blitz::Array< double, 2 > stokes(const SpectralDomain &Spec_domain, int Spec_index) const
Calculate stokes vector for the given set of wavenumbers/wavelengths.
virtual int number_stokes() const
Number of stokes parameters we will return in stokes and stokes_and_jacobian.
const Unit micron("micron", 1e-6 *m)
Apply value function to a blitz array.
This runs a Radiative Transfer code to determine the reflectance for a given set of wavelengths...
FunctionTimer function_timer(bool Auto_log=false) const
Function timer.
This is a full spectrum, which contains a SpectralRange and SpectralDomain.
This gives the upper and lower bounds of the SpectralWindow.
const Unit K("K", 1.0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0)
virtual ArrayAd< double, 2 > stokes_and_jacobian(const SpectralDomain &Spec_domain, int Spec_index) const
Calculate stokes vector for the given set of wavenumbers/wavelengths.
virtual Spectrum reflectance(const SpectralDomain &Spec_domain, int Spec_index, bool Skip_jacobian=false) const
Calculate reflectance for the given set of wavenumbers/wavelengths.
boost::shared_ptr< boost::progress_display > progress_display(const blitz::Array< double, 1 > &wn) const
Helper routine, creates a progress meter.
int number_variable() const
Number of variables in gradient.
const Unit inv_sr("sr^-1", pow(sr, -1))
DoubleWithUnit convert(const Unit &R) const
Convert to the given units.
We have a number of different spectrums that appear in different parts of the code.
virtual void print(std::ostream &Os, bool Short_form=false) const
Print to stream.
void reference(const ArrayAd< T, D > &V)
Computes refractive index per level/layer using a method that takes into account knowledge of OCO spe...
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.
#define REGISTER_LUA_END()
def(luabind::constructor< int >()) .def("rows"
int number_spectrometer() const
Number of spectrometers.
Helper class for AccumulatedTimer.
static bool wavelength_in_bounds(double wavelength)
Determines if the passed wavelength value in microns is within the bounds of those accepted by the cl...
const Unit km("km", 1e3 *m)
double value(const FullPhysics::AutoDerivative< double > &Ad)
This class computes Bottom of the Atmosphere radiance.
DoubleWithUnit center(int Spec_index, const Unit &U) const
Center between lower_bound and upper_bound.