ReFRACtor
absorber_vmr.cc
Go to the documentation of this file.
1 #include "absorber_vmr.h"
2 using namespace FullPhysics;
3 
4 #ifdef HAVE_LUA
5 #include "register_lua.h"
8 
9 // typedef to distinguish between copying value or moving value (C++11) push_back prototoypes
10 typedef void(std::vector<boost::shared_ptr<AbsorberVmr> >::*pbt1)(
11  const std::vector<boost::shared_ptr<AbsorberVmr> >::value_type&);
12 
13 REGISTER_LUA_CLASS_NAME(std::vector<boost::shared_ptr<AbsorberVmr> >, VectorAbsorberVmr)
14 .def(luabind::constructor<>())
15 .def("push_back", ((pbt1) &std::vector<boost::shared_ptr<AbsorberVmr> >::push_back))
17 #endif
18 
19 //-----------------------------------------------------------------------
21 //-----------------------------------------------------------------------
22 
24 {
25  ArrayAd<double, 1> pgrid = P.pressure_grid().convert(Unit("Pa")).value;
26  blitz::Array<AutoDerivative<double>, 1> res(pgrid.rows());
27  for(int i = 0; i < res.rows(); ++i)
28  res(i) = volume_mixing_ratio(pgrid(i));
29  return ArrayAd<double, 1>(res);
30 }
ArrayAdWithUnit< T, D > convert(const Unit &R) const
Convert to the given units.
Definition: doxygen.h:52
STL namespace.
#define REGISTER_LUA_CLASS(X)
Definition: register_lua.h:116
virtual AutoDerivative< double > volume_mixing_ratio(const AutoDerivative< double > &P) const =0
This returns the volume mixing ratio at the given pressure level.
#define REGISTER_LUA_CLASS_NAME(X, Y)
Definition: register_lua.h:129
virtual ArrayAd< double, 1 > vmr_grid(const Pressure &P) const
Return the vmr on the pressure grid.
Definition: absorber_vmr.cc:23
void(std::vector< std::string >::* pbt1)(const std::vector< std::string >::value_type &)
Definition: register_lua.cc:52
This gives the Gas Absorber Volumn mixing ratio for a single gas.
Definition: absorber_vmr.h:17
This class maintains the pressure portion of the state.
Definition: pressure.h:32
Libraries such as boost::units allow unit handling where we know the units at compile time...
Definition: unit.h:25
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 ArrayAdWithUnit< double, 1 > pressure_grid() const =0
This returns the pressure grid to use for layer retrieval, along with the gradient of each of the pre...
int rows() const
Definition: array_ad.h:368

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