24 Unit u_comp = spec_spacing.units;
30 if (!u_orig.is_commensurate(Ils_half_width.
units)) {
31 std::stringstream err_msg;
32 err_msg <<
"Low res grid units:" << std::endl
33 << u_orig << std::endl
34 <<
"are not commensurate with ils half width units:" << std::endl
35 << Ils_half_width.
units;
41 std::vector<DoubleWithUnit> lres_conv;
42 BOOST_FOREACH(
double v, Lowres_grid.
data())
43 lres_conv.push_back(
DoubleWithUnit(v, u_orig).convert_wave(u_comp));
44 std::sort(lres_conv.begin(), lres_conv.end());
56 std::vector<double> hres;
57 if(lres_conv.size() > 0) {
62 min( (lres_conv[0].convert_wave(u_orig) - Ils_half_width).
64 (lres_conv[0].convert_wave(u_orig) + Ils_half_width).
65 convert_wave(u_comp) );
71 int smax = (int) round(fpoint.
value / sp).
value;
84 int fmin = (int) floor(preval / sp).
value;
85 int fmax = (int) ceil(postval / sp).
value;
86 for(
int f = std::max(fmin, smax + 1); f < fmax; ++f) {
92 smax = (int) round(fval / sp).
value;
98 std::sort(hres.begin(), hres.end());
101 Array<double, 1> dv((
int) hres.size());
102 std::copy(hres.begin(), hres.end(), dv.begin());
#define range_check(V, Min, Max)
Range check.
DoubleWithUnit convert_wave(const Unit &R) const
We often need to handle conversion from wavenumber to/from wavelength.
This generates a spectrum sampling that covers all the high resolution points needed to create the sp...
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
virtual SpectralDomain spectral_domain(int spec_index, const SpectralDomain &Lowres_grid, const DoubleWithUnit &Ils_half_width) const
Wavenumbers/Wavelengths to use for the given spectrometer.
This is the base of the exception hierarchy for Full Physics code.
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Apply value function to a blitz array.
This determines the sampling of the spectrum that should be used for each of the spectrum indexes...
We frequently have a double with units associated with it.
Libraries such as boost::units allow unit handling where we know the units at compile time...
const Unit units() const
Units that go with data()
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
const blitz::Array< double, 1 > & data() const
Return data.