6 #include <blitz/array.h> 22 AbscoHdf(
const std::string& Fname,
double Table_scale = 1.0,
23 int Cache_nline = 5000);
26 const std::vector<double>& Table_scale,
27 int Cache_nline = 5000);
29 void load_file(
const std::string& Fname,
double Table_scale,
30 int Cache_nline = 5000);
33 const std::vector<double>& Table_scale,
34 int Cache_nline = 5000);
39 virtual const std::pair<double*, double*>
wn_extent(
double Wn_in)
const;
44 virtual bool is_float()
const {
return is_float_;}
45 virtual std::string
file_name()
const {
return hfile->file_name(); }
46 virtual void print(std::ostream& Os)
const;
48 virtual blitz::Array<double, 3>
read_double(
double wn)
const;
49 virtual blitz::Array<float, 3>
read_float(
double wn)
const;
53 blitz::Array<double, 1> bvmr;
55 mutable int cache_double_lbound;
56 mutable int cache_double_ubound;
57 mutable int cache_float_lbound;
58 mutable int cache_float_ubound;
59 template<
class T>
void bound_set(
int lbound,
int sz)
const;
60 mutable blitz::Array<double, 4> read_cache_double;
61 mutable blitz::Array<float, 4> read_cache_float;
62 template<
class T> blitz::Array<T, 4>& read_cache()
const;
63 template<
class T>
void swap(
int i)
const;
64 int wn_index(
double Wn_in)
const;
65 std::string field_name;
67 blitz::Array<double, 1> pgrid;
68 blitz::Array<double, 2> tgrid;
69 blitz::Array<double, 1> wngrid;
71 std::vector<double> table_scale_;
72 blitz::Array<double, 2> extent_range;
73 blitz::Array<int, 2> extent_index;
79 template<>
inline blitz::Array<double, 4>& AbscoHdf::read_cache<double>()
const 80 {
return read_cache_double; }
82 template<>
inline blitz::Array<float, 4>& AbscoHdf::read_cache<float>()
const 83 {
return read_cache_float; }
85 template<>
inline void AbscoHdf::bound_set<double>(
int lbound,
int sz)
const 87 cache_double_lbound = lbound;
88 cache_double_ubound = lbound + sz;
91 template<>
inline void AbscoHdf::bound_set<float>(
int lbound,
int sz)
const 93 cache_float_lbound = lbound;
94 cache_float_ubound = lbound + sz;
This class is used to read the absco tables.
virtual blitz::Array< double, 2 > temperature_grid() const
Return the temperature grid for this Absco file.
virtual blitz::Array< double, 1 > pressure_grid() const
Return the pressure grid used for this Absco file.
virtual std::string file_name() const
AbscoHdf(const std::string &Fname, double Table_scale=1.0, int Cache_nline=5000)
Read the given Absco file.
virtual blitz::Array< float, 3 > read_float(double wn) const
virtual blitz::Array< double, 1 > broadener_vmr_grid() const
Return the broadener VMR grid used for this Absco file.
This gives the upper and lower bounds of the SpectralWindow.
virtual const std::pair< double *, double * > wn_extent(double Wn_in) const
virtual bool is_float() const
Note some of the Absco data files used float, and some use doubles.
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 under...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
virtual void print(std::ostream &Os) const
virtual double table_scale(double wn) const
Scale to apply to underlying ABSCO data to get the absorption_cross_section.
virtual std::string broadener_name() const
For some tables, we might have a broadener (e.g., "h2o").
This class is used to read the absco tables.
void load_file(const std::string &Fname)
Load file, using the same table scaling as we already have.
virtual bool have_data(double wn) const
Return true if we have data for the given wave number.