ReFRACtor
aerosol_property_imp_base.h
Go to the documentation of this file.
1 #ifndef AEROSOL_PROPERTY_IMP_BASE_H
2 #define AEROSOL_PROPERTY_IMP_BASE_H
3 
4 #include "aerosol_property.h"
6 #include <boost/lexical_cast.hpp>
7 
8 namespace FullPhysics {
9 /****************************************************************/
18 class AerosolPropertyImpBase: public SubStateVectorArray<AerosolProperty> {
19 public:
21  virtual boost::shared_ptr<AerosolProperty> clone() const = 0;
24  const boost::shared_ptr<RelativeHumidity>& Rh) const = 0;
26  const = 0;
28  const = 0;
29  virtual ArrayAd<double, 3>
30  phase_function_moment_each_layer(double wn, int nmom = -1,
31  int nscatt = -1) const = 0;
32 
33  virtual std::string sub_state_identifier() const { return "aerosol/property"; }
34 
35  virtual std::string state_vector_name_i(int i) const
36  {
37  return "Aerosol Property Coeff " + boost::lexical_cast<std::string>(i + 1);
38  }
39 
40 //-----------------------------------------------------------------------
45 //-----------------------------------------------------------------------
46 
47  virtual void print(std::ostream& Os) const { Os << desc(); }
48 
49 //-----------------------------------------------------------------------
52 //-----------------------------------------------------------------------
53 
54  virtual std::string desc() const { return "AerosolPropertyImpBase"; }
55 
56 //-----------------------------------------------------------------------
59 //-----------------------------------------------------------------------
60 
61  blitz::Array<double, 1> aerosol_parameter() const
62  {
63  return coefficient().value();
64  }
65 
66 //-----------------------------------------------------------------------
68 //-----------------------------------------------------------------------
69 
70  blitz::Array<double, 1> aerosol_parameter_uncertainty() const
71  {
72  blitz::Array<double, 1> uncert(coefficient().rows());
73  for(int i = 0; i < sv_cov_sub.rows(); i++)
74  uncert(i) = (sv_cov_sub(i,i) > 0 ? sqrt(sv_cov_sub(i, i)) : 0.0);
75  return uncert;
76  }
77 
78 protected:
79  // Don't think we need a cache, but if we end up needing it can add
80  // this like we have in AerosolExtinctionImpBase.
81  // mutable bool cache_stale;
82 
83 //-----------------------------------------------------------------------
85 //-----------------------------------------------------------------------
86 
87  void init(const blitz::Array<double, 1>& Coeff,
88  const blitz::Array<bool, 1>& Used_flag)
89  {
91  }
92 
93 //-----------------------------------------------------------------------
96 //-----------------------------------------------------------------------
97 
99 
100 //-----------------------------------------------------------------------
104 //-----------------------------------------------------------------------
105  AerosolPropertyImpBase(const blitz::Array<double, 1>& Coeff,
106  const blitz::Array<bool, 1>& Used_flag)
107  : SubStateVectorArray<AerosolProperty>(Coeff, Used_flag)
108  { }
109 };
110 }
111 #endif
This gives the Aerosol properties for an Aerosol.
AerosolPropertyImpBase()
Default constructor, derived class should call init if they use this constructor. ...
virtual std::string desc() const
Description of object, to be printed to stream.
virtual void print(std::ostream &Os) const
Print to stream.
blitz::Array< double, 2 > sv_cov_sub
The subset of cov_full that is "owned" by this class, what was passed through update_sub_state.
virtual ArrayAd< double, 1 > scattering_coefficient_each_layer(double wn) const =0
Return scattering coefficient for the given wave number for each layer.
As a design principle, we have each base class with the absolutely minimum interface needed for use f...
blitz::Array< double, 1 > aerosol_parameter_uncertainty() const
Returns the uncertainty of the aerosol type coefficients.
blitz::Array< double, 1 > aerosol_parameter() const
Returns the value of the coefficients used to generate the aerosol property.
const blitz::Array< T, D > & value() const
Definition: array_ad.h:306
virtual ArrayAd< double, 1 > extinction_coefficient_each_layer(double wn) const =0
Return extinction coefficient for the given wave number, for each layer.
void init(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag)
Initialize object.
virtual ArrayAd< double, 3 > phase_function_moment_each_layer(double wn, int nmom=-1, int nscatt=-1) const =0
Return phase function moments for the given wave number for each layer.
It is common to have a class that is an Observable with a set of coefficients, a subset of which are ...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
void init(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const boost::shared_ptr< Pressure > &Press=boost::shared_ptr< Pressure >(), bool Mark_according_to_press=true, int Pdep_start=0)
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
AerosolPropertyImpBase(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag)
Constructor that sets the coefficient() and used_flag() values.
virtual std::string sub_state_identifier() const
Return a string to identify this part of the state, this name should be all lower case and seperate p...
virtual boost::shared_ptr< AerosolProperty > clone() const =0
Clone a AerosolProperty object.

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