ReFRACtor
radiance_scaling_sv_fit.h
Go to the documentation of this file.
1 #ifndef RADIANCE_SCALING_FITTED_H
2 #define RADIANCE_SCALING_FITTED_H
3 #include "radiance_scaling.h"
4 #include "double_with_unit.h"
7 
8 namespace FullPhysics {
9 
10 /****************************************************************/
16  public SubStateVectorArray<InstrumentCorrection> {
17 public:
18 //-----------------------------------------------------------------------
28 //-----------------------------------------------------------------------
29 
30  RadianceScalingSvFit(const blitz::Array<double, 1>& Coeff,
31  const blitz::Array<bool, 1>& Used_flag,
32  const DoubleWithUnit& Band_ref,
33  const std::string& Band_name)
34  : RadianceScaling(Coeff, Band_ref, Band_name),
35  SubStateVectorArray<InstrumentCorrection>(Coeff, Used_flag)
36  { }
37 
38  virtual ~RadianceScalingSvFit() {}
39 
40  virtual std::string sub_state_identifier() const { return "radiance_scaling_sv_fit"; }
41 
42  virtual std::string state_vector_name_i(int i) const;
44 
45  virtual void apply_correction
46  (const SpectralDomain& Pixel_grid,
47  const std::vector<int>& Pixel_list,
48  SpectralRange& Radiance) const;
49  virtual void print(std::ostream& Os) const;
50 
51  virtual void notify_update(const StateVector& Sv)
52  {
53  // Call base notify to handle SV stuff
55 
56  // Then set scaling_coeff to reference true coeff array, which is an ArrayAd
58  };
59 
60  //-----------------------------------------------------------------------
62  //-----------------------------------------------------------------------
63 
64  blitz::Array<double, 1> radiance_scaling_coeff_uncertainty() const
65  {
66  blitz::Array<double, 1> res(sv_cov_sub.rows());
67  if(res.rows() <= 0) {
68  res.resize(1);
69  res = 0;
70  }
71  for(int idx = 0; idx < sv_cov_sub.rows(); idx++) {
72  double cov_val = sv_cov_sub(idx, idx);
73  res(idx) = (cov_val < 0 ? 0 : sqrt(cov_val));
74  }
75  return res;
76  }
77 };
78 }
79 #endif
This abstract class provides the generic capabilities for applying a radiance scaling to a Radiance...
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...
Implements a fitted radiance scaling correction.
virtual void print(std::ostream &Os) const
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
ArrayAd< double, 1 > scaling_coeff
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.
virtual void notify_update(const StateVector &Sv)
Called when the Observed object is updated.
virtual boost::shared_ptr< InstrumentCorrection > clone() const
Clone an InstrumentCorrection object.
blitz::Array< double, 1 > radiance_scaling_coeff_uncertainty() const
Assumed uncertainty of radiance scaling coefficients.
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
We frequently have a double with units associated with it.
This handles informing a set of interested objects when the state vector has updated.
Definition: state_vector.h:16
We have a number of different spectrums that appear in different parts of the code.
void reference(const ArrayAd< T, D > &V)
Definition: array_ad.h:372
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 void notify_update(const StateVector &Sv)
Called when the Observed object is updated.
virtual void apply_correction(const SpectralDomain &Pixel_grid, const std::vector< int > &Pixel_list, SpectralRange &Radiance) const
Apply correction to radiance values, in place.
RadianceScalingSvFit(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const DoubleWithUnit &Band_ref, const std::string &Band_name)
Constructor.
This class models an Instrument correction.

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