10 const blitz::Array<double, 1>& measurement_error_cov )
12 if(measurement.rows() <= 0)
13 throw Exception(
"The size of measurement data array is zero.");
14 if(measurement_error_cov.rows() != measurement.rows() )
15 throw Exception(
"Measured data and the related diagonal error covariance matrix need to be the same size.");
17 msrmnt.resize(measurement.shape());
20 Se.resize(measurement_error_cov.shape());
21 Se = measurement_error_cov;
23 Se_chol.resize(Se.shape());
30 if( m.rows() != msrmnt.rows() )
31 throw Exception(
"Model data and measured data need to be the same size.");
37 if( k.rows() != msrmnt.rows() )
38 throw Exception(
"Model Jacobian and measurement error covariance matrix must have the same number of rows.");
39 if( k.cols() != expected_parameter_size() )
40 throw Exception(
"The number of model Jacobian columns must equal the number of parameters.");
47 firstIndex i1; secondIndex i2;
48 Array<double, 2> result(measurement_size(), parameter_size());
49 result =
jacobian()(i1, i2) / Se_chol(i1);
56 firstIndex i1; secondIndex i2; thirdIndex i3;
58 Array<double, 2> result(K.cols(), K.cols());
59 result = sum(
K(i3,i1) / Se(i3) *
K(i3, i2), i3);
void set_measurement(const blitz::Array< double, 1 > &measurement, const blitz::Array< double, 1 > &measurement_error_cov)
For setting measurement and the error covariance matrix.
virtual blitz::Array< double, 2 > uncert_weighted_jac_inner_product()
Returns the inner product of the matrix returned by the method uncert_weighted_jacobian() by itself...
virtual void assert_jacobian_correct(const blitz::Array< double, 2 > &k) const
Conditions that must be satisfied when a derived class computes the Jacobian of the model...
This is the base of the exception hierarchy for Full Physics code.
blitz::Array< T, 2 > jacobian(const blitz::Array< AutoDerivative< T >, 1 > &Ad)
Utility function to extract the Jacobian as a separate matrix from an array of AutoDerivative.
virtual blitz::Array< double, 2 > uncert_weighted_jacobian()
Returns the model Jacobian weighted by the inverse of the Cholesky decomposition of the error covaria...
Apply value function to a blitz array.
const Unit K("K", 1.0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0)
const Unit m("m", 1.0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Contains classes to abstract away details in various Spurr Radiative Transfer software.
virtual void assert_model_correct(const blitz::Array< double, 1 > &m) const
Conditions that must be satisfied when a derived class computes the model.