ReFRACtor
altitude_output.cc
Go to the documentation of this file.
1 #include "altitude_output.h"
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<Altitude>&, const boost::shared_ptr<Pressure>&>())
11 #endif
12 
14 {
15  blitz::Array<double, 1> pressure_levels(Pres->pressure_grid().convert(units::Pa).value.value());
16  blitz::Array<double, 1> altitude(pressure_levels.shape());
17  for(int lev_idx = 0; lev_idx < altitude.rows(); lev_idx++) {
18  altitude(lev_idx) = Alt->altitude(AutoDerivativeWithUnit<double>(pressure_levels(lev_idx), units::Pa)).convert(units::m).value.value();
19  }
20  return altitude;
21 }
22 
24 {
25  // Freeze the pressure state
26  boost::shared_ptr<Pressure> pfreeze = pres->clone();
27  boost::shared_ptr<Altitude> afreeze = alt->clone();
28 
29  boost::function<blitz::Array<double, 1> ()> f = boost::bind(&altitude_levels, afreeze, pfreeze);
30  out->register_data_source("/RetrievalResults/vector_altitude_levels_apriori", f);
31 }
32 
34 {
35  boost::function<blitz::Array<double, 1>()> f = boost::bind(&altitude_levels, alt, pres);
36  out->register_data_source("/RetrievalResults/vector_altitude_levels", f);
37 }
38 
This is a AutoDerivative that also has units associated with it.
blitz::Array< double, 1 > altitude_levels(boost::shared_ptr< Altitude > &Alt, boost::shared_ptr< Pressure > &Pres)
const Unit Pa("Pa", N/(m *m))
#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.
const Unit m("m", 1.0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
As described in the Output class, we have a decentralized model of producing output for L2 Full Physi...
This registers the portions of the Altitude 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
virtual void register_output_apriori(const boost::shared_ptr< Output > &out) const
Register apriori portions of class.

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