17 double exact_brdf_value_veg_f(
const double* params,
const double* sza,
const double* vza,
const double* azm);
24 double black_sky_albedo_simple_veg(
const blitz::Array<double, 1>& params,
const double sza) {
28 double black_sky_albedo_simple_soil(
const blitz::Array<double, 1>& params,
const double sza) {
32 double exact_brdf_value_simple_veg(
const blitz::Array<double, 1>& params,
const double sza,
const double vza,
const double azm) {
36 double exact_brdf_value_simple_soil(
const blitz::Array<double, 1>& params,
const double sza,
const double vza,
const double azm) {
41 .def(luabind::constructor<
const blitz::Array<double, 2>&,
const blitz::Array<bool, 2>&,
const ArrayWithUnit<double, 1>&,
const std::vector<std::string>&>())
44 luabind::def(
"black_sky_albedo", &black_sky_albedo_simple_veg)
48 luabind::def(
"kernel_value", &exact_brdf_value_simple_veg)
53 .def(luabind::constructor<
const blitz::Array<double, 2>&,
const blitz::Array<bool, 2>&,
const ArrayWithUnit<double, 1>&,
const std::vector<std::string>&>())
56 luabind::def(
"black_sky_albedo", &black_sky_albedo_simple_soil)
60 luabind::def(
"kernel_value", &exact_brdf_value_simple_soil)
80 const blitz::Array<bool, 2>& Flag,
82 const std::vector<std::string>& Desc_band_names)
83 : reference_points(Ref_points), desc_band_names(Desc_band_names)
87 err_msg <<
"Number of parameters in Coeffs: " << Coeffs.cols() <<
" is not " <<
NUM_COEFF <<
" as expected";
91 if(Coeffs.rows() != Flag.rows()) {
93 err_msg <<
"Number of spectrometers in Coeffs: " << Coeffs.rows() <<
" does not match the number in Flag: " << Flag.rows();
97 if(Coeffs.cols() != Flag.cols()) {
99 err_msg <<
"Number of parameters in Coeffs: " << Coeffs.cols() <<
" does not match the number in Flag: " << Flag.cols();
103 if(Coeffs.rows() != (int) Desc_band_names.size()) {
105 err_msg <<
"Number of spectrometers in Coeffs: " << Coeffs.rows() <<
" does not match the number in Desc_band_names: " << Desc_band_names.size();
109 if(Ref_points.
rows() != (int) Desc_band_names.size()) {
111 err_msg <<
"Number of spectrometers in Ref_points: " << Ref_points.
rows() <<
" does not match the number in Desc_band_names: " << Desc_band_names.size();
116 Array<double, 2> coeffs(Coeffs);
117 Array<bool, 2> flags(Flag);
120 init(Array<double, 1>(coeffs.dataFirst(), TinyVector<int, 1>(Coeffs.rows() * Coeffs.cols()), blitz::neverDeleteData),
121 Array<bool, 1>(flags.dataFirst(), TinyVector<int, 1>(Flag.rows() * Flag.cols()), blitz::neverDeleteData));
126 const blitz::Array<bool, 1>& Flag,
128 const std::vector<std::string>& Desc_band_names)
153 Poly1d weight_poly(weight_params,
true);
155 return weight_poly(wn_ad - ref_wn);
264 return Array<double, 2>(0, 0);
268 int ret_cov_offset = ret_num_param * spec_index;
275 int in_idx_a = ret_cov_offset;
276 for (
int out_idx_a = 0; out_idx_a <
NUM_COEFF; out_idx_a++) {
278 int in_idx_b = ret_cov_offset;
279 for (
int out_idx_b = 0; out_idx_b <
NUM_COEFF; out_idx_b++) {
297 blitz::Array<double, 1> params(
NUM_PARAMS, blitz::ColumnMajorArray<1>());
309 blitz::Array<double, 1> params(
NUM_PARAMS, blitz::ColumnMajorArray<1>());
346 std::stringstream name;
350 name <<
"BRDF Weight Intercept";
353 name <<
"BRDF Weight Slope";
356 name <<
"Rahman Factor";
359 name <<
"Hotspot Parameter";
362 name <<
"Asymmetry Parameter";
365 name <<
"Anisotropy Parameter";
368 name <<
"Breon Factor";
371 name <<
"Unknown Index " << i;
379 Os <<
"GroundBrdf:\n";
virtual const double kernel_value(const int Spec_index, const double Sza, const double Vza, const double Azm)
virtual ArrayAd< double, 1 > surface_parameter(const double wn, const int spec_index) const
Surface parmeters.
#define range_check(V, Min, Max)
Range check.
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.
virtual const double kernel_value(const int Spec_index, const double Sza, const double Vza, const double Azm)
double exact_brdf_value_soil_f(const double *params, const double *sza, const double *vza, const double *azm)
virtual const AutoDerivative< double > anisotropy_parameter(const int spec_index) const
double black_sky_albedo_soil_f(const double *params, const double *sza)
virtual const std::string breon_type() const =0
String describing which type of Breon surface type, also makes this class abstract.
double black_sky_albedo_veg_f(const double *params, const double *sza)
virtual const AutoDerivative< double > breon_factor(const int spec_index) const
virtual const AutoDerivative< double > weight_slope(const int spec_index) const
virtual const AutoDerivative< double > hotspot_parameter(const int spec_index) const
blitz::Array< double, 1 > kernel_value_params(const int Spec_index)
GroundBrdf(const blitz::Array< double, 2 > &Coeffs, const blitz::Array< bool, 2 > &Flag, const ArrayWithUnit< double, 1 > &Ref_points, const std::vector< std::string > &Desc_band_names)
Constructor that defines coefficients in a 2d array: Num_spectrometer * NUM_COEFF Each row has the NU...
This is the base of the exception hierarchy for Full Physics code.
virtual const AutoDerivative< double > weight_intercept(const int spec_index) const
const blitz::Array< bool, 1 > & used_flag_value() const
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
double exact_brdf_value_veg_f(const double *params, const double *sza, const double *vza, const double *azm)
virtual const int number_spectrometer() const
virtual const double black_sky_albedo(const int Spec_index, const double Sza)
This class maintains the ground portion of the state.
ArrayWithUnit< double, 1 > reference_points
Apply value function to a blitz array.
std::vector< std::string > desc_band_names
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
const Unit inv_cm("cm^-1", pow(cm, -1))
void resize(const blitz::TinyVector< int, D > &Shape, int nvar)
A one-dimensional polynomial class.
const blitz::Array< double, 2 > & statevector_covariance() const
virtual const AutoDerivative< double > weight(const double wn, const int spec_index) const
virtual void print(std::ostream &Os) const
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)
const T & value() const
Convert to type T.
#define REGISTER_LUA_END()
virtual const double black_sky_albedo(const int Spec_index, const double Sza)
def(luabind::constructor< int >()) .def("rows"
blitz::Array< double, 1 > black_sky_params(const int Spec_index)
const blitz::Array< double, 2 > brdf_covariance(const int spec_index) const
ArrayAd< double, 1 > coeff
Coefficients.
virtual const AutoDerivative< double > rahman_factor(const int spec_index) const
virtual const AutoDerivative< double > asymmetry_parameter(const int spec_index) const
ArrayWithUnit< T, D > convert_wave(const Unit &R) const
We often need to handle conversion from wavenumber to/from wavelength.