32 spec_domain.push_back(sort_sd(Grid));
48 spec_domain.push_back(sort_sd(Grid1));
49 spec_domain.push_back(sort_sd(Grid2));
50 spec_domain.push_back(sort_sd(Grid3));
56 Array<double, 1> res(In.
data().copy());
57 sort(res.data(), res.data()+res.size());
68 Os <<
"NonuniformSpectrumSampling\n";
69 Os <<
" Uniform spectrum sampling:\n";
70 opad << *interpolated_sampling <<
"\n";
73 if(spec_domain[i].data().rows() <= 0)
74 Os <<
" Band " << i + 1 <<
":\n" 75 <<
" Nonuniform RT grid not provided, using uniform grid for RT\n";
77 Os <<
" Band " << i + 1 <<
":\n" 78 <<
" grid_start: " << spec_domain[i].data()(0) <<
"\n" 79 <<
" grid_end: " << spec_domain[i].data()(spec_domain[i].data().rows() - 1) <<
"\n" 80 <<
" grid_points: " << spec_domain[i].data().rows() <<
"\n";
94 if(spec_domain[spec_index].data().rows() == 0)
97 std::map<double, bool> res;
98 typedef std::map<double, bool>::iterator it_type;
99 typedef std::map<double, bool>::value_type val_type;
100 BOOST_FOREACH(
double x, ispec.
data())
102 BOOST_FOREACH(
double x, spec_domain[spec_index].convert_wave(ispec.
units())) {
103 it_type i = res.lower_bound(x);
104 if(i != res.begin()) {
107 if(fabs(x - (*i2).first) < fabs(x - (*i).first))
113 std::vector<double> resx;
114 BOOST_FOREACH(
const val_type& i, res)
116 resx.push_back(i.first);
117 Array<double, 1> sd(&resx[0], shape((
int) resx.size()), duplicateData);
#define range_check(V, Min, Max)
Range check.
This is a filtering stream that adds a pad to the front of every line written out.
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
int number_spectrometer() const
Number of spectrometers we have.
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.
NonuniformSpectrumSampling(const SpectralDomain &Grid, const boost::shared_ptr< SpectrumSampling > &Interpolated_sampling)
Constructor.
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()
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.
This is a simple SpectrumSampling that is just a nonuniform sampling.
const blitz::Array< double, 1 > & data() const
Return data.