ReFRACtor
pressure_fixed_level_output.cc
Go to the documentation of this file.
2 #include "fill_value.h"
3 
4 using namespace FullPhysics;
5 using namespace blitz;
6 
7 #ifdef HAVE_LUA
8 #include "register_lua.h"
9 // Lua doesn't know to cast a pointer type of base class to a derived class.
10 // Add a conversion routine.
13 {
16  (boost::dynamic_pointer_cast<PressureFixedLevel>(P), Sv));
17 }
19 .scope
20 [
21  luabind::def("create", &press_create)
22 ]
24 #endif
25 
27 public:
30  : p(P), sv(Sv) {}
32  {
33  firstIndex i1; secondIndex i2; thirdIndex i3; fourthIndex i4;
34  Array<double, 1> dsurf_dstate = p->surface_pressure().value.gradient();
35  Array<double, 1> t(dsurf_dstate.rows());
36  t = sum(sv->state_covariance()(i1, i2) * dsurf_dstate(i2), i2);
37  double t2 = sum(dsurf_dstate * t);
38  return (t2 > 0 ? sqrt(t2) : 0);
39  }
40  Array<double, 1> pressure_grid_value() const
41  {
42  return p->pressure_grid().value.value();
43  }
44 private:
47 };
48 
50 {
51  // Freeze the pressure state
52  boost::shared_ptr<Pressure> pfreeze = p->clone();
53  out->register_data_source("/RetrievalResults/surface_pressure_apriori_fph",
55 }
56 
57 // See base class for description
58 
60 {
61  out->register_data_source("/RetrievalResults/surface_pressure_fph",
63  boost::dynamic_pointer_cast<Pressure>(p));
65  phelp(new PressureFixedLevelOutputHelper(p, sv));
66  out->register_data_source("/RetrievalResults/surface_pressure_uncert_fph",
68  out->register_data_source("/RetrievalResults/num_active_levels",
70  out->register_data_source_pad("/RetrievalResults/vector_pressure_levels",
72  p->max_number_level(), fill_value<double>());
73 }
74 
virtual void register_output(const boost::shared_ptr< Output > &out) const
Register portions of class that will be written to output.
PressureFixedLevelOutputHelper(const boost::shared_ptr< Pressure > &P, const boost::shared_ptr< StateVector > &Sv)
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
Array< double, 1 > pressure_grid_value() const
virtual void register_output_apriori(const boost::shared_ptr< Output > &out) const
Register apriori portions of class.
Apply value function to a blitz array.
double surface_pressure_value() const
Return the current surface pressure value, without the gradient.
Definition: pressure.h:48
As described in the Output class, we have a decentralized model of producing output for L2 Full Physi...
blitz::Array< double, 1 > pressure_active_levels() const
Return the pressure on the fixed levels, but only include the "active" portion.
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"
This registers the portions of the PressureFixedLevel class that should be written as output...
int number_active_level() const
Number of active levels, this is just the size of pressure_grid for the current surface pressure...

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