18 Unit u_grid = spacing.units;
21 std::vector<double> lowres_conv;
22 BOOST_FOREACH(
double v, Lowres_grid.
data()) {
25 std::sort(lowres_conv.begin(), lowres_conv.end());
32 double highres_beg = lowres_conv[0] - offset.value;
33 double highres_end = lowres_conv[lowres_conv.size()-1] + offset.value;
35 int nsamples = (int) floor((highres_end - highres_beg) / spacing.value) + 1;
37 std::vector<double> highres_points;
38 for(
int i = 0; i < nsamples; ++i) {
42 auto lr_closest = std::lower_bound(lowres_conv.begin(), lowres_conv.end(), hr_point.
value);
50 std::sort(highres_points.begin(), highres_points.end());
53 Array<double, 1> uniform_vals((
int) highres_points.size());
54 std::copy(highres_points.begin(), highres_points.end(), uniform_vals.begin());
66 Os <<
"UniformSpectrumSampling\n" 67 <<
" Spacing: " << spec_spacing <<
"\n";
#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.
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.
virtual void print(std::ostream &Os) const
Print to stream.
Apply value function to a blitz array.
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.
const blitz::Array< double, 1 > & data() const
Return data.