ReFRACtor
FullPhysics::AbscoHdf Class Reference

This class is used to read the absco tables. More...

#include <absco_hdf.h>

+ Inheritance diagram for FullPhysics::AbscoHdf:
+ Collaboration diagram for FullPhysics::AbscoHdf:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AbscoHdf() [1/2]

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() [2/2]

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.

◆ ~AbscoHdf()

virtual FullPhysics::AbscoHdf::~AbscoHdf ( )
inlinevirtual

Definition at line 35 of file absco_hdf.h.

Member Function Documentation

◆ absorption_cross_section() [1/2]

DoubleWithUnit Absco::absorption_cross_section ( double  Wn,
const DoubleWithUnit Press,
const DoubleWithUnit Temp,
const DoubleWithUnit Broadener_vmr 
) const
virtualinherited

This interpolates the ABSCO data to give absorption cross section for a given pressure, temperature, and broadener VMR.

Parameters
Wnwave number
PressPressure
TempTemperature
Broadener_vmrBroadner VMR (e.g., H2O VMR). Not all tables will make use of this information.
Returns
Absorption cross section in cm^2 / molecule

Implements FullPhysics::GasAbsorption.

Definition at line 81 of file absco.cc.

◆ absorption_cross_section() [2/2]

AutoDerivativeWithUnit< double > Absco::absorption_cross_section ( double  Wn,
const DoubleWithUnit Press,
const AutoDerivativeWithUnit< double > &  Temp,
const AutoDerivativeWithUnit< double > &  Broadener_vmr 
) const
virtualinherited

This interpolates the ABSCO data to give absorption cross section for a given pressure, temperature, and broadener VMR.

Parameters
Wnwave number
PressPressure
TempTemperature
Broadener_vmrBroadner VMR (e.g., H2O VMR). Not all tables will make use of this information.
Returns
Absorption cross section in cm^2 / molecule

Implements FullPhysics::GasAbsorption.

Definition at line 103 of file absco.cc.

◆ broadener_name()

virtual std::string FullPhysics::AbscoHdf::broadener_name ( ) const
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.

◆ broadener_vmr_grid()

virtual blitz::Array<double, 1> FullPhysics::AbscoHdf::broadener_vmr_grid ( ) const
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.

◆ file_name()

virtual std::string FullPhysics::AbscoHdf::file_name ( ) const
inlinevirtual

Definition at line 45 of file absco_hdf.h.

◆ have_data()

bool AbscoHdf::have_data ( double  wn) const
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.

◆ is_float()

virtual bool FullPhysics::AbscoHdf::is_float ( ) const
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.

◆ load_file() [1/3]

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.

◆ load_file() [2/3]

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.

◆ load_file() [3/3]

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.

◆ number_broadener_vmr()

virtual int FullPhysics::Absco::number_broadener_vmr ( ) const
inlinevirtualinherited

Number of broadener VMR values in absco file.

This may be 0, if we don't have any broadening.

Definition at line 77 of file absco.h.

◆ number_layer()

virtual int FullPhysics::Absco::number_layer ( ) const
inlinevirtualinherited

Number of pressure layers in absco file.

Definition at line 84 of file absco.h.

◆ number_temperature()

virtual int FullPhysics::Absco::number_temperature ( ) const
inlinevirtualinherited

Number of temperature values in absco file.

Definition at line 91 of file absco.h.

◆ pressure_grid()

virtual blitz::Array<double, 1> FullPhysics::AbscoHdf::pressure_grid ( ) const
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.

◆ print()

void AbscoHdf::print ( std::ostream &  Os) const
virtual

Reimplemented from FullPhysics::GasAbsorption.

Definition at line 317 of file absco_hdf.cc.

◆ print_to_string()

std::string FullPhysics::Printable< GasAbsorption >::print_to_string ( ) const
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.

◆ read() [1/3]

template<class T >
blitz::Array<T, 3> FullPhysics::Absco::read ( double  wn) const
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.

Parameters
wnWave number to read
Returns
Absorption cross section in cm^2 / molecule

◆ read() [2/3]

template<>
blitz::Array<float, 3> FullPhysics::Absco::read ( double  wn) const
inlineinherited

Definition at line 182 of file absco.h.

◆ read() [3/3]

template<>
blitz::Array<double, 3> FullPhysics::Absco::read ( double  wn) const
inlineinherited

Definition at line 177 of file absco.h.

◆ read_double()

Array< double, 3 > AbscoHdf::read_double ( double  wn) const
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.

◆ read_float()

Array< float, 3 > AbscoHdf::read_float ( double  wn) const
protectedvirtual

Implements FullPhysics::Absco.

Definition at line 272 of file absco_hdf.cc.

◆ table_scale()

double AbscoHdf::table_scale ( double  wn) const
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.

◆ temperature_grid()

virtual blitz::Array<double, 2> FullPhysics::AbscoHdf::temperature_grid ( ) const
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.

◆ wn_extent()

const std::pair< double *, double * > AbscoHdf::wn_extent ( double  Wn_in) const
virtual

Definition at line 169 of file absco_hdf.cc.


The documentation for this class was generated from the following files:

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:11