ReFRACtor
ils_table.h
Go to the documentation of this file.
1 #ifndef ILS_TABLE_H
2 #define ILS_TABLE_H
3 #include "ils_function.h"
4 #include "hdf_file.h"
5 #include "linear_interpolate.h"
6 #include "log_interpolate.h"
7 
8 namespace FullPhysics {
9 /****************************************************************/
33 template <class Lint>
34 class IlsTable : public IlsFunction {
35 public:
36 //-----------------------------------------------------------------------
49 //-----------------------------------------------------------------------
50 
51  IlsTable(const blitz::Array<double, 1>& Wavenumber,
52  const blitz::Array<double, 2>& Delta_lambda,
53  const blitz::Array<double, 2>& Response,
54  const std::string& Band_name, const std::string& Hdf_band_name,
55  bool Interpolate_wavenumber = false)
56  : band_name_(Band_name),
57  hdf_band_name_(Hdf_band_name),
58  interpolate_wavenumber(Interpolate_wavenumber),
59  from_hdf_file(false)
60  {
61  create_delta_lambda_to_response(Wavenumber, Delta_lambda, Response);
62  }
63  IlsTable(const HdfFile& Hdf_static_input, int Spec_index,
64  const std::string& Band_name, const std::string& Hdf_band_name,
65  const std::string& Hdf_group = "Instrument/ILS");
66 
67  virtual ~IlsTable() {}
68  virtual void ils
69  (const AutoDerivative<double>& wn_center,
70  const blitz::Array<double, 1>& wn,
71  ArrayAd<double, 1>& res) const;
72 
73  virtual void print(std::ostream& Os) const;
74  virtual std::string band_name() const {return band_name_;}
75  virtual std::string hdf_band_name() const { return hdf_band_name_;}
76 
78  virtual blitz::Array<double, 1> wavenumber() const { return wavenumber_; }
79  virtual blitz::Array<double, 2> delta_lambda() const { return delta_lambda_; }
80  virtual blitz::Array<double, 2> response() const { return response_; }
81 
84  void create_delta_lambda_to_response(const blitz::Array<double, 1>& Wavenumber,
85  const blitz::Array<double, 2>& Delta_lambda,
86  const blitz::Array<double, 2>& Response);
87 private:
88  // Save some typing by giving these typedefs
89  typedef ArrayAd<double, 1> arrad;
90  typedef AutoDerivative<double> ad;
91  typedef typename std::map<double, Lint>::const_iterator it;
92 
96  std::map<double, Lint> delta_lambda_to_response;
97 
98  // Store the input arrays so we can re-build the ils map for testing
99  // purposes, or for whatever reason you would need to do this mid program
100  blitz::Array<double, 1> wavenumber_;
101  blitz::Array<double, 2> delta_lambda_;
102  blitz::Array<double, 2> response_;
103 
104  std::string band_name_, hdf_band_name_;
105  bool interpolate_wavenumber;
106 
107  // Stash some information for print out with print
108  bool from_hdf_file;
109  std::string hdf_file_name;
110  std::string hdf_group;
111 };
112 
115 
116 }
117 #endif
virtual std::string band_name() const
Descriptive name of the band.
Definition: ils_table.h:74
virtual void print(std::ostream &Os) const
Definition: ils_table.cc:158
This class models an Instrument Line Shape (ILS) function.
Definition: ils_function.h:17
This class reads and writes a HDF5 file.
Definition: hdf_file.h:39
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 ...
Definition: ils_table.cc:85
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.
Definition: ils_table.h:51
virtual blitz::Array< double, 1 > wavenumber() const
Accessors for retrieving arrays used to create table.
Definition: ils_table.h:78
IlsTable< LinearInterpolate< AutoDerivative< double >, AutoDerivative< double > > > IlsTableLinear
Definition: ils_table.h:113
virtual void ils(const AutoDerivative< double > &wn_center, const blitz::Array< double, 1 > &wn, ArrayAd< double, 1 > &res) const
Return response function.
Definition: ils_table.cc:109
virtual blitz::Array< double, 2 > response() const
Definition: ils_table.h:80
virtual blitz::Array< double, 2 > delta_lambda() const
Definition: ils_table.h:79
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...
Definition: ils_table.h:75
This class in a IlsFunction where we get the ILS response by using a table of measured values...
Definition: ils_table.h:34
IlsTable< LinearLogInterpolate< AutoDerivative< double >, AutoDerivative< double > > > IlsTableLog
Definition: ils_table.h:114
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual ~IlsTable()
Definition: ils_table.h:67

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