ReFRACtor
absorber.h
Go to the documentation of this file.
1 #ifndef ABSORBER_H
2 #define ABSORBER_H
3 #include "absorber_vmr.h"
5 #include "observer.h"
6 #include "auto_derivative.h"
7 #include "accumulated_timer.h"
8 #include <vector>
9 
10 namespace FullPhysics {
11  class Pressure;
12  class Temperature;
13  class Altitude;
14 /****************************************************************/
27 class Absorber : virtual public StateVectorObserver,
28  public Observable<Absorber> {
29 public:
30  virtual ~Absorber() {}
32  virtual void add_observer(Observer<Absorber>& Obs)
33  { add_observer_do(Obs, *this);}
34  virtual void remove_observer(Observer<Absorber>& Obs)
35  { remove_observer_do(Obs, *this);}
36 
37 //-----------------------------------------------------------------------
39 //-----------------------------------------------------------------------
40 
41  virtual int number_species() const
42  {
43  // Not sure of what the issue is, but SWIG 2.0.9 isn't happy with this
44  // being a pure virtual. Just return a default value, this function gets
45  // overridden by any "real" class derived from Absorber.
46  return 0;
47  }
48 
49 //-----------------------------------------------------------------------
52 //-----------------------------------------------------------------------
53 
54  virtual std::string gas_name(int Species_index) const = 0;
55 
56  virtual int gas_index(const std::string& Name) const;
57 
58 //-----------------------------------------------------------------------
67 //-----------------------------------------------------------------------
68 
69  virtual ArrayAd<double, 2>
70  optical_depth_each_layer(double wn, int spec_index) const = 0;
71 
72 //-----------------------------------------------------------------------
77 //-----------------------------------------------------------------------
78 
79  virtual AutoDerivative<double> xgas(const std::string& Gas_name) const = 0;
80 
81 //-----------------------------------------------------------------------
83 //-----------------------------------------------------------------------
84 
85  virtual boost::shared_ptr<AbsorberVmr> absorber_vmr(const std::string& gas_name) const = 0;
86 
87 //-----------------------------------------------------------------------
94 //-----------------------------------------------------------------------
95 
96  virtual boost::shared_ptr<Absorber> clone() const = 0;
97 
98 //-----------------------------------------------------------------------
105 //-----------------------------------------------------------------------
106 
108  (const boost::shared_ptr<Pressure>& Press,
109  const boost::shared_ptr<Temperature>& Temp,
110  const std::vector<boost::shared_ptr<Altitude> >& Alt) const = 0;
111 
112 };
113 }
114 #endif
115 
116 
virtual int number_species() const
Number of species.
Definition: absorber.h:41
virtual ArrayAd< double, 2 > optical_depth_each_layer(double wn, int spec_index) const =0
This gives the optical depth for each layer, for the given wave number.
virtual void add_observer(Observer< Absorber > &Obs)
Add an observer.
Definition: absorber.h:32
virtual std::string gas_name(int Species_index) const =0
Name of gases, in the order that optical_depth_each_layer returns them.
virtual boost::shared_ptr< Absorber > clone() const =0
Clone an Absorber object.
virtual ~Absorber()
Definition: absorber.h:30
void add_observer_do(Observer< Absorber > &Obs, Absorber &t)
Add an observer.
Definition: observer.h:148
This is an observer of a StateVector.
virtual boost::shared_ptr< AbsorberVmr > absorber_vmr(const std::string &gas_name) const =0
Returns the AbsorberVmr object for a given species index.
void remove_observer_do(Observer< Absorber > &Obs, Absorber &t)
Remove an observer.
Definition: observer.h:173
virtual AutoDerivative< double > xgas(const std::string &Gas_name) const =0
This calculates the gas column, e.g., XCO2.
virtual void remove_observer(Observer< Absorber > &Obs)
Remove an observer.
Definition: absorber.h:34
Mixin for a class that allows other classes to observe it state.
Definition: observer.h:12
static AccumulatedTimer timer
Timer for optical_depth_each_layer.
Definition: absorber.h:31
This is a simple timer class that can be used to accumulate the time spent in multiple calls to a fun...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual int gas_index(const std::string &Name) const
Map a gas name to the index number it appears in optical_depth_each_layer.
Definition: absorber.cc:28
This class maintains the absorber portion of the state.
Definition: absorber.h:27

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