23 .def(
"type_preference", &spec_domain_type_preference)
25 .def(luabind::constructor<
const Array<double, 1>&>())
26 .def(luabind::constructor<
const Array<double, 1>&,
const Unit&>())
29 .def(luabind::constructor<
const Array<double, 1>&,
const blitz::Array<int, 1>&>())
30 .def(luabind::constructor<
const Array<double, 1>&,
const blitz::Array<int, 1>&,
const Unit&>())
47 e <<
"The units passed to SpectralDomain must be Length or Length^-1.\n" 48 <<
"Units passed in: \n" << Units;
58 const blitz::Array<int, 1>& Sindex,
67 e <<
"The units passed to SpectralDomain must be Length or Length^-1.\n" 68 <<
"Units passed in: \n" << Units;
71 if(data_.
rows() != sindex_.rows())
72 throw Exception(
"Data and Sindex must be the same size");
87 e <<
"The units passed to SpectralDomain must be Length or Length^-1.\n" 88 <<
"Units passed in: \n" << Units;
98 const blitz::Array<int, 1>& Sindex,
107 e <<
"The units passed to SpectralDomain must be Length or Length^-1.\n" 108 <<
"Units passed in: \n" << Units;
111 if(data_.
rows() != sindex_.rows())
112 throw Exception(
"Data and Sindex must be the same size");
126 e <<
"The units passed to SpectralDomain must be Length or Length^-1.\n" 127 <<
"Units passed in: \n" << units_;
137 const blitz::Array<int, 1>& Sindex)
145 e <<
"The units passed to SpectralDomain must be Length or Length^-1.\n" 146 <<
"Units passed in: \n" << units_;
149 if(data_.
rows() != sindex_.rows())
150 throw Exception(
"Data and Sindex must be the same size");
177 stringstream err_msg;
178 err_msg <<
"Supplied units: " 180 <<
" are not commensurate with target units: " 198 stringstream err_msg;
199 err_msg <<
"Supplied units: " 201 <<
" are not commensurate with target units: " 214 using namespace units;
225 return res.
convert(output_units);
const DoubleWithUnit planck(6.6260693e-34, units::J *units::s)
Planck's constant, in J s.
const Unit s("s", 1.0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
SpectralDomain()
Default constructor needed for SWIG.
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
This is the base of the exception hierarchy for Full Physics code.
double conversion(const Unit &Dunit_from, const Unit &Dunit_to)
Return conversion factor to go from one unit to another.
blitz::Array< double, 1 > wavelength(const Unit &Units=units::micron) const
Return data as wavelengths You can optionally supply the units to use.
const Unit micron("micron", 1e-6 *m)
blitz::Array< T, D > value
#define REGISTER_LUA_CLASS(X)
Apply value function to a blitz array.
const blitz::Array< T, D > & value() const
const Unit inv_cm("cm^-1", pow(cm, -1))
blitz::Array< double, 1 > convert_wave(const Unit &Units) const
Return data as the supplied the units.
We frequently have a double with units associated with it.
TypePreference type_preference() const
Indicate if this class prefers wavelength or wavenumber.
ArrayWithUnit< double, 1 > photon_to_radiance_factor() const
We may want to convert from photon number per second to radiance units.
Libraries such as boost::units allow unit handling where we know the units at compile time...
blitz::Array< double, 1 > wavenumber(const Unit &Units=units::inv_cm) const
Return data as wavenumbers.
const Unit units() const
Units that go with data()
bool is_commensurate(const Unit &Units) const
Test if this set of units is commensurate with another set.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
const Unit ph("ph", 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)
const std::string & name() const
Name of unit. May be an empty string if a name wasn't assigned.
double value(const FullPhysics::AutoDerivative< double > &Ad)
ArrayWithUnit< T, D > convert(const Unit &R) const
Convert to the given units.
const blitz::Array< double, 1 > & data() const
Return data.
const DoubleWithUnit speed_of_light(299792458, units::m/units::s)
Speed of light, in m/s.