ReFRACtor
spectrally_resolved_noise.cc
Go to the documentation of this file.
2 #include "ostream_pad.h"
3 
4 using namespace FullPhysics;
5 using namespace blitz;
6 
7 #ifdef HAVE_LUA
8 #include "register_lua.h"
10 .def(luabind::constructor<boost::shared_ptr<NoiseModel> &>())
11 .def("set_noise_coefficients", &SpectrallyResolvedNoise::set_noise_coefficients)
13 #endif
14 
15 //-----------------------------------------------------------------------
18 //-----------------------------------------------------------------------
19 
20 void SpectrallyResolvedNoise::set_noise_coefficients(int Spec_index, const blitz::Array<double, 1> Noise_coeff) {
21  if(band_noise_coeffs_.size() <= Spec_index)
22  band_noise_coeffs_.resize(Spec_index+1);
23  band_noise_coeffs_[Spec_index].reference(Noise_coeff);
24 }
25 
26 //-----------------------------------------------------------------------
30 //-----------------------------------------------------------------------
31 
32 blitz::Array<double, 1> SpectrallyResolvedNoise::uncertainty(int Spec_index, const blitz::Array<double, 1>& Radiance) const {
33  Array<double, 1> uncert = base_model_->uncertainty(Spec_index, Radiance);
34  if (band_noise_coeffs_.size() <= Spec_index or band_noise_coeffs_[Spec_index].rows() == 0)
35  return uncert;
36 
37  Range all = Range::all();
38  uncert(all) = uncert(all) * band_noise_coeffs_[Spec_index](all);
39  return uncert;
40 }
41 
42 void SpectrallyResolvedNoise::print(std::ostream& Os) const
43 {
44  Os << "Spectrally Resolved Noise Modification:" << std::endl;
45  OstreamPad opad(Os, " ");
46  opad << "Coefficient sizes:" << std::endl;
47  for(int spec_idx = 0; spec_idx < band_noise_coeffs_.size(); spec_idx++)
48  opad << " [" << spec_idx << "]: " << band_noise_coeffs_[spec_idx].rows() << std::endl;
49  opad.strict_sync();
50 }
virtual void set_noise_coefficients(int Spec_index, const blitz::Array< double, 1 > Noise_coeff)
Add noise coefficents for a given band index.
virtual blitz::Array< double, 1 > uncertainty(int Spec_index, const blitz::Array< double, 1 > &Radiance) const
Applies spectrally resolved noise coefficents to base model&#39;s uncertainty.
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
Adds a spectrally varying modification to an existing noise model.
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
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:10