ReFRACtor
radiance_scaling_sv_fit.cc
Go to the documentation of this file.
2 #include "ostream_pad.h"
3 #include <boost/lexical_cast.hpp>
4 
5 using namespace FullPhysics;
6 using namespace blitz;
7 
8 #ifdef HAVE_LUA
9 #include "register_lua.h"
11 .def(luabind::constructor<const blitz::Array<double, 1>&,
12  const blitz::Array<bool, 1>&,
13  const DoubleWithUnit&,
14  const std::string&>())
16 #endif
17 
19 (const SpectralDomain& Pixel_grid,
20  const std::vector<int>& Pixel_list,
21  SpectralRange& Radiance) const
22 {
23  ArrayAd<double, 1> grid_ad(Pixel_list.size(), Pixel_grid.data_ad().number_variable());
24  for (int i = 0; i < (int) Pixel_list.size(); i++) {
25  grid_ad(i) = Pixel_grid.data_ad()(Pixel_list[i]);
26  }
27  grid_ad.resize_number_variable(coeff.number_variable());
28  SpectralDomain grid_sd(grid_ad, Pixel_grid.units());
29  apply_scaling(grid_sd, Radiance);
30 }
31 
33 {
35  (new RadianceScalingSvFit(coeff.value().copy(), used_flag, band_ref, band_name));
36 }
37 
39 {
40  std::string res ="Radiance Scaling " + band_name;
41  if(i == 0)
42  res += " Scale";
43  else if(i == 1)
44  res += " Slope, Ref: " + boost::lexical_cast<std::string>(band_ref.value) + " " + band_ref.units.name();
45  else
46  res += " Coefficient " + boost::lexical_cast<std::string>(i + 1);
47  return res;
48 }
49 
50 void RadianceScalingSvFit::print(std::ostream& Os) const
51 {
52  Os << "RadianceScalingSvFit:" << std::endl;
53  OstreamPad opad(Os, " ");
55  opad.strict_sync();
56 }
void resize_number_variable(int nvar)
Definition: array_ad.h:165
virtual void print(std::ostream &Os) const
This is a filtering stream that adds a pad to the front of every line written out.
Definition: ostream_pad.h:32
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).
const ArrayAd< double, 1 > & data_ad() const
Underlying data, possibly with a Jacobian.
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
Apply value function to a blitz array.
virtual boost::shared_ptr< InstrumentCorrection > clone() const
Clone an InstrumentCorrection object.
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.
int number_variable() const
Definition: array_ad.h:376
We have a number of different spectrums that appear in different parts of the code.
const Unit units() const
Units that go with data()
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
#define REGISTER_LUA_END()
Definition: register_lua.h:134
virtual void apply_correction(const SpectralDomain &Pixel_grid, const std::vector< int > &Pixel_list, SpectralRange &Radiance) const
Apply correction to radiance values, in place.
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