ReFRACtor
absorber_vmr_scaled.cc
Go to the documentation of this file.
1 #include <boost/bind.hpp>
2 #include "absorber_vmr_scaled.h"
3 #include "linear_interpolate.h"
4 
5 using namespace FullPhysics;
6 using namespace blitz;
7 
8 #ifdef HAVE_LUA
9 #include "register_lua.h"
12 #endif
13 
14 //-----------------------------------------------------------------------
16 //-----------------------------------------------------------------------
17 
20  double Scale,
21  bool Scale_flag,
22  const std::string& Gas_name)
23 {
24  Array<bool, 1> flag(1);
25  Array<double, 1> val(flag.shape());
26  flag(0) = Scale_flag;
27  val(0) = Scale;
28  init(Gas_name, val, flag, Press, false);
29 }
30 
32 {
33  blitz::Array<double, 1> v_profile( vmr_profile() );
34  blitz::Array<double, 1> press_profile( pressure_profile() );
35 
36  std::vector<AutoDerivative<double> > plist;
37  std::vector<AutoDerivative<double> > vlist;
38  if (press_profile.rows() != v_profile.rows()) {
39  std::stringstream err_msg;
40  err_msg << "Size of pressure grid: "
41  << press_profile.rows()
42  << " != size of vmr levels: "
43  << v_profile.rows();
44  throw Exception(err_msg.str());
45  }
46  for(int i = 0; i < press_profile.rows(); ++i) {
47  AutoDerivative<double> t2 = v_profile(i) * coefficient()(0);
48  vlist.push_back(t2);
49  plist.push_back(press_profile(i));
50  }
52  lin_type;
54  (new lin_type(plist.begin(), plist.end(), vlist.begin()));
55  vmr = boost::bind(&lin_type::operator(), lin, _1);
56 }
57 
58 void AbsorberVmrScaled::print(std::ostream& Os) const
59 {
60  Os << "AbosorberVmrScaled\n";
61 }
This class takes a set of points and values, and linearly interpolates between those values...
AbsorberVmrScaled(const boost::shared_ptr< Pressure > &Press, double Scale, bool Scale_flag, const std::string &Gas_name)
Constructor.
This is the base of the exception hierarchy for Full Physics code.
Definition: fp_exception.h:16
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
Apply value function to a blitz array.
virtual void calc_vmr() const
Derived classes should provide a function to fill in vmr when this is called.
This gives the Gas Absorber Volumn mixing ratio for a single gas.
Definition: absorber_vmr.h:17
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
This class maps the state vector to the absorber VMR on each level.
virtual void print(std::ostream &Os) const
Print to stream.

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