1 #ifndef ERROR_ANALYSIS_H 2 #define ERROR_ANALYSIS_H 67 if(residual().rows() == 0)
68 return blitz::Array<double, 1>(0);
69 return blitz::Array<double, 1>
70 (residual() + meas->radiance_all().spectral_range().data());
79 boost::optional<blitz::Range> pr = fm->stacked_pixel_range(Band);
82 blitz::Array<double, 1> res(residual());
85 return sum(res(*pr) * res(*pr));
94 boost::optional<blitz::Range> pr = fm->stacked_pixel_range(Band);
107 boost::optional<blitz::Range> pr = fm->stacked_pixel_range(Band);
111 if(solver->residual().rows() == 0)
114 solver->residual_covariance_diagonal()(*pr));
116 blitz::Array<double, 1> res(max_a_posteriori->uncert_weighted_model_measure_diff());
117 if(!res.rows())
return 0;
118 return sum(res(*pr)*res(*pr))/pr->length();
129 boost::optional<blitz::Range> pr = fm->stacked_pixel_range(Band);
133 return result ? (result/
signal(Band)):0;
141 const blitz::Array<double, 1>& Residual_cov_diag)
const 144 if (residual().rows() == 0)
146 return sum(Residual * Residual / Residual_cov_diag) / Residual.rows();
149 double signal(
int band)
const;
150 double noise(
int band)
const;
163 {
return (solver ? solver->gamma_last_step() : -1); }
205 return sum(averaging_kernel()(i1, i1));
218 return sum(where(xco2_state_used(),
219 averaging_kernel()(i1, i1), 0));
229 void print(std::ostream& Os)
const { Os <<
"ErrorAnalysis";}
231 blitz::Array<double, 1> residual()
const 234 return solver->residual();
236 return max_a_posteriori->model_measure_diff();
238 blitz::Array<double, 2> averaging_kernel()
const 241 return solver->averaging_kernel();
243 return max_a_posteriori->averaging_kernel();
245 blitz::Array<double, 2> aposteriori_covariance()
const 248 return solver->aposteriori_covariance();
250 return max_a_posteriori->a_posteriori_covariance();
252 blitz::Array<double, 2> apriori_covariance()
const 255 return solver->apriori_covariance();
257 return max_a_posteriori->a_priori_cov();
259 blitz::Array<bool, 1> xco2_state_used()
const 260 {
return atm->absorber_ptr()->absorber_vmr(
"CO2")->state_used(); }
262 {
return atm->absorber_ptr()->xgas(
"CO2"); }
263 blitz::Array<double, 1> dxco2_dstate()
const;
270 blitz::Array<double, 2> hmat()
const;
271 blitz::Array<double, 2> ht_c_h()
const;
273 blitz::firstIndex i1; blitz::secondIndex i2; blitz::thirdIndex i3;
274 blitz::fourthIndex i4;
blitz::Array< double, 2 > co2_averaging_kernel() const
Portion of averaging kernel that relates the part of the state vector that is used by the CO2 VMR cal...
double gamma_last_step() const
Levenberg-Marquardt parameter for last step we processed.
blitz::Array< double, 1 > xco2_gain_vector() const
This calculates xco2_gain_vector.
double residual_sum_sq(int Band) const
Return the sum of the squares of the residual for the given band.
double xco2_uncert_smooth() const
Calculate xco2_uncert_smooth.
double residual_mean_sq(int Band) const
Return the residual mean square for the O2 band.
double signal(int band) const
Calculate an approximation to the size of the continuum signal where there is no significant atmosphe...
To detect things like divide by zero, we may turn on floating point exceptions.
double xco2_interference_error() const
Calculate XCO2 interference error.
This is a Mixin for classes that can be printed.
blitz::Array< double, 1 > xco2_avg_kernel_norm() const
Calculate the normalized XCO2 averaging kernel.
double xco2_uncertainty() const
XCO2 uncertainty.
double relative_residual_mean_sq(int Band) const
Return the relative residual mean square for the given band.
int num_channels() const
The number of spectral bands associated with forward model.
blitz::Array< double, 1 > xco2_avg_kernel_full() const
This the XCO2 averaging kernel for the full state vector.
blitz::Array< double, 1 > modeled_radiance() const
Modeled radiance.
blitz::Array< double, 1 > xco2_avg_kernel() const
Calculate the XCO2 averaging kernel.
blitz::Array< double, 1 > interference_smoothing_uncertainty() const
Calculate the interference smoothing uncertainty.
double xco2_uncert_noise() const
Calculate xco2_uncert_noise.
double xco2_smoothing_error() const
Calculate XCO2 smoothing error.
double xco2_measurement_error() const
Calculate XCO2 measurement error.
blitz::Array< double, 1 > xco2_correlation_interf() const
Calculate xco2_correlation_interf.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
double degrees_of_freedom_xco2() const
Calculate the degrees of freedom for the portion of the state vector used to determine xco2...
double chisq_measure_norm(const blitz::Array< double, 1 > &Residual, const blitz::Array< double, 1 > &Residual_cov_diag) const
return chisq_measure_norm for the given data.
double reduced_chisq(int Band) const
Return the reduced chisq for band.
This calculates a variety of values to help with the error analysis of a Level 2 Full Physics Run...
ErrorAnalysis(const boost::shared_ptr< ConnorSolver > &Solver, const boost::shared_ptr< AtmosphereOco > &Atm, const boost::shared_ptr< ForwardModel > &Fm, const boost::shared_ptr< Observation > &inst_meas)
Constructor.
void print(std::ostream &Os) const
double degrees_of_freedom_full_vector() const
Calculate the degrees of freedom for the full state vector.
double noise(int band) const
Helper class for sort done in noise.
double xco2_uncert_interf() const
Calculate xco2_uncert_interf.