ReFRACtor
|
Implementation of Aerosol. More...
#include <aerosol_optical.h>
Public Member Functions | |
AerosolOptical (const std::vector< boost::shared_ptr< AerosolExtinction > > &Aext, const std::vector< boost::shared_ptr< AerosolProperty > > &Aerosol_prop, const boost::shared_ptr< Pressure > &Press, const boost::shared_ptr< RelativeHumidity > &Rh, double Reference_wn=1e4/0.755) | |
Create an aerosol. More... | |
virtual | ~AerosolOptical () |
virtual void | add_observer (Observer< Aerosol > &Obs) |
Add an observer. More... | |
void | add_observer_and_keep_reference (boost::shared_ptr< Observer< Aerosol > > &Obs) |
Add an observer and keep a reference to it. More... | |
const boost::shared_ptr< AerosolExtinction > & | aerosol_extinction (int i) const |
Return aerosol extinction. More... | |
void | aerosol_extinction (int i, const boost::shared_ptr< AerosolExtinction > &V) |
Set AerosolExtinction. More... | |
std::vector< std::string > | aerosol_name () const |
Name of aerosols. More... | |
blitz::Array< std::string, 1 > | aerosol_name_arr () const |
Aerosol names, plus the string "total" as the 1st entry. More... | |
double | aerosol_optical_depth (int aer_idx, double pmin=std::numeric_limits< double >::min(), double pmax=std::numeric_limits< double >::max()) const |
This gives the total aerosol optical depth for a given particle. More... | |
double | aerosol_optical_depth_total (double pmin=std::numeric_limits< double >::min(), double pmax=std::numeric_limits< double >::max()) const |
This gives the total optical depth for each particle, plus adds the total optical depth for all particles as the 1st entry. More... | |
const boost::shared_ptr< AerosolProperty > & | aerosol_property (int i) const |
Return aerosol property. More... | |
void | aerosol_property (int i, const boost::shared_ptr< AerosolProperty > &V) |
Set AerosolProperty. More... | |
virtual boost::shared_ptr< Aerosol > | clone () const |
Clone a Aerosol object. More... | |
virtual boost::shared_ptr< Aerosol > | clone (const boost::shared_ptr< Pressure > &Press, const boost::shared_ptr< RelativeHumidity > &Rh) const |
This version of clone takes a pressure to use. More... | |
virtual void | mark_used (const StateVector &Sv, blitz::Array< bool, 1 > &Used) const |
Mark elements that we are actively using (i.e., that aren't ignored). More... | |
virtual void | notify_add (Pressure &Observed_object) |
Called when an object is added to an Observable. More... | |
virtual void | notify_add (AerosolExtinction &Observed_object) |
Called when an object is added to an Observable. More... | |
virtual void | notify_add (AerosolProperty &Observed_object) |
Called when an object is added to an Observable. More... | |
virtual void | notify_add (StateVector &Observed_object) |
Called when an object is added to an Observable. More... | |
virtual void | notify_add () |
virtual void | notify_add () |
virtual void | notify_add () |
virtual void | notify_add () |
virtual void | notify_remove (StateVector &Observed_object) |
Called when an object is removed from an Observable. More... | |
virtual void | notify_remove (Pressure &Observed_object) |
Called when an object is removed from an Observable. More... | |
virtual void | notify_remove (AerosolExtinction &Observed_object) |
Called when an object is removed from an Observable. More... | |
virtual void | notify_remove (AerosolProperty &Observed_object) |
Called when an object is removed from an Observable. More... | |
virtual void | notify_remove () |
virtual void | notify_remove () |
virtual void | notify_remove () |
virtual void | notify_remove () |
virtual void | notify_update (const StateVector &Sv) |
Called when the Observed object is updated. More... | |
virtual void | notify_update (const Pressure &P) |
For performance, we cache some data as we calculate it. More... | |
virtual void | notify_update (const AerosolExtinction &A) |
Called when the Observed object is updated. More... | |
virtual void | notify_update (const AerosolProperty &A) |
Called when the Observed object is updated. More... | |
virtual int | number_particle () const |
Number of aerosol particles. More... | |
virtual ArrayAd< double, 2 > | optical_depth_each_layer (double wn) const |
This gives the optical depth for each layer, for the given wave number. More... | |
virtual ArrayAd< double, 3 > | pf_mom (double wn, int pindex) const |
This calculates the portion of the phase function moments that come from the aerosol for a single particle. More... | |
virtual blitz::Array< double, 3 > | pf_mom (double wn, const blitz::Array< double, 2 > &frac_aer) const |
This calculates the portion of the phase function moments that come from the aerosol. More... | |
virtual ArrayAd< double, 3 > | pf_mom (double wn, const ArrayAd< double, 2 > &frac_aer, int nummom=-1, int numscat=-1) const |
This calculates the portion of the phase function moments that come from the aerosol. More... | |
const boost::shared_ptr< Pressure > & | pressure () const |
Return pressure. More... | |
virtual void | print (std::ostream &Os) const |
std::string | print_to_string () const |
Print to string. More... | |
virtual void | remove_observer (Observer< Aerosol > &Obs) |
Remove an observer. More... | |
virtual ArrayAd< double, 1 > | ssa_each_layer (double wn, int particle_index, const ArrayAd< double, 1 > &Od) const |
This gives the single scatter albedo for each layer, for the given wave number, for the given particle. More... | |
virtual ArrayAd< double, 1 > | ssa_each_layer (double wn) const |
This gives the single scatter albedo for each layer, for the given wave number. More... | |
virtual void | state_vector_name (const StateVector &Sv, blitz::Array< std::string, 1 > &Sv_name) const |
Update any portion of the list of the state vector names that apply to this object. More... | |
Static Public Attributes | |
static AccumulatedTimer | timer |
Timer for Aerosol. More... | |
Protected Member Functions | |
void | add_observer_do (Observer< Aerosol > &Obs, Aerosol &t) |
Add an observer. More... | |
void | add_observer_do (Observer< Aerosol > &Obs) |
void | clean_dead_ptr () |
Remove any dead pointers. More... | |
void | notify_update_do (const Aerosol &Self) |
Function to call to notify Observers of a state change. More... | |
void | remove_observer_do (Observer< Aerosol > &Obs, Aerosol &t) |
Remove an observer. More... | |
void | remove_observer_do (Observer< Aerosol > &Obs) |
Protected Attributes | |
std::list< boost::weak_ptr< Observer< Aerosol > > > | olist |
std::vector< boost::shared_ptr< Observer< Aerosol > > > | ref_list |
Implementation of Aerosol.
This particular implementation does the aerosol calculation by using the aerosol optical properties.
Definition at line 14 of file aerosol_optical.h.
AerosolOptical::AerosolOptical | ( | const std::vector< boost::shared_ptr< AerosolExtinction > > & | Aext, |
const std::vector< boost::shared_ptr< AerosolProperty > > & | Aerosol_prop, | ||
const boost::shared_ptr< Pressure > & | Press, | ||
const boost::shared_ptr< RelativeHumidity > & | Rh, | ||
double | Reference_wn = 1e4/0.755 |
||
) |
Create an aerosol.
Aext | Aerosol extinction for each aerosol. |
Aerosol_prop | Aerosol properties for each aerosol. |
Press | The Pressure object that gives the pressure grid. |
Rh | The RelativeHumidity object that gives the relative humidity. |
Reference_wn | The wavenumber that Aext is given for. This is optional, the default value matches the reference band given in the ATB. |
Definition at line 39 of file aerosol_optical.cc.
|
inlinevirtual |
Definition at line 24 of file aerosol_optical.h.
Add an observer.
Implements FullPhysics::Observable< Aerosol >.
|
inlineinherited |
Add an observer and keep a reference to it.
See the discussion in the Observer class description for details.
Definition at line 107 of file observer.h.
|
inlineprotectedinherited |
Add an observer.
Definition at line 148 of file observer.h.
|
inlineprotectedinherited |
Definition at line 159 of file observer.h.
|
inline |
Return aerosol extinction.
Definition at line 100 of file aerosol_optical.h.
|
inline |
Set AerosolExtinction.
Definition at line 107 of file aerosol_optical.h.
std::vector< std::string > AerosolOptical::aerosol_name | ( | ) | const |
Name of aerosols.
Definition at line 418 of file aerosol_optical.cc.
blitz::Array< std::string, 1 > AerosolOptical::aerosol_name_arr | ( | ) | const |
Aerosol names, plus the string "total" as the 1st entry.
This matches what is returned by aerosol_optical_depth_each_particle_and_total(). This may seem a bit odd, but this is what is expected as output to the HDF file.
Note, this is returned as a blitz::Array rather than the more natural std::vector because this is what is needed to write this out to HDF.
Definition at line 73 of file aerosol_optical.cc.
double AerosolOptical::aerosol_optical_depth | ( | int | aer_idx, |
double | pmin = std::numeric_limits<double>::min() , |
||
double | pmax = std::numeric_limits<double>::max() |
||
) | const |
This gives the total aerosol optical depth for a given particle.
You can optionally supply the pressure range to use, this will report the aod for the levels that fall in that range. The default is to use everything.
Definition at line 372 of file aerosol_optical.cc.
double AerosolOptical::aerosol_optical_depth_total | ( | double | pmin = std::numeric_limits<double>::min() , |
double | pmax = std::numeric_limits<double>::max() |
||
) | const |
This gives the total optical depth for each particle, plus adds the total optical depth for all particles as the 1st entry.
This may seem a bit odd, but this is what is expected as output to the HDF file.
You can optionally supply the pressure range to use, this will report the aod for the levels that fall in that range. The default is to use everything.
Definition at line 407 of file aerosol_optical.cc.
|
inline |
Return aerosol property.
Definition at line 115 of file aerosol_optical.h.
|
inline |
Set AerosolProperty.
Definition at line 122 of file aerosol_optical.h.
|
inlineprotectedinherited |
Remove any dead pointers.
Definition at line 196 of file observer.h.
|
inlinevirtual |
Clone a Aerosol object.
Note that the cloned version will not be attached to and StateVector or Observer<Pressure>, although you can of course attach them after receiving the cloned object.
Implements FullPhysics::Aerosol.
Definition at line 88 of file aerosol_optical.h.
|
virtual |
This version of clone takes a pressure to use.
The intent is that the pressure has been cloned from the original pressure (although this class has no way to verify this). This allows sets of objects to be cloned using a common Pressure clone, e.g. Atmosphere.
Implements FullPhysics::Aerosol.
Definition at line 351 of file aerosol_optical.cc.
|
inlinevirtualinherited |
Mark elements that we are actively using (i.e., that aren't ignored).
You only need to mark the ones that are used as true, everything is already initialized as false. Default is to do nothing.
Reimplemented in FullPhysics::SubStateVectorObserver.
Definition at line 26 of file state_vector_observer.h.
|
inlinevirtualinherited |
Called when an object is added to an Observable.
Default is to do nothing.
Definition at line 47 of file observer.h.
|
inlinevirtualinherited |
Called when an object is added to an Observable.
Default is to do nothing.
Definition at line 47 of file observer.h.
|
inlinevirtualinherited |
Called when an object is added to an Observable.
Default is to do nothing.
Definition at line 47 of file observer.h.
|
inlinevirtualinherited |
Called when an object is added to an Observable.
Default is to do nothing.
Reimplemented in FullPhysics::AtmosphereOco, and FullPhysics::SubStateVectorObserver.
Definition at line 47 of file observer.h.
|
inlinevirtualinherited |
Definition at line 48 of file observer.h.
|
inlinevirtualinherited |
Definition at line 48 of file observer.h.
|
inlinevirtualinherited |
Definition at line 48 of file observer.h.
|
inlinevirtualinherited |
Definition at line 48 of file observer.h.
|
inlinevirtualinherited |
Called when an object is removed from an Observable.
Default is to do nothing.
Definition at line 55 of file observer.h.
|
inlinevirtualinherited |
Called when an object is removed from an Observable.
Default is to do nothing.
Definition at line 55 of file observer.h.
|
inlinevirtualinherited |
Called when an object is removed from an Observable.
Default is to do nothing.
Definition at line 55 of file observer.h.
|
inlinevirtualinherited |
Called when an object is removed from an Observable.
Default is to do nothing.
Reimplemented in FullPhysics::AtmosphereOco, and FullPhysics::SubStateVectorObserver.
Definition at line 55 of file observer.h.
|
inlinevirtualinherited |
Definition at line 56 of file observer.h.
|
inlinevirtualinherited |
Definition at line 56 of file observer.h.
|
inlinevirtualinherited |
Definition at line 56 of file observer.h.
|
inlinevirtualinherited |
Definition at line 56 of file observer.h.
|
inlinevirtual |
Called when the Observed object is updated.
Reimplemented from FullPhysics::Observer< StateVector >.
Definition at line 25 of file aerosol_optical.h.
|
inlinevirtual |
For performance, we cache some data as we calculate it.
This becomes stale when the pressure is changed, so we observe press and when it changes notify other observers that we have changed.
Reimplemented from FullPhysics::Observer< Pressure >.
Definition at line 45 of file aerosol_optical.h.
|
inlinevirtual |
Called when the Observed object is updated.
Reimplemented from FullPhysics::Observer< AerosolExtinction >.
Definition at line 50 of file aerosol_optical.h.
|
inlinevirtual |
Called when the Observed object is updated.
Reimplemented from FullPhysics::Observer< AerosolProperty >.
Definition at line 55 of file aerosol_optical.h.
|
inlineprotectedinherited |
Function to call to notify Observers of a state change.
The object should pass itself to this function, so it can be passed to the Observers.
Definition at line 121 of file observer.h.
|
inlinevirtual |
Number of aerosol particles.
Implements FullPhysics::Aerosol.
Definition at line 67 of file aerosol_optical.h.
|
virtual |
This gives the optical depth for each layer, for the given wave number.
Note this only includes the aerosol portion of this, Atmosphere class combines this with Absorbers and rayleigh scattering.
This calculates the derivatives with respect to the state vector.
This has size of number_active_layer() x number_particle().
Implements FullPhysics::Aerosol.
Definition at line 130 of file aerosol_optical.cc.
|
virtual |
This calculates the portion of the phase function moments that come from the aerosol for a single particle.
This is number_layer x number_moments x number_scatter
wn | The wave number. |
pindex | The particle index. |
Definition at line 236 of file aerosol_optical.cc.
|
virtual |
This calculates the portion of the phase function moments that come from the aerosol.
wn | The wave number. |
frac_aer | This is number_active_layer() x number_particle() |
Definition at line 253 of file aerosol_optical.cc.
|
virtual |
This calculates the portion of the phase function moments that come from the aerosol.
wn | The wave number. |
frac_aer | This is number_active_layer() x number_particle() |
nummom | Number of moments to fill in |
numscat | Number of scatters to fill in |
Implements FullPhysics::Aerosol.
Definition at line 287 of file aerosol_optical.cc.
|
inline |
Return pressure.
Definition at line 130 of file aerosol_optical.h.
|
virtual |
Reimplemented from FullPhysics::StateVectorObserver.
Definition at line 426 of file aerosol_optical.cc.
|
inlineinherited |
Print to string.
This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.
Definition at line 31 of file printable.h.
|
inlinevirtualinherited |
Remove an observer.
Implements FullPhysics::Observable< Aerosol >.
|
inlineprotectedinherited |
Remove an observer.
Definition at line 173 of file observer.h.
|
inlineprotectedinherited |
Definition at line 181 of file observer.h.
|
virtual |
This gives the single scatter albedo for each layer, for the given wave number, for the given particle.
Note this only includes the aerosol portion of this, Atmosphere class combines this with Rayleigh scattering.
We take in the optical depth of each layer. This is just what is returned by optical_depth_each_layer(), we take this in because we can change what the derivative of optical_depth_each_layer is respect to, e.g. in AtmosphereOco we use taua_i.
This calculates the derivative with respect to whatever variables Od is relative to.
This has size of number_active_layer()
Implements FullPhysics::Aerosol.
Definition at line 170 of file aerosol_optical.cc.
|
virtual |
This gives the single scatter albedo for each layer, for the given wave number.
Note this only includes the aerosol portion of this, Atmosphere class combines this with Rayleigh scattering.
This calculates the derivatives with respect to the state vector.
This has size of number_active_layer()
Definition at line 210 of file aerosol_optical.cc.
|
inlinevirtualinherited |
Update any portion of the list of the state vector names that apply to this object.
Default is to do nothing.
Reimplemented in FullPhysics::SubStateVectorObserver.
Definition at line 34 of file state_vector_observer.h.
|
protectedinherited |
Definition at line 200 of file observer.h.
|
protectedinherited |
Definition at line 201 of file observer.h.
|
staticinherited |