ReFRACtor
standard_forward_model_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"
8 // Lua doesn't know to cast a pointer type of base class to a derived class.
9 // Add a conversion routine.
12 {
15  (boost::dynamic_pointer_cast<StandardForwardModel>(fm)));
16 }
18 .scope
19 [
20  luabind::def("create", &oco_fm_out_create)
21 ]
23 #endif
24 
25 // Adapter class to take things from StandardForwardModel into format needed
26 // for output
28 public:
30  : fm(Fm) {}
31 
32  Array<int, 1> samples() const
33  {
34  int num_total_samples = 0;
35  for(int i = 0; i < fm->num_channels(); ++i) {
36  num_total_samples += fm->spectral_domain(i).data().rows();
37  }
38  Array<int, 1> samples(num_total_samples);
39  for(int i = 0; i < fm->num_channels(); ++i) {
40  boost::optional<blitz::Range> pr = fm->stacked_pixel_range(i);
41  if(pr)
42  samples(*pr) = fm->spectral_grid()->low_resolution_grid(i).sample_index();
43  }
44  return samples;
45  }
46 
47 private:
49 };
50 
51 // See base class for description
52 
54 {
56  out->register_data_source("/SpectralParameters/sample_indexes",
58 }
StandardForwardModelCalc(const boost::shared_ptr< StandardForwardModel > &Fm)
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
Apply value function to a blitz array.
virtual void register_output(const boost::shared_ptr< Output > &out) const
Register portions of class that will be written to output.
As described in the Output class, we have a decentralized model of producing output for L2 Full Physi...
This registers the portions of the StandardForwardModel class that should be written as output...
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
def(luabind::constructor< int >()) .def("rows"

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