ReFRACtor
absorber_vmr_level_output.cc
Go to the documentation of this file.
2 #include <boost/algorithm/string.hpp>
3 #include "fill_value.h"
4 
5 using namespace FullPhysics;
6 using namespace blitz;
7 
8 #ifdef HAVE_LUA
9 #include "register_lua.h"
10 // Lua doesn't know to cast a pointer type of base class to a derived class.
11 // Add a conversion routine.
12 boost::shared_ptr<RegisterOutputBase> abs_vmr_level_create
14 {
17  (boost::dynamic_pointer_cast<AbsorberVmrLevel>(A)));
18 }
20 .scope
21 [
22  luabind::def("create", &abs_vmr_level_create)
23 ]
25 #endif
26 
27 // Helper class that get co2_grad_del
29 public:
32  : a_(a), afreeze_(afreeze) { }
33 //-----------------------------------------------------------------------
37 //-----------------------------------------------------------------------
38 
39  double co2_grad_del() const
40  {
41  blitz::Array<double, 1> p = a_->vmr_profile();
42  blitz::Array<double, 1> ap = afreeze_->vmr_profile();
43  double res = fill_value<double>();
44  // Don't try to calculate this unless we have enough levels.
45  if(p.rows() >= 20)
46  res = (p(19) - p(12)) - (ap(19) - ap(12));
47  return res;
48  }
49 private:
51 };
52 
53 // See base class for description
54 
56 {
57  // Freeze the pressure state
59  boost::dynamic_pointer_cast<AbsorberVmrLevel>(a->clone());
60  std::string gname = a->gas_name();
61  boost::algorithm::to_lower(gname);
62  out->register_data_source
63  ("/RetrievalResults/" + gname + "_profile_apriori",
65  if(gname == "co2") {
67  out->register_data_source
68  ("/RetrievalResults/co2_vertical_gradient_delta",
70  }
71 }
72 
74 {
75  std::string gname = a->gas_name();
76  boost::algorithm::to_lower(gname);
77  out->register_data_source
78  ("/RetrievalResults/" + gname + "_profile",
80  out->register_data_source
81  ("/RetrievalResults/" + gname + "_profile_uncert",
83  out->register_data_source
84  ("/RetrievalResults/" + gname + "_profile_covariance_matrix",
86 }
double co2_grad_del() const
This term is useful in the warn level determination.
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.
const Unit A("A", 1.0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0)
This class maps the state vector to the absorber VMR on each level.
blitz::Array< double, 1 > vmr_uncertainty() const
Uncertainty of VMR.
This registers the portions of the AbsorberVmrLevel class that should be written as output...
blitz::Array< double, 2 > vmr_covariance() const
Covariance of vmr profile.
blitz::Array< double, 1 > vmr_profile() const
VMR on the pressure grid.
As described in the Output class, we have a decentralized model of producing output for L2 Full Physi...
AbsorberVmrLevelHelper(const boost::shared_ptr< AbsorberVmrLevel > &a, const boost::shared_ptr< AbsorberVmrLevel > &afreeze)
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"
virtual void register_output_apriori(const boost::shared_ptr< Output > &out) const
Register apriori portions of class.
virtual std::string gas_name() const
This indicates the name of this particular Absorber.

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