ReFRACtor
|
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO). More...
#include <spectral_domain.h>
Public Types | |
enum | TypePreference { PREFER_WAVENUMBER, PREFER_WAVELENGTH } |
Public Member Functions | |
SpectralDomain (const ArrayAd< double, 1 > &Data, const Unit &U) | |
Constructor. More... | |
SpectralDomain (const blitz::Array< double, 1 > &Data, const Unit &Units=units::inv_cm) | |
Constructor. More... | |
SpectralDomain (const ArrayWithUnit< double, 1 > &Data) | |
Constructor. More... | |
SpectralDomain (const ArrayAd< double, 1 > &Data, const blitz::Array< int, 1 > &Sindex, const Unit &U) | |
Constructor. More... | |
SpectralDomain (const blitz::Array< double, 1 > &Data, const blitz::Array< int, 1 > &Sindex, const Unit &Units=units::inv_cm) | |
Constructor. More... | |
SpectralDomain (const ArrayWithUnit< double, 1 > &Data, const blitz::Array< int, 1 > &Sindex) | |
Constructor. More... | |
SpectralDomain () | |
Default constructor needed for SWIG. More... | |
const SpectralDomain | clone () const |
Clones object into a new copy. More... | |
blitz::Array< double, 1 > | convert_wave (const Unit &Units) const |
Return data as the supplied the units. More... | |
const blitz::Array< double, 1 > & | data () const |
Return data. More... | |
const ArrayAd< double, 1 > & | data_ad () const |
Underlying data, possibly with a Jacobian. More... | |
bool | operator!= (const SpectralDomain &A) const |
bool | operator== (const SpectralDomain &A) const |
We can define != in terms of this operator. More... | |
ArrayWithUnit< double, 1 > | photon_to_radiance_factor () const |
We may want to convert from photon number per second to radiance units. More... | |
void | print (std::ostream &Os) const |
std::string | print_to_string () const |
Print to string. More... | |
const blitz::Array< int, 1 > & | sample_index () const |
Return sample index. More... | |
TypePreference | type_preference () const |
Indicate if this class prefers wavelength or wavenumber. More... | |
const Unit | units () const |
Units that go with data() More... | |
blitz::Array< double, 1 > | wavelength (const Unit &Units=units::micron) const |
Return data as wavelengths You can optionally supply the units to use. More... | |
blitz::Array< double, 1 > | wavenumber (const Unit &Units=units::inv_cm) const |
Return data as wavenumbers. More... | |
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
Most of our code doesn't care if we are using wavenumber or wavelength, so we have this one class that can be either. For code that needs one or the other, we supply conversion routines to present the data as either wavenumber or wavelength.
As far as I can determine, there isn't any commonly used name that means "either wavelength or wavenumber". We've named this "SpectralDomain", where "Domain" is used like "Domain and Range" of a function, i.e., this is the X-axis of a spectral plot. Perhaps a better name will arise and we can rename this class.
This class is essentially just a blitz::array with units, and the additional functionality to convert to wavenumber or wavelength.
Note that there are a few closely related classes, with similar sounding names. See Spectrum related classes for a description of each of these.
Definition at line 31 of file spectral_domain.h.
Enumerator | |
---|---|
PREFER_WAVENUMBER | |
PREFER_WAVELENGTH |
Definition at line 33 of file spectral_domain.h.
Constructor.
The units indicate if the data passed in is wavenumber (1/Length) or wavelength (Length)
Definition at line 39 of file spectral_domain.cc.
SpectralDomain::SpectralDomain | ( | const blitz::Array< double, 1 > & | Data, |
const Unit & | Units = units::inv_cm |
||
) |
Constructor.
The units indicate if the data passed in is wavenumber (1/Length) or wavelength (Length)
Definition at line 79 of file spectral_domain.cc.
SpectralDomain::SpectralDomain | ( | const ArrayWithUnit< double, 1 > & | Data | ) |
Constructor.
The units indicate if the data passed in is wavenumber (1/Length) or wavelength (Length)
Definition at line 119 of file spectral_domain.cc.
SpectralDomain::SpectralDomain | ( | const ArrayAd< double, 1 > & | Data, |
const blitz::Array< int, 1 > & | Sindex, | ||
const Unit & | Units | ||
) |
Constructor.
The units indicate if the data passed in is wavenumber (1/Length) or wavelength (Length)
Definition at line 57 of file spectral_domain.cc.
SpectralDomain::SpectralDomain | ( | const blitz::Array< double, 1 > & | Data, |
const blitz::Array< int, 1 > & | Sindex, | ||
const Unit & | Units = units::inv_cm |
||
) |
Constructor.
The units indicate if the data passed in is wavenumber (1/Length) or wavelength (Length)
Definition at line 97 of file spectral_domain.cc.
SpectralDomain::SpectralDomain | ( | const ArrayWithUnit< double, 1 > & | Data, |
const blitz::Array< int, 1 > & | Sindex | ||
) |
Constructor.
The units indicate if the data passed in is wavenumber (1/Length) or wavelength (Length)
Definition at line 136 of file spectral_domain.cc.
|
inline |
Default constructor needed for SWIG.
Definition at line 118 of file spectral_domain.h.
|
inline |
Clones object into a new copy.
Definition at line 89 of file spectral_domain.h.
Array< double, 1 > SpectralDomain::convert_wave | ( | const Unit & | Units | ) | const |
Return data as the supplied the units.
Definition at line 157 of file spectral_domain.cc.
|
inline |
Return data.
This is either wavenumber or wavelength. This member function is intended for classes that don't care which one we are using. If you do care, then you should call either wavenumber or wavelength.
Note that this is a reference to the actual data, so if you intend on modifying this you should make a deep copy.
Definition at line 59 of file spectral_domain.h.
|
inline |
Underlying data, possibly with a Jacobian.
The jacobian may have size 0.
Definition at line 66 of file spectral_domain.h.
|
inline |
Definition at line 113 of file spectral_domain.h.
|
inline |
We can define != in terms of this operator.
Definition at line 111 of file spectral_domain.h.
ArrayWithUnit< double, 1 > SpectralDomain::photon_to_radiance_factor | ( | ) | const |
We may want to convert from photon number per second to radiance units.
This gives the factor to use in converting.
Definition at line 212 of file spectral_domain.cc.
|
inline |
Definition at line 106 of file spectral_domain.h.
|
inlineinherited |
Print to string.
This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.
Definition at line 31 of file printable.h.
|
inline |
Return sample index.
This may be empty if we aren't dealing with the lower resolution grid that maps to a sample index. If present, this gives the sample index for each of the data() points.
Note that by convention the sample index is 1 based, so the first sample index is 1 rather than zero.
Definition at line 77 of file spectral_domain.h.
|
inline |
Indicate if this class prefers wavelength or wavenumber.
This is what data() is.
Definition at line 96 of file spectral_domain.h.
|
inline |
Units that go with data()
Definition at line 83 of file spectral_domain.h.
Array< double, 1 > SpectralDomain::wavelength | ( | const Unit & | Units = units::micron | ) | const |
Return data as wavelengths You can optionally supply the units to use.
Throws an error if the the optionally supplied units are not commensurate with microns
Definition at line 193 of file spectral_domain.cc.
Array< double, 1 > SpectralDomain::wavenumber | ( | const Unit & | Units = units::inv_cm | ) | const |
Return data as wavenumbers.
You can optionally supply the units to use. Throws an error if the the optionally supplied units are not commensurate with cm^-1
Definition at line 172 of file spectral_domain.cc.