ReFRACtor
bad_sample_noise_model.cc
Go to the documentation of this file.
2 #include "ostream_pad.h"
3 #include "fp_exception.h"
4 
5 using namespace FullPhysics;
6 using namespace blitz;
7 
8 #ifdef HAVE_LUA
9 #include "register_lua.h"
11 .def(luabind::constructor<const boost::shared_ptr<NoiseModel>&,const blitz::Array<double, 2>&, double>())
12 .def(luabind::constructor<const boost::shared_ptr<NoiseModel>&,const blitz::Array<bool, 2>&, double>())
14 #endif
15 
16 //-----------------------------------------------------------------------
19 //-----------------------------------------------------------------------
20 
21 blitz::Array<double, 1> BadSampleNoiseModel::uncertainty
22 (int Spec_index, const blitz::Array<double, 1>& Radiance) const
23 {
24  range_check(Spec_index, 0, bad_sample_mask_.rows());
25  blitz::Array<double, 1> uncer =
26  underlying_noise_model_->uncertainty(Spec_index, Radiance);
27  blitz::Array<double, 1> res(uncer.shape());
28  res(Range::all()) = where(bad_sample_mask_(Spec_index, Range::all()), bad_sample_uncer_, uncer);
29  return res;
30 }
31 
32 void BadSampleNoiseModel::print(std::ostream& Os) const
33 {
34  Os << "BadSampleNoiseModel\n"
35  << " Bad sample uncertainty: " << bad_sample_uncer_ << "\n";
36  OstreamPad opad(Os, " ");
37  Os << " Underlying noise model:\n";
38  opad << *underlying_noise_model_;
39  opad.strict_sync();
40 }
41 
#define range_check(V, Min, Max)
Range check.
Definition: fp_exception.h:140
This is a filtering stream that adds a pad to the front of every line written out.
Definition: ostream_pad.h:32
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Definition: register_lua.h:136
virtual blitz::Array< double, 1 > uncertainty(int Spec_index, const blitz::Array< double, 1 > &Radiance) const
Calculate uncertainty, using underlying model except where we have bad samples, where we set this to ...
Apply value function to a blitz array.
virtual void print(std::ostream &Os) const
Print description of object.
Interface for calculating noise/uncertainty values from radiance data given some internal representat...
Definition: noise_model.h:13
When we have bad samples, we usually pass this to the spectral window to prevent the sample from even...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
#define REGISTER_LUA_END()
Definition: register_lua.h:134

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08