ReFRACtor
apply_instrument_units.cc
Go to the documentation of this file.
2 
3 using namespace FullPhysics;
4 
6 {
7  return boost::shared_ptr<InstrumentCorrection>(new ApplyInstrumentUnits(spectral_units, scaling));
8 }
9 
10 void ApplyInstrumentUnits::apply_correction(const SpectralDomain& Pixel_grid, const std::vector<int>& Pixel_list, SpectralRange& Radiance) const
11 {
12  // Use the copy operator to modify the units
13  Radiance = SpectralRange(Radiance.data_ad(), spectral_units, Radiance.uncertainty());
14 
15  // Apply scale factor whether or not there are jacobians
16  if(Radiance.data_ad().number_variable() == 0) {
17  Radiance.data() = Radiance.data() * scaling;
18  } else {
19  for(int i = 0; i < Radiance.data_ad().rows(); ++i) {
20  Radiance.data_ad()(i) = Radiance.data_ad()(i) * scaling;
21  }
22  }
23 }
24 
25 void ApplyInstrumentUnits::print(std::ostream& Os) const {
26  Os << "ApplyInstrumentUnits"
27  << "\tunits: " << spectral_units << std::endl
28  << "\tscale_factor: " << scaling << std::endl;
29 }
virtual void print(std::ostream &Os) const
For different instruments, it is more natural to either work with wavenumbers (e.g., GOSAT) or wavelength (e.g., OCO).
virtual void apply_correction(const SpectralDomain &Pixel_grid, const std::vector< int > &Pixel_list, SpectralRange &Radiance) const
Apply correction to radiance values, in place.
const blitz::Array< double, 1 > & uncertainty() const
Uncertainty.
int number_variable() const
Definition: array_ad.h:376
We have a number of different spectrums that appear in different parts of the code.
const ArrayAd< double, 1 > & data_ad() const
Underlying data, possibly with a Jacobian.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual boost::shared_ptr< InstrumentCorrection > clone() const
Clone an InstrumentCorrection object.
ApplyInstrumentUnits(const Unit &units, const double scale_factor=1.0)
const blitz::Array< double, 1 > & data() const
Underlying data.
int rows() const
Definition: array_ad.h:368

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