ReFRACtor
FullPhysics::IlsTable< Lint > Class Template Reference

This class in a IlsFunction where we get the ILS response by using a table of measured values. More...

#include <ils_table.h>

+ Inheritance diagram for FullPhysics::IlsTable< Lint >:
+ Collaboration diagram for FullPhysics::IlsTable< Lint >:

Public Member Functions

 IlsTable (const blitz::Array< double, 1 > &Wavenumber, const blitz::Array< double, 2 > &Delta_lambda, const blitz::Array< double, 2 > &Response, const std::string &Band_name, const std::string &Hdf_band_name, bool Interpolate_wavenumber=false)
 Constructor where we just supply the wavenumber, delta_lambda and response values. More...
 
 IlsTable (const HdfFile &Hdf_static_input, int Spec_index, const std::string &Band_name, const std::string &Hdf_band_name, const std::string &Hdf_group="Instrument/ILS")
 Constructor, which reads the ILS information from a HDF file. More...
 
virtual ~IlsTable ()
 
virtual std::string band_name () const
 Descriptive name of the band. More...
 
void create_delta_lambda_to_response (const blitz::Array< double, 1 > &Wavenumber, const blitz::Array< double, 2 > &Delta_lambda, const blitz::Array< double, 2 > &Response)
 Creates the datastructures needed for setting up the ILS table, only necessary to rerun if modifying ILS table after object creation. More...
 
virtual blitz::Array< double, 2 > delta_lambda () const
 
virtual std::string hdf_band_name () const
 In general, the name used in HDF files for a particular band is similar but not identical to the more human readable band_name. More...
 
virtual void ils (const AutoDerivative< double > &wn_center, const blitz::Array< double, 1 > &wn, ArrayAd< double, 1 > &res) const
 Return response function. More...
 
virtual void print (std::ostream &Os) const
 
std::string print_to_string () const
 Print to string. More...
 
virtual blitz::Array< double, 2 > response () const
 
virtual blitz::Array< double, 1 > wavenumber () const
 Accessors for retrieving arrays used to create table. More...
 

Detailed Description

template<class Lint>
class FullPhysics::IlsTable< Lint >

This class in a IlsFunction where we get the ILS response by using a table of measured values.

The data is given to us in a fixed table of response functions, indexed by delta wavenumber (called delta_lambda in the HDF file), and for a small number of wavenumbers (called wavenumber in the HDF file). We always interpolate in the delta_lambda direction, but we may either pick the row of the table with the largest wavenumber < wn_center or we may interpolate between the two closest wavenumbers.

In the old code, this was called KEY_ILS_TABLE and KEY_ILS_INTERP. In the Hdf file, this is "function_type" and is either "table" or "interpol".

Note that "Interp" is a somewhat misleading name. We always interpolate in the delta lambda direction, the question is just if we also interpolate in the wavenumber direction.

This one class handles both of the methods of interpolation, depending on the arguments passed to the function.

Definition at line 34 of file ils_table.h.

Constructor & Destructor Documentation

◆ IlsTable() [1/2]

template<class Lint>
FullPhysics::IlsTable< Lint >::IlsTable ( const blitz::Array< double, 1 > &  Wavenumber,
const blitz::Array< double, 2 > &  Delta_lambda,
const blitz::Array< double, 2 > &  Response,
const std::string &  Band_name,
const std::string &  Hdf_band_name,
bool  Interpolate_wavenumber = false 
)
inline

Constructor where we just supply the wavenumber, delta_lambda and response values.

The arrays describe the ILS function. The array Wavenumber gives the wavenumber of each pixel, Delta_lambda gives the difference between the high resolution point we are looking at and the center wavenumber, and response gives the detector response.

The row gives values for a particular instrument wavenumber, for GOSAT we typically have three rows for three different wavenumbers, one on each edge and one at the middle. The columns give a range of delta_lambda values.

Definition at line 51 of file ils_table.h.

◆ IlsTable() [2/2]

template<class Lint >
IlsTable::IlsTable ( const HdfFile Hdf_static_input,
int  Spec_index,
const std::string &  Band_name,
const std::string &  Hdf_band_name,
const std::string &  Hdf_group = "Instrument/ILS" 
)

Constructor, which reads the ILS information from a HDF file.

We determine the HDF group to read as Hdf_group + "/ILS_" + (spec_index + 1), e.g., "Instrument/ILS/ILS_1". We then read the fields delta_lambda, wavenumber, response, band_name, hdf_band_name, and function_type

Definition at line 51 of file ils_table.cc.

◆ ~IlsTable()

template<class Lint>
virtual FullPhysics::IlsTable< Lint >::~IlsTable ( )
inlinevirtual

Definition at line 67 of file ils_table.h.

Member Function Documentation

◆ band_name()

template<class Lint>
virtual std::string FullPhysics::IlsTable< Lint >::band_name ( ) const
inlinevirtual

Descriptive name of the band.

Implements FullPhysics::IlsFunction.

Definition at line 74 of file ils_table.h.

◆ create_delta_lambda_to_response()

template<class Lint >
void IlsTable::create_delta_lambda_to_response ( const blitz::Array< double, 1 > &  Wavenumber,
const blitz::Array< double, 2 > &  Delta_lambda,
const blitz::Array< double, 2 > &  Response 
)

Creates the datastructures needed for setting up the ILS table, only necessary to rerun if modifying ILS table after object creation.

Definition at line 85 of file ils_table.cc.

◆ delta_lambda()

template<class Lint>
virtual blitz::Array<double, 2> FullPhysics::IlsTable< Lint >::delta_lambda ( ) const
inlinevirtual

Definition at line 79 of file ils_table.h.

◆ hdf_band_name()

template<class Lint>
virtual std::string FullPhysics::IlsTable< Lint >::hdf_band_name ( ) const
inlinevirtual

In general, the name used in HDF files for a particular band is similar but not identical to the more human readable band_name.

For example, with GOSAT we use the HDF field name "weak_co2", but the band name is "WC-Band". This gives the HDF name to use.

The default implementation just returns the same string as the band name.

Reimplemented from FullPhysics::IlsFunction.

Definition at line 75 of file ils_table.h.

◆ ils()

template<class Lint >
void IlsTable::ils ( const AutoDerivative< double > &  wn_center,
const blitz::Array< double, 1 > &  wn,
ArrayAd< double, 1 > &  res 
) const
virtual

Return response function.

Note that is function turns out to be a bit of a bottle neck because it is called so many times. Most of the time the results are the same size from one call to the next, so we pass in the results rather than having this be a return value like we normally do. This avoids recreating the array multiple times. We resize the output, so it is fine if it doesn't happen to be the final result size. But much of the time we avoid and extra allocation and destruction.

Parameters
wn_centerThe wave number of the center of the response function
wnThe wavenumbers to return response function for.
resReturn the response function for each of the wn value.

Implements FullPhysics::IlsFunction.

Definition at line 109 of file ils_table.cc.

◆ print()

template<class Lint >
void IlsTable::print ( std::ostream &  Os) const
virtual

Reimplemented from FullPhysics::IlsFunction.

Definition at line 158 of file ils_table.cc.

◆ print_to_string()

std::string FullPhysics::Printable< IlsFunction >::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.

◆ response()

template<class Lint>
virtual blitz::Array<double, 2> FullPhysics::IlsTable< Lint >::response ( ) const
inlinevirtual

Definition at line 80 of file ils_table.h.

◆ wavenumber()

template<class Lint>
virtual blitz::Array<double, 1> FullPhysics::IlsTable< Lint >::wavenumber ( ) const
inlinevirtual

Accessors for retrieving arrays used to create table.

Definition at line 78 of file ils_table.h.


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:12