1 #ifndef SUB_STATE_VECTOR_ARRAY_H 2 #define SUB_STATE_VECTOR_ARRAY_H 5 #include <boost/lexical_cast.hpp> 39 const blitz::Array<bool, 1>& Used_flag,
41 bool Mark_according_to_press =
true,
48 throw Exception(
"Coeff and Used_flag need to be the same size");
59 void init(
const blitz::Array<double, 1>& Coeff,
60 const blitz::Array<bool, 1>& Used_flag,
62 bool Mark_according_to_press =
true,
72 throw Exception(
"Coeff and Used_flag need to be the same size");
95 for(
int i = 0; i <
used_flag.rows(); ++i) {
122 return "unknown/not_set";
131 return "Coeff" + boost::lexical_cast<std::string>(i + 1);
138 for(
int i = 0; i <
used_flag.rows(); ++i)
147 if (Sv_sub.
rows() > 0) {
148 cov.reference(Cov.copy());
154 coeff(i) = Sv_sub(si);
216 blitz::Array<double, 2>
cov;
void resize_number_variable(int nvar)
void state_vector_observer_initialize(int Plen)
Take the given number of state vector parameters.
virtual void update_sub_state(const ArrayAd< double, 1 > &Sv_sub, const blitz::Array< double, 2 > &Cov)
Called by update_state with the subset of the state vector used by this class.
blitz::Array< double, 2 > cov
Last covariance matrix updated from the StateVector.
bool mark_according_to_press
Flag indicating if we only mark coefficients >= pdep_start + press->number_level() in mark_used_sub...
SubStateVectorArray(double Coeff, bool Used_flag)
Special case when Coeff and Used_flag have exactly one row.
virtual void update_sub_state_hook()
Hook for anything a derived class needs to do after coefficient is updated and before notify_update...
This is the base of the exception hierarchy for Full Physics code.
const blitz::Array< bool, 1 > & used_flag_value() const
void notify_update_do(const T &Self)
Function to call to notify Observers of a state change.
const boost::shared_ptr< Pressure > & pressure() const
const blitz::Array< T, D > & value() const
const blitz::Array< double, 2 > & statevector_covariance() const
void mark_used_sub(blitz::Array< bool, 1 > &Used) const
Called by mark_used with the subset of the state vector used by this class.
SubStateVectorArray(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)
Constructor.
int pdep_start
Index of first coefficient that depends on the number of pressure levels.
A common StateVectorObserver just "owns" a subset of the StateVector.
int number_variable() const
virtual void state_vector_name_sub(blitz::Array< std::string, 1 > &Sv_name) const
Called by state_vector_name with the subset of the Sv_name used by this class.
void reference(const ArrayAd< T, D > &V)
const ArrayAd< double, 1 > & coefficient() const
blitz::Array< bool, 1 > used_flag
Flag indicating which of the coefficients gets updated by the StateVector.
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.
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)
boost::shared_ptr< Pressure > press
Pressure.
ArrayAd< double, 1 > coeff
Coefficients.
virtual std::string state_vector_name_i(int i) const
Return state vector name for ith entry in coeff.
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 ~SubStateVectorArray()
SubStateVectorArray()
Default constructor, should call init.