4 #include <boost/lexical_cast.hpp> 96 std::cout << s <<
"\n";
98 typedef void (
StateVector::*us1)(
const blitz::Array<double, 1>&);
99 typedef void (
StateVector::*us2)(
const blitz::Array<double, 1>&,
const blitz::Array<double, 2>&);
101 .def(luabind::constructor<>())
102 .def(
"add_observer", &state_vector_add_observer_instrument)
103 .def(
"add_observer", &state_vector_add_observer_atm)
104 .def(
"add_observer", &state_vector_add_observer_scoeff)
105 .def(
"add_observer", &state_vector_add_observer_spec_effect)
106 .def(
"add_observer", &state_vector_add_observer_inst_corr)
107 .def(
"add_observer", &state_vector_add_observer_absorber_vmr)
108 .def(
"add_observer", &state_vector_add_observer_aerosol_optical)
109 .def(
"add_observer", &state_vector_add_observer_aerosol_extinction)
110 .def(
"add_observer", &state_vector_add_observer_aerosol_property)
111 .def(
"add_observer", &state_vector_add_observer_pressure)
112 .def(
"add_observer", &state_vector_add_observer_temperature)
113 .def(
"add_observer", &state_vector_add_observer_ground)
114 .def(
"add_observer", &state_vector_add_observer_disp)
116 .def(
"update_state", ((us2) &StateVector::update_state))
117 .def(
"print_names", &state_vector_print_names)
130 x_.resize(X.rows(), X.rows());
134 for(
int i = 0; i < x_.rows(); ++i) {
135 x_.jacobian()(i, i) = 1;
140 if (cov_.rows() != x_.rows() or cov_.cols() == x_.rows()) {
141 cov_.resize(x_.rows(), x_.rows());
144 for(
int i = 0; i < x_.rows(); ++i) {
149 notify_update_do(*
this);
157 const blitz::Array<double, 2>& Cov)
159 if(X.rows() != Cov.rows() ||
160 X.rows() != Cov.cols()) {
161 throw Exception(
"X and Cov need to be the same size when updating the StateVector");
164 x_.resize(X.rows(), X.rows());
168 for(
int i = 0; i < x_.rows(); ++i) {
169 x_.jacobian()(i, i) = 1;
172 cov_.reference(Cov.copy());
173 notify_update_do(*
this);
186 blitz::Array<bool, 1> res(state().rows());
193 t2->mark_used(*
this, res);
205 Array<std::string, 1> res(std::max(state().rows(), observer_claimed_size()));
207 for(
int i = 0; i < res.rows(); ++i) {
208 res(i) =
"State vector " + boost::lexical_cast<std::string>(i + 1);
216 t2->state_vector_name(*
this, res);
224 const static int sv_num_width = 17;
225 Array<std::string, 1> svname = state_vector_name();
227 for(
int i = 0; i < std::max(svname.rows(), state().rows()); ++i) {
228 Os << std::setprecision(sv_num_width - 7)
229 << std::setw(sv_num_width);
231 if(i < state().rows()) {
234 Os <<
"Past end state vector";
239 if(i < svname.rows()) {
242 Os <<
"Unlabeled row " << i;
This gives the Aerosol properties for an Aerosol.
const Unit s("s", 1.0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
This class is responsible for setting up the atmosphere and ground information needed to run the Radi...
const blitz::Array< double, 1 > & state() const
Current state vector.
blitz::Array< std::string, 1 > state_vector_name() const
Return name of each state vector element.
This class maintains the stokes coefficient portion of the state.
This is the base of the exception hierarchy for Full Physics code.
This is an observer of a StateVector.
const blitz::Array< double, 2 > & state_covariance() const
Current covariance of the state vector.
virtual void add_observer(Observer< StateVector > &Obs)
Add an observer.
This class maintains the ground portion of the state.
#define REGISTER_LUA_CLASS(X)
Apply value function to a blitz array.
This applies a instrument model to radiances.
Implementation of Aerosol.
void update_state(const blitz::Array< double, 1 > &X)
Update the state vector.
This handles informing a set of interested objects when the state vector has updated.
This gives the Gas Absorber Volumn mixing ratio for a single gas.
This class maintains the pressure portion of the state.
This class calculates the wavenumber for each pixel in a single band of an Instrument.
virtual void print(std::ostream &Os) const
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
This class maintains the temperature portion of the state.
blitz::Array< bool, 1 > used_flag() const
Return a Array of boolean values.
This class maps the state vector to the aerosol extinction on each level.