ReFRACtor
FullPhysics::AerosolOptical Class Reference

Implementation of Aerosol. More...

#include <aerosol_optical.h>

+ Inheritance diagram for FullPhysics::AerosolOptical:
+ Collaboration diagram for FullPhysics::AerosolOptical:

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< Aerosolclone () const
 Clone a Aerosol object. More...
 
virtual boost::shared_ptr< Aerosolclone (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AerosolOptical()

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.

Parameters
AextAerosol extinction for each aerosol.
Aerosol_propAerosol properties for each aerosol.
PressThe Pressure object that gives the pressure grid.
RhThe RelativeHumidity object that gives the relative humidity.
Reference_wnThe 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.

◆ ~AerosolOptical()

virtual FullPhysics::AerosolOptical::~AerosolOptical ( )
inlinevirtual

Definition at line 24 of file aerosol_optical.h.

Member Function Documentation

◆ add_observer()

virtual void FullPhysics::Aerosol::add_observer ( Observer< Aerosol > &  Obs)
inlinevirtualinherited

Add an observer.

Implements FullPhysics::Observable< Aerosol >.

Definition at line 31 of file aerosol.h.

◆ add_observer_and_keep_reference()

void FullPhysics::Observable< Aerosol >::add_observer_and_keep_reference ( boost::shared_ptr< Observer< Aerosol > > &  Obs)
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.

◆ add_observer_do() [1/2]

void FullPhysics::Observable< Aerosol >::add_observer_do ( Observer< Aerosol > &  Obs,
Aerosol t 
)
inlineprotectedinherited

Add an observer.

Definition at line 148 of file observer.h.

◆ add_observer_do() [2/2]

void FullPhysics::Observable< Aerosol >::add_observer_do ( Observer< Aerosol > &  Obs)
inlineprotectedinherited

Definition at line 159 of file observer.h.

◆ aerosol_extinction() [1/2]

const boost::shared_ptr<AerosolExtinction>& FullPhysics::AerosolOptical::aerosol_extinction ( int  i) const
inline

Return aerosol extinction.

Definition at line 100 of file aerosol_optical.h.

◆ aerosol_extinction() [2/2]

void FullPhysics::AerosolOptical::aerosol_extinction ( int  i,
const boost::shared_ptr< AerosolExtinction > &  V 
)
inline

Set AerosolExtinction.

Definition at line 107 of file aerosol_optical.h.

◆ aerosol_name()

std::vector< std::string > AerosolOptical::aerosol_name ( ) const

Name of aerosols.

Definition at line 418 of file aerosol_optical.cc.

◆ aerosol_name_arr()

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.

◆ aerosol_optical_depth()

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.

◆ aerosol_optical_depth_total()

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.

◆ aerosol_property() [1/2]

const boost::shared_ptr<AerosolProperty>& FullPhysics::AerosolOptical::aerosol_property ( int  i) const
inline

Return aerosol property.

Definition at line 115 of file aerosol_optical.h.

◆ aerosol_property() [2/2]

void FullPhysics::AerosolOptical::aerosol_property ( int  i,
const boost::shared_ptr< AerosolProperty > &  V 
)
inline

Set AerosolProperty.

Definition at line 122 of file aerosol_optical.h.

◆ clean_dead_ptr()

void FullPhysics::Observable< Aerosol >::clean_dead_ptr ( )
inlineprotectedinherited

Remove any dead pointers.

Definition at line 196 of file observer.h.

◆ clone() [1/2]

virtual boost::shared_ptr<Aerosol> FullPhysics::AerosolOptical::clone ( ) const
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.

◆ clone() [2/2]

boost::shared_ptr< Aerosol > AerosolOptical::clone ( const boost::shared_ptr< Pressure > &  Press,
const boost::shared_ptr< RelativeHumidity > &  Rh 
) const
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.

◆ mark_used()

virtual void FullPhysics::StateVectorObserver::mark_used ( const StateVector Sv,
blitz::Array< bool, 1 > &  Used 
) const
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.

◆ notify_add() [1/8]

virtual void FullPhysics::Observer< Pressure >::notify_add ( Pressure Observed_object)
inlinevirtualinherited

Called when an object is added to an Observable.

Default is to do nothing.

Definition at line 47 of file observer.h.

◆ notify_add() [2/8]

virtual void FullPhysics::Observer< AerosolExtinction >::notify_add ( AerosolExtinction Observed_object)
inlinevirtualinherited

Called when an object is added to an Observable.

Default is to do nothing.

Definition at line 47 of file observer.h.

◆ notify_add() [3/8]

virtual void FullPhysics::Observer< AerosolProperty >::notify_add ( AerosolProperty Observed_object)
inlinevirtualinherited

Called when an object is added to an Observable.

Default is to do nothing.

Definition at line 47 of file observer.h.

◆ notify_add() [4/8]

virtual void FullPhysics::Observer< StateVector >::notify_add ( StateVector Observed_object)
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.

◆ notify_add() [5/8]

virtual void FullPhysics::Observer< AerosolExtinction >::notify_add ( )
inlinevirtualinherited

Definition at line 48 of file observer.h.

◆ notify_add() [6/8]

virtual void FullPhysics::Observer< Pressure >::notify_add ( )
inlinevirtualinherited

Definition at line 48 of file observer.h.

◆ notify_add() [7/8]

virtual void FullPhysics::Observer< AerosolProperty >::notify_add ( )
inlinevirtualinherited

Definition at line 48 of file observer.h.

◆ notify_add() [8/8]

virtual void FullPhysics::Observer< StateVector >::notify_add ( )
inlinevirtualinherited

Definition at line 48 of file observer.h.

◆ notify_remove() [1/8]

virtual void FullPhysics::Observer< Pressure >::notify_remove ( Pressure Observed_object)
inlinevirtualinherited

Called when an object is removed from an Observable.

Default is to do nothing.

Definition at line 55 of file observer.h.

◆ notify_remove() [2/8]

virtual void FullPhysics::Observer< AerosolExtinction >::notify_remove ( AerosolExtinction Observed_object)
inlinevirtualinherited

Called when an object is removed from an Observable.

Default is to do nothing.

Definition at line 55 of file observer.h.

◆ notify_remove() [3/8]

virtual void FullPhysics::Observer< AerosolProperty >::notify_remove ( AerosolProperty Observed_object)
inlinevirtualinherited

Called when an object is removed from an Observable.

Default is to do nothing.

Definition at line 55 of file observer.h.

◆ notify_remove() [4/8]

virtual void FullPhysics::Observer< StateVector >::notify_remove ( StateVector Observed_object)
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.

◆ notify_remove() [5/8]

virtual void FullPhysics::Observer< StateVector >::notify_remove ( )
inlinevirtualinherited

Definition at line 56 of file observer.h.

◆ notify_remove() [6/8]

virtual void FullPhysics::Observer< AerosolProperty >::notify_remove ( )
inlinevirtualinherited

Definition at line 56 of file observer.h.

◆ notify_remove() [7/8]

virtual void FullPhysics::Observer< AerosolExtinction >::notify_remove ( )
inlinevirtualinherited

Definition at line 56 of file observer.h.

◆ notify_remove() [8/8]

virtual void FullPhysics::Observer< Pressure >::notify_remove ( )
inlinevirtualinherited

Definition at line 56 of file observer.h.

◆ notify_update() [1/4]

virtual void FullPhysics::AerosolOptical::notify_update ( const StateVector Observed_object)
inlinevirtual

Called when the Observed object is updated.

Reimplemented from FullPhysics::Observer< StateVector >.

Definition at line 25 of file aerosol_optical.h.

◆ notify_update() [2/4]

virtual void FullPhysics::AerosolOptical::notify_update ( const Pressure P)
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.

◆ notify_update() [3/4]

virtual void FullPhysics::AerosolOptical::notify_update ( const AerosolExtinction Observed_object)
inlinevirtual

Called when the Observed object is updated.

Reimplemented from FullPhysics::Observer< AerosolExtinction >.

Definition at line 50 of file aerosol_optical.h.

◆ notify_update() [4/4]

virtual void FullPhysics::AerosolOptical::notify_update ( const AerosolProperty Observed_object)
inlinevirtual

Called when the Observed object is updated.

Reimplemented from FullPhysics::Observer< AerosolProperty >.

Definition at line 55 of file aerosol_optical.h.

◆ notify_update_do()

void FullPhysics::Observable< Aerosol >::notify_update_do ( const Aerosol Self)
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.

◆ number_particle()

virtual int FullPhysics::AerosolOptical::number_particle ( ) const
inlinevirtual

Number of aerosol particles.

Implements FullPhysics::Aerosol.

Definition at line 67 of file aerosol_optical.h.

◆ optical_depth_each_layer()

ArrayAd< double, 2 > AerosolOptical::optical_depth_each_layer ( double  wn) const
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.

◆ pf_mom() [1/3]

ArrayAd< double, 3 > AerosolOptical::pf_mom ( double  wn,
int  pindex 
) const
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

Parameters
wnThe wave number.
pindexThe particle index.
Returns
Scattering moments for each layer. This is number_moment + 1 x number_layer() x number scattering matrix elements

Definition at line 236 of file aerosol_optical.cc.

◆ pf_mom() [2/3]

blitz::Array< double, 3 > AerosolOptical::pf_mom ( double  wn,
const blitz::Array< double, 2 > &  frac_aer 
) const
virtual

This calculates the portion of the phase function moments that come from the aerosol.

Parameters
wnThe wave number.
frac_aerThis is number_active_layer() x number_particle()
Returns
Scattering moments for each layer. This is number_moment + 1 x number_layer() x number scattering matrix elements

Definition at line 253 of file aerosol_optical.cc.

◆ pf_mom() [3/3]

ArrayAd< double, 3 > AerosolOptical::pf_mom ( double  wn,
const ArrayAd< double, 2 > &  frac_aer,
int  nummom = -1,
int  numscat = -1 
) const
virtual

This calculates the portion of the phase function moments that come from the aerosol.

Parameters
wnThe wave number.
frac_aerThis is number_active_layer() x number_particle()
nummomNumber of moments to fill in
numscatNumber of scatters to fill in

Implements FullPhysics::Aerosol.

Definition at line 287 of file aerosol_optical.cc.

◆ pressure()

const boost::shared_ptr<Pressure>& FullPhysics::AerosolOptical::pressure ( ) const
inline

Return pressure.

Definition at line 130 of file aerosol_optical.h.

◆ print()

void AerosolOptical::print ( std::ostream &  Os) const
virtual

Reimplemented from FullPhysics::StateVectorObserver.

Definition at line 426 of file aerosol_optical.cc.

◆ print_to_string()

std::string FullPhysics::Printable< StateVectorObserver >::print_to_string ( ) const
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.

◆ remove_observer()

virtual void FullPhysics::Aerosol::remove_observer ( Observer< Aerosol > &  Obs)
inlinevirtualinherited

Remove an observer.

Implements FullPhysics::Observable< Aerosol >.

Definition at line 33 of file aerosol.h.

◆ remove_observer_do() [1/2]

void FullPhysics::Observable< Aerosol >::remove_observer_do ( Observer< Aerosol > &  Obs,
Aerosol t 
)
inlineprotectedinherited

Remove an observer.

Definition at line 173 of file observer.h.

◆ remove_observer_do() [2/2]

void FullPhysics::Observable< Aerosol >::remove_observer_do ( Observer< Aerosol > &  Obs)
inlineprotectedinherited

Definition at line 181 of file observer.h.

◆ ssa_each_layer() [1/2]

ArrayAd< double, 1 > AerosolOptical::ssa_each_layer ( double  wn,
int  particle_index,
const ArrayAd< double, 1 > &  Od 
) const
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.

◆ ssa_each_layer() [2/2]

ArrayAd< double, 1 > AerosolOptical::ssa_each_layer ( double  wn) const
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.

◆ state_vector_name()

virtual void FullPhysics::StateVectorObserver::state_vector_name ( const StateVector Sv,
blitz::Array< std::string, 1 > &  Sv_name 
) const
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.

Member Data Documentation

◆ olist

std::list<boost::weak_ptr<Observer<Aerosol > > > FullPhysics::Observable< Aerosol >::olist
protectedinherited

Definition at line 200 of file observer.h.

◆ ref_list

std::vector<boost::shared_ptr<Observer<Aerosol > > > FullPhysics::Observable< Aerosol >::ref_list
protectedinherited

Definition at line 201 of file observer.h.

◆ timer

AccumulatedTimer Aerosol::timer
staticinherited

Timer for Aerosol.

Definition at line 29 of file aerosol.h.


The documentation for this class was generated from the following files:

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