ReFRACtor
spectral_parameters_output.cc
Go to the documentation of this file.
2 
3 using namespace FullPhysics;
4 using namespace blitz;
5 
6 #ifdef HAVE_LUA
7 #include "register_lua.h"
9 .def(luabind::constructor<const boost::shared_ptr<ForwardModel>&, const boost::shared_ptr<Observation>&>())
11 #endif
12 
13 // Adapter class to take things from ForwardModel into format needed
14 // for output
16 public:
18  : fm(Fm), meas(inst_meas) {}
19  blitz::Array<double, 1> spectral_domain_values() const
20  {
21  return meas->radiance_all().spectral_domain().data();
22  }
23 
24  std::string spectral_domain_name() const
25  {
26  return fm->spectral_domain_type_preference() == SpectralDomain::PREFER_WAVELENGTH ?
27  "wavelength" : "wavenumber" ;
28  }
29 
30  blitz::Array<double, 1> measured_radiance() const
31  {
32  return meas->radiance_all().spectral_range().data();
33  }
34 
35  blitz::Array<double, 1> measured_radiance_uncert() const
36  {
37  return meas->radiance_all().spectral_range().uncertainty();
38  }
39 
40  int number_pixel() const
41  {
42  return meas->radiance_all().spectral_domain().data().rows();
43  }
44 
45  Array<int, 1> number_pixel_each_band() const
46  {
47  Array<int, 1> res(fm->num_channels());
48 
49  for(int i = 0; i < res.rows(); ++i) {
50  boost::optional<blitz::Range> pr = fm->stacked_pixel_range(i);
51 
52  if(pr) {
53  res(i) = pr->length();
54  } else {
55  res(i) = 0;
56  }
57  }
58 
59  return res;
60  }
61 
62 private:
65 };
66 
67 // See base class for description
68 
70 {
72  out->register_data_source("/SpectralParametersOutput/num_colors",
74  out->register_data_source("/SpectralParametersOutput/num_colors_per_band",
76  out->register_data_source("/SpectralParametersOutput/" + fmc->spectral_domain_name(),
78  out->register_data_source("/SpectralParametersOutput/measured_radiance",
80  out->register_data_source("/SpectralParametersOutput/measured_radiance_uncert",
82 }
blitz::Array< double, 1 > spectral_domain_values() const
ForwardModelCalc(const boost::shared_ptr< ForwardModel > &Fm, const boost::shared_ptr< Observation > &inst_meas)
virtual void register_output(const boost::shared_ptr< Output > &out) const
Register portions of class that will be written to output.
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
Apply value function to a blitz array.
blitz::Array< double, 1 > measured_radiance_uncert() const
This registers the portions of the ForwardModel class that should be written as output.
As described in the Output class, we have a decentralized model of producing output for L2 Full Physi...
Array< int, 1 > number_pixel_each_band() const
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
blitz::Array< double, 1 > measured_radiance() const
std::string spectral_domain_name() const

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