ReFRACtor
|
This class is used to read the absco tables. More...
#include <absco_hdf.h>
Public Member Functions | |
AbscoHdf (const std::string &Fname, double Table_scale=1.0, int Cache_nline=5000) | |
Read the given Absco file. More... | |
AbscoHdf (const std::string &Fname, const SpectralBound &Spectral_bound, const std::vector< double > &Table_scale, int Cache_nline=5000) | |
Read the given Absco file. More... | |
virtual | ~AbscoHdf () |
virtual DoubleWithUnit | absorption_cross_section (double Wn, const DoubleWithUnit &Press, const DoubleWithUnit &Temp, const DoubleWithUnit &Broadener_vmr) const |
This interpolates the ABSCO data to give absorption cross section for a given pressure, temperature, and broadener VMR. More... | |
virtual AutoDerivativeWithUnit< double > | absorption_cross_section (double wn, const DoubleWithUnit &press, const AutoDerivativeWithUnit< double > &temp, const AutoDerivativeWithUnit< double > &broadener_vmr) const |
This interpolates the ABSCO data to give absorption cross section for a given pressure, temperature, and broadener VMR. More... | |
virtual std::string | broadener_name () const |
For some tables, we might have a broadener (e.g., "h2o"). More... | |
virtual blitz::Array< double, 1 > | broadener_vmr_grid () const |
Return the broadener VMR grid used for this Absco file. More... | |
virtual std::string | file_name () const |
virtual bool | have_data (double wn) const |
Return true if we have data for the given wave number. More... | |
virtual bool | is_float () const |
Note some of the Absco data files used float, and some use doubles. More... | |
void | load_file (const std::string &Fname) |
Load file, using the same table scaling as we already have. More... | |
void | load_file (const std::string &Fname, double Table_scale, int Cache_nline=5000) |
Read the given Absco file. More... | |
void | load_file (const std::string &Fname, const SpectralBound &Spectral_bound, const std::vector< double > &Table_scale, int Cache_nline=5000) |
Read the given Absco file. More... | |
virtual int | number_broadener_vmr () const |
Number of broadener VMR values in absco file. More... | |
virtual int | number_layer () const |
Number of pressure layers in absco file. More... | |
virtual int | number_temperature () const |
Number of temperature values in absco file. More... | |
virtual blitz::Array< double, 1 > | pressure_grid () const |
Return the pressure grid used for this Absco file. More... | |
virtual void | print (std::ostream &Os) const |
std::string | print_to_string () const |
Print to string. More... | |
template<class T > | |
blitz::Array< T, 3 > | read (double wn) const |
Read the record for the highest wavenumber that is less than or equal to given wave number. More... | |
template<> | |
blitz::Array< double, 3 > | read (double wn) const |
template<> | |
blitz::Array< float, 3 > | read (double wn) const |
virtual double | table_scale (double wn) const |
Scale to apply to underlying ABSCO data to get the absorption_cross_section. More... | |
virtual blitz::Array< double, 2 > | temperature_grid () const |
Return the temperature grid for this Absco file. More... | |
virtual const std::pair< double *, double * > | wn_extent (double Wn_in) const |
Protected Member Functions | |
virtual blitz::Array< double, 3 > | read_double (double wn) const |
Return either a blitz::Array<double, 3> or blitz::Array<float, 3>, depending on the type of the underlying data. More... | |
virtual blitz::Array< float, 3 > | read_float (double wn) const |
This class is used to read the absco tables.
This reads the HDF version of the files.
Note that performance reasons we cache the data as we read it. The default cache is about 50 MB, which is a bit large but not too large. This can be adjusted if needed, either up for better performance or down for less memory.
Definition at line 20 of file absco_hdf.h.
AbscoHdf::AbscoHdf | ( | const std::string & | Fname, |
double | Table_scale = 1.0 , |
||
int | Cache_nline = 5000 |
||
) |
Read the given Absco file.
You can optionally set the number of lines of data to cache, and a scaling to apply to the underlying table.
Definition at line 27 of file absco_hdf.cc.
AbscoHdf::AbscoHdf | ( | const std::string & | Fname, |
const SpectralBound & | Spectral_bound, | ||
const std::vector< double > & | Table_scale, | ||
int | Cache_nline = 5000 |
||
) |
Read the given Absco file.
You can optionally set the number of lines of data to cache, and a scaling to apply to the underlying table.
Definition at line 39 of file absco_hdf.cc.
|
inlinevirtual |
Definition at line 35 of file absco_hdf.h.
|
virtualinherited |
This interpolates the ABSCO data to give absorption cross section for a given pressure, temperature, and broadener VMR.
Wn | wave number |
Press | Pressure |
Temp | Temperature |
Broadener_vmr | Broadner VMR (e.g., H2O VMR). Not all tables will make use of this information. |
Implements FullPhysics::GasAbsorption.
|
virtualinherited |
This interpolates the ABSCO data to give absorption cross section for a given pressure, temperature, and broadener VMR.
Wn | wave number |
Press | Pressure |
Temp | Temperature |
Broadener_vmr | Broadner VMR (e.g., H2O VMR). Not all tables will make use of this information. |
Implements FullPhysics::GasAbsorption.
|
inlinevirtual |
For some tables, we might have a broadener (e.g., "h2o").
This returns the name of the broadener, if any.
Implements FullPhysics::Absco.
Definition at line 36 of file absco_hdf.h.
|
inlinevirtual |
Return the broadener VMR grid used for this Absco file.
This is number_broadener_vmr() in size, which may be size 0.
This is dimensionless.
Implements FullPhysics::Absco.
Definition at line 37 of file absco_hdf.h.
|
inlinevirtual |
Definition at line 45 of file absco_hdf.h.
|
virtual |
Return true if we have data for the given wave number.
A particular gas might not have absorption coefficients for all spectral bands, e.g., ABSCO tables.
Implements FullPhysics::GasAbsorption.
Definition at line 217 of file absco_hdf.cc.
|
inlinevirtual |
Note some of the Absco data files used float, and some use doubles.
HDF is happy to convert for us, but because the absco tables are a bit of a bottle neck we actually want to keep track of float vs. double and use this to optimize the read functions.
Implements FullPhysics::Absco.
Definition at line 44 of file absco_hdf.h.
void AbscoHdf::load_file | ( | const std::string & | Fname | ) |
Load file, using the same table scaling as we already have.
Note that you don't normally call this directly, but rather use the constructor. However there are certain uses where changing the absco table can be useful, such as the python code l2_fp_fm_errors.py.
Definition at line 55 of file absco_hdf.cc.
void AbscoHdf::load_file | ( | const std::string & | Fname, |
double | Table_scale, | ||
int | Cache_nline = 5000 |
||
) |
Read the given Absco file.
Note that you don't normally call this directly, but rather use the constructor. However there are certain uses where changing the absco table can be useful, such as the python code l2_fp_fm_errors.py.
Definition at line 67 of file absco_hdf.cc.
void AbscoHdf::load_file | ( | const std::string & | Fname, |
const SpectralBound & | Spectral_bound, | ||
const std::vector< double > & | Table_scale, | ||
int | Cache_nline = 5000 |
||
) |
Read the given Absco file.
Note that you don't normally call this directly, but rather use the constructor. However there are certain uses where changing the absco table can be useful, such as the python code l2_fp_fm_errors.py.
Definition at line 83 of file absco_hdf.cc.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlinevirtual |
Return the pressure grid used for this Absco file.
This is number_layer() in size.
This is in Pascals.
Implements FullPhysics::Absco.
Definition at line 41 of file absco_hdf.h.
|
virtual |
Reimplemented from FullPhysics::GasAbsorption.
Definition at line 317 of file absco_hdf.cc.
|
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.
|
inherited |
Read the record for the highest wavenumber that is less than or equal to given wave number.
The value returned in number_layer() x number_temperature() x max(number_broadener_vmr(), 1)
Different absco files have different windows of data. If you don't know the file contains data for wn, you should first check if can read (e.g., use have_data).
Note that the older binary and 3D Absco files do not have broadener VMR dimension. As a convenience, we pretend like there is a dimension with a single value. This allows us to treat 3D and 4D tables the same.
wn | Wave number to read |
|
inlineinherited |
|
inlineinherited |
|
protectedvirtual |
Return either a blitz::Array<double, 3> or blitz::Array<float, 3>, depending on the type of the underlying data.
Implements FullPhysics::Absco.
Definition at line 261 of file absco_hdf.cc.
|
protectedvirtual |
Implements FullPhysics::Absco.
Definition at line 272 of file absco_hdf.cc.
|
virtual |
Scale to apply to underlying ABSCO data to get the absorption_cross_section.
This allows empirical corrections to be applied the ABSCO tables (e.g., O2 scaling). Note that as a user you don't need to apply this correction, it is already applied in absorption_cross_section() and AbscoInterpolator.
Implements FullPhysics::Absco.
Definition at line 205 of file absco_hdf.cc.
|
inlinevirtual |
Return the temperature grid for this Absco file.
This is number_layer() x number_temperature() in size.
This is in Kelvin.
Implements FullPhysics::Absco.
Definition at line 42 of file absco_hdf.h.
|
virtual |
Definition at line 169 of file absco_hdf.cc.