4 #include <boost/lexical_cast.hpp> 12 .def(luabind::constructor<
const blitz::Array<double, 2>&,
13 const blitz::Array<bool, 2>&,
15 const std::vector<std::string>&>())
20 const blitz::Array<bool, 2>& Flag,
22 const std::vector<std::string>& Desc_band_names)
23 : reference_points(Ref_points), desc_band_names(Desc_band_names)
25 if(Spec_coeffs.rows() != Flag.rows()) {
27 err_msg <<
"Number of spectrometers in Spec_coeffs: " << Spec_coeffs.rows() <<
" does not match the number in Flag: " << Flag.rows();
31 if(Spec_coeffs.cols() != Flag.cols()) {
33 err_msg <<
"Number of parameters in Spec_coeffs: " << Spec_coeffs.cols() <<
" does not match the number in Flag: " << Flag.cols();
37 if(Spec_coeffs.rows() != Ref_points.
rows()) {
39 err_msg <<
"Number of spectrometers in Spec_coeffs: " << Spec_coeffs.rows() <<
" does not match the number in Ref_points: " << Ref_points.
rows();
43 if(Spec_coeffs.rows() != (int) Desc_band_names.size()) {
45 err_msg <<
"Number of spectrometers in Spec_coeffs: " << Spec_coeffs.rows() <<
" does not match the number in Desc_band_names: " << Desc_band_names.size();
50 Array<double, 2> spec_coeffs(Spec_coeffs);
51 Array<bool, 2> flags(Flag);
54 init(Array<double, 1>(spec_coeffs.dataFirst(), TinyVector<int, 1>(Spec_coeffs.rows() * Spec_coeffs.cols()), blitz::neverDeleteData),
55 Array<bool, 1>(flags.dataFirst(), TinyVector<int, 1>(Flag.rows() * Flag.cols()), blitz::neverDeleteData));
60 const blitz::Array<bool, 1>& Flag,
62 const std::vector<std::string>& Desc_band_names)
64 reference_points(Ref_points), desc_band_names(Desc_band_names)
83 return surface_poly(
wn - ref_wn);
100 return Array<double, 2>(0, 0);
104 int offset = num_params * spec_index;
106 blitz::Array<double, 2>
cov(num_params, num_params);
107 for (
int param_a = 0; param_a < num_params; param_a++) {
108 for (
int param_b = 0; param_b < num_params; param_b++) {
122 return "Ground Lambertian " + desc_band_names[b_idx] +
" Albedo Parm " + boost::lexical_cast<std::string>(c_idx + 1);
128 Os <<
"GroundLambertian:" << std::endl;
130 opad <<
"Band: " << desc_band_names[b_idx] << std::endl
139 opad << std::endl <<
"Reference Point: " << reference_points(b_idx) << std::endl;
virtual const ArrayAd< double, 1 > albedo_coefficients(const int spec_index) const
#define range_check(V, Min, Max)
Range check.
virtual const int number_params() const
virtual const AutoDerivative< double > albedo(const DoubleWithUnit wave_point, const int spec_index) const
DoubleWithUnit convert_wave(const Unit &R) const
We often need to handle conversion from wavenumber to/from wavelength.
virtual void print(std::ostream &Os) const
blitz::Array< double, 2 > cov
Last covariance matrix updated from the StateVector.
This is a filtering stream that adds a pad to the front of every line written out.
This class implements a Lambertian albedo as a ground type.
This is the base of the exception hierarchy for Full Physics code.
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
const blitz::Array< bool, 1 > & used_flag_value() const
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
This class maintains the ground portion of the state.
Apply value function to a blitz array.
const blitz::Array< T, D > & value() const
const Unit inv_cm("cm^-1", pow(cm, -1))
virtual const blitz::Array< double, 2 > albedo_covariance(const int spec_index) const
A one-dimensional polynomial class.
virtual const int number_spectrometer() const
const blitz::Array< double, 2 > & statevector_covariance() const
int number_variable() const
Number of variables in gradient.
We frequently have a double with units associated with it.
GroundLambertian(const blitz::Array< double, 2 > &Spec_coeffs, const blitz::Array< bool, 2 > &Flag, const ArrayWithUnit< double, 1 > &Ref_points, const std::vector< std::string > &Desc_band_names)
const ArrayAd< double, 1 > & coefficient() const
It is common to have a class that is an Observable with a set of coefficients, a subset of which are ...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
void init(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const boost::shared_ptr< Pressure > &Press=boost::shared_ptr< Pressure >(), bool Mark_according_to_press=true, int Pdep_start=0)
#define REGISTER_LUA_END()
virtual ArrayAd< double, 1 > surface_parameter(const double wn, const int spec_index) const
Surface parmeters.
virtual boost::shared_ptr< Ground > clone() const
Clone a Ground object.
double value(const FullPhysics::AutoDerivative< double > &Ad)
ArrayWithUnit< T, D > convert_wave(const Unit &R) const
We often need to handle conversion from wavenumber to/from wavelength.