ReFRACtor
dispersion_polynomial.h
Go to the documentation of this file.
1 #ifndef DISPERSION_POLYNOMIAL_H
2 #define DISPERSION_POLYNOMIAL_H
3 #include "dispersion.h"
4 #include "unit.h"
6 #include "polynomial_eval.h"
7 
8 namespace FullPhysics {
9 /****************************************************************/
19 class DispersionPolynomial: public SubStateVectorArray<Dispersion> {
20 public:
21  DispersionPolynomial(const blitz::Array<double, 1>& Coeff,
22  const blitz::Array<bool, 1>& Used_flag,
23  const Unit& Coeff_unit,
24  const std::string& Band_name,
25  int Number_pixel,
26  bool Is_one_based);
27  DispersionPolynomial(const blitz::Array<double, 1>& Coeff,
28  const blitz::Array<bool, 1>& Used_flag,
29  const std::string& Coeff_unit_name,
30  const std::string& Band_name,
31  int Number_pixel,
32  bool Is_one_based);
33  virtual ~DispersionPolynomial() {}
34 
35 //-----------------------------------------------------------------------
38 //-----------------------------------------------------------------------
39 
40  double dispersion_offset() const { return coeff.value()(0); }
41 
42 //-----------------------------------------------------------------------
45 //-----------------------------------------------------------------------
46 
47  double dispersion_spacing() const { return coeff.value()(1); }
48 
49 //-----------------------------------------------------------------------
52 //-----------------------------------------------------------------------
53 
55  {
56  if(sv_cov_sub.rows() < 1)
57  return 0;
58  double t = sv_cov_sub(0,0);
59  return (t < 0 ? 0 : sqrt(t));
60  }
61 
62 //-----------------------------------------------------------------------
65 //-----------------------------------------------------------------------
66 
68  {
69  if(sv_cov_sub.rows() < 2)
70  return 0;
71  double t = sv_cov_sub(1,1);
72  return (t < 0 ? 0 : sqrt(t));
73  }
74 
75  virtual boost::shared_ptr<Dispersion> clone() const;
76 
77  virtual std::string sub_state_identifier() const { return "dispersion/" + band_name_; }
78 
79  virtual std::string state_vector_name_i(int i) const;
80  virtual SpectralDomain pixel_grid() const;
81  virtual void print(std::ostream& Os) const;
82 private:
83  void initialize();
84  bool is_one_based;
85  Unit coeff_unit;
86  std::string band_name_;
89  blitz::Array<double, 1> index_array;
90  // Very similar to index_array, but always 1 based.
91  blitz::Array<int, 1> spectral_index;
92 };
93 }
94 #endif
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
DispersionPolynomial(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const Unit &Coeff_unit, const std::string &Band_name, int Number_pixel, bool Is_one_based)
Constructor.
virtual SpectralDomain pixel_grid() const
Returns as list of grid points for each instrument pixel, and the gradient of the points wrt the stat...
double dispersion_spacing() const
Dispersion spacing.
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
virtual void print(std::ostream &Os) const
blitz::Array< double, 2 > sv_cov_sub
The subset of cov_full that is "owned" by this class, what was passed through update_sub_state.
double dispersion_offset_uncertainty() const
Dispersion offset uncertainty.
const blitz::Array< T, D > & value() const
Definition: array_ad.h:306
double dispersion_spacing_uncertainty() const
Dispersion spacing uncertainty.
double dispersion_offset() const
Dispersion offset.
This is an implementation of Dispersion that uses a polynomial expression to calculate the wavenumber...
Libraries such as boost::units allow unit handling where we know the units at compile time...
Definition: unit.h:25
It is common to have a class that is an Observable with a set of coefficients, a subset of which are ...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual boost::shared_ptr< Dispersion > clone() const
Clone an Dispersion object.
virtual std::string sub_state_identifier() const
Return a string to identify this part of the state, this name should be all lower case and seperate p...

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