2 #include <boost/lexical_cast.hpp> 10 .def(luabind::constructor<
const blitz::Array<double, 1>&,
11 const blitz::Array<bool, 1>&,
25 (
const blitz::Array<double, 1>& Coeff,
26 const blitz::Array<bool, 1>& Used_flag,
27 const Unit& Coeff_unit,
28 const std::string& Band_name,
32 is_one_based(Is_one_based),
33 coeff_unit(Coeff_unit),
34 band_name_(Band_name),
35 index_array(Number_pixel),
36 spectral_index(Number_pixel)
48 (
const blitz::Array<double, 1>& Coeff,
49 const blitz::Array<bool, 1>& Used_flag,
50 const std::string& Coeff_unit_name,
51 const std::string& Band_name,
52 int Number_pixel,
bool Is_one_based)
54 is_one_based(Is_one_based),
55 coeff_unit(Coeff_unit_name),
56 band_name_(Band_name),
57 index_array(Number_pixel),
58 spectral_index(Number_pixel)
64 void DispersionPolynomial::initialize() {
65 for(
int i = 0; i < index_array.rows(); ++i) {
66 index_array(i) = i + (is_one_based ? 1 : 0);
67 spectral_index(i) = i + 1;
74 std::string res =
"Instrument Dispersion " + band_name_;
80 res +=
" Parm " + boost::lexical_cast<std::string>(i + 1);
98 band_name_, index_array.rows(),
104 Os <<
"DispersionPolynomial for band " << band_name_ <<
"\n" 105 <<
" 1 based: " << (is_one_based ?
"True" :
"False") <<
"\n" 107 for(
int i = 0; i < coeff.rows() - 1; ++i)
108 Os << coeff.value()(i) <<
", ";
109 Os << coeff.value()(coeff.rows() - 1) <<
")\n" 111 for(
int i = 0; i < used_flag.rows() - 1; ++i)
112 Os << (used_flag(i) ?
"true" :
"false") <<
", ";
113 Os << (used_flag(used_flag.rows() - 1) ?
"true" :
"false") <<
")";
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
DispersionPolynomial(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const Unit &Coeff_unit, const std::string &Band_name, int Number_pixel, bool Is_one_based)
Constructor.
virtual SpectralDomain pixel_grid() const
Returns as list of grid points for each instrument pixel, and the gradient of the points wrt the stat...
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
virtual void print(std::ostream &Os) const
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Apply value function to a blitz array.
A one-dimensional polynomial class.
This is an implementation of Dispersion that uses a polynomial expression to calculate the wavenumber...
Libraries such as boost::units allow unit handling where we know the units at compile time...
This class calculates the wavenumber for each pixel in a single band of an Instrument.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
virtual boost::shared_ptr< Dispersion > clone() const
Clone an Dispersion object.