10 .def(luabind::constructor<
const blitz::Array<double, 1>&,
11 const blitz::Array<double, 1>&,
13 .def(luabind::constructor<
const blitz::Array<double, 1>&,
23 const blitz::Array<double, 1>& B,
24 double Surface_pressure,
bool Pressure_flag)
25 : a_(A.copy()), b_(B.copy())
27 if(A.rows() != B.rows())
28 throw Exception(
"A and B need to be the same size in PressureSigma constructor");
30 blitz::Array<double, 1> val(1);
31 blitz::Array<bool, 1> flag(1);
32 val(0) = Surface_pressure;
33 flag(0) = Pressure_flag;
47 double Surface_pressure,
bool Pressure_flag)
51 blitz::Array<double, 1> val(1);
52 blitz::Array<bool, 1> flag(1);
53 val(0) = Surface_pressure;
54 flag(0) = Pressure_flag;
68 a_.resize(Pressure_grid.rows());
71 b_.resize(Pressure_grid.rows());
73 b_ = b_ / Pressure_grid(Pressure_grid.rows()-1);
88 for(
int i = 0; i < b_.rows(); ++i) {
97 err_msg <<
"At level " << i <<
" pressure is smaller: " 99 << b_(i-1) <<
" * " <<
coeff(0).
value() <<
" + " << a_(i-1)
102 <<
" than the value at the previous level: " 104 << b_(i) <<
" * " <<
coeff(0).
value() <<
" + " << a_(i)
129 Os <<
"PressureSigma:\n" virtual boost::shared_ptr< Pressure > clone() const
Clone a PressureFixedLevel object.
blitz::Array< double, 2 > cov
Last covariance matrix updated from the StateVector.
PressureSigma(const blitz::Array< double, 1 > &A, const blitz::Array< double, 1 > &B, double Surface_pressure, bool Pressure_flag)
Constructor.
ArrayAdWithUnit< double, 1 > pgrid
The cached pressure grid.
This is a filtering stream that adds a pad to the front of every line written out.
void set_levels_from_grid(const blitz::Array< double, 1 > &Pressure_grid)
Creates A and B parameters from the pressure grid passed in.
const Unit Pa("Pa", N/(m *m))
This is the base of the exception hierarchy for Full Physics code.
virtual void calc_pressure_grid() const
Calculate the new pressure grid.
const blitz::Array< bool, 1 > & used_flag_value() const
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
This class maintains the pressure portion of the state.
void notify_update_do(const T &Self)
Function to call to notify Observers of a state change.
Apply value function to a blitz array.
const Unit A("A", 1.0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0)
const blitz::Array< T, D > & value() const
void resize(const blitz::TinyVector< int, D > &Shape, int nvar)
virtual void print(std::ostream &Os) const
Print to stream.
AutoDerivativeWithUnit< double > surface_pressure() const
Return surface pressure, which is just the pressure at the bottom level of pressure_grid.
bool cache_stale
If this is true, the recalculate the pressure_grid the next time we need it.
const blitz::Array< double, 1 > & a() const
int number_variable() const
const blitz::Array< double, 1 > & b() const
This class maintains the pressure portion of the state.
const ArrayAd< double, 1 > & coefficient() const
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)
#define REGISTER_LUA_END()
ArrayAd< double, 1 > coeff
Coefficients.
double value(const FullPhysics::AutoDerivative< double > &Ad)