ReFRACtor
ils_instrument.h
Go to the documentation of this file.
1 #ifndef ILS_INSTRUMENT_H
2 #define ILS_INSTRUMENT_H
3 #include "instrument.h"
4 #include "ils.h"
6 #include <vector>
7 
8 namespace FullPhysics {
9 
10 /****************************************************************/
15 class IlsInstrument: public Instrument, public Observer<Ils>,
16  public Observer<InstrumentCorrection> {
17 public:
18  IlsInstrument(const std::vector<boost::shared_ptr<Ils> >& Ils_list,
19  const std::vector<std::vector<boost::shared_ptr<InstrumentCorrection> > >&
20  Instrument_correction =
21  std::vector<std::vector<boost::shared_ptr<InstrumentCorrection> > >());
22  virtual ~IlsInstrument() {}
23  virtual int number_spectrometer() const {return (int) ils_.size();}
25  const Spectrum& High_resolution_spectrum,
26  const std::vector<int>& Pixel_list,
27  int Spec_index) const;
28  virtual SpectralDomain pixel_spectral_domain(int Spec_index) const
29  {
30  range_check(Spec_index, 0, number_spectrometer());
31  return ils_[Spec_index]->pixel_grid();
32  }
33  virtual std::string band_name(int Spec_index) const
34  {
35  range_check(Spec_index, 0, number_spectrometer());
36  return ils_[Spec_index]->hdf_band_name();
37  }
38  virtual std::string hdf_band_name(int Spec_index) const
39  {
40  range_check(Spec_index, 0, number_spectrometer());
41  return ils_[Spec_index]->hdf_band_name();
42  }
43  virtual DoubleWithUnit
44  ils_half_width(int Spec_index) const
45  {
46  range_check(Spec_index, 0, number_spectrometer());
47  return ils_[Spec_index]->ils_half_width();
48  }
49  virtual void ils_half_width(int Spec_index, DoubleWithUnit& half_width)
50  {
51  range_check(Spec_index, 0, number_spectrometer());
52  return ils_[Spec_index]->ils_half_width(half_width);
53  }
54  virtual void print(std::ostream& Os) const;
55  virtual void notify_update(const Ils& D)
56  { notify_update_do(*this); }
57  virtual void notify_update(const InstrumentCorrection& C)
58  { notify_update_do(*this); }
59 
60  virtual boost::shared_ptr<Instrument> clone() const;
61 
62 //-----------------------------------------------------------------------
64 //-----------------------------------------------------------------------
65  boost::shared_ptr<Ils> ils(int Spec_index) const
66  {
67  range_check(Spec_index, 0, number_spectrometer());
68  return ils_[Spec_index];
69  }
70 
71 //-----------------------------------------------------------------------
73 //-----------------------------------------------------------------------
74  const std::vector<boost::shared_ptr<InstrumentCorrection> >&
75  instrument_correction(int Spec_index) const
76  {
77  range_check(Spec_index, 0, number_spectrometer());
78  return inst_corr[Spec_index];
79  }
80 private:
81  std::vector<boost::shared_ptr<Ils> > ils_;
82  std::vector<std::vector<boost::shared_ptr<InstrumentCorrection> > >
83  inst_corr;
84 };
85 }
86 #endif
#define range_check(V, Min, Max)
Range check.
Definition: fp_exception.h:140
virtual int number_spectrometer() const
Give number of spectrometers.
virtual void notify_update(const InstrumentCorrection &C)
Called when the Observed object is updated.
virtual Spectrum apply_instrument_model(const Spectrum &High_resolution_spectrum, const std::vector< int > &Pixel_list, int Spec_index) const
Apply the instrument model to both the radiance and derivatives.
IlsInstrument(const std::vector< boost::shared_ptr< Ils > > &Ils_list, const std::vector< std::vector< boost::shared_ptr< InstrumentCorrection > > > &Instrument_correction=std::vector< std::vector< boost::shared_ptr< InstrumentCorrection > > >())
Constructor.
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 std::string hdf_band_name(int Spec_index) const
In general, the name used in HDF files for a particular band is similar but not identical to the more...
This is a instrument that uses a Ils object for each spectrometer to model the instrument.
boost::shared_ptr< Ils > ils(int Spec_index) const
Underlying Ils.
void notify_update_do(const Instrument &Self)
Function to call to notify Observers of a state change.
Definition: observer.h:121
This applies a instrument model to radiances.
Definition: instrument.h:17
This is a full spectrum, which contains a SpectralRange and SpectralDomain.
Definition: spectrum.h:18
virtual std::string band_name(int Spec_index) const
Band name for given Spec_index.
We frequently have a double with units associated with it.
virtual void ils_half_width(int Spec_index, DoubleWithUnit &half_width)
virtual SpectralDomain pixel_spectral_domain(int Spec_index) const
This is the pixel wavenumber/wavelength for each pixel.
This class models an Instrument Line Shape (ILS).
Definition: ils.h:13
const std::vector< boost::shared_ptr< InstrumentCorrection > > & instrument_correction(int Spec_index) const
Underlying InstrumentCorrection.
virtual boost::shared_ptr< Instrument > clone() const
Clone an Instrument object.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual void notify_update(const Ils &D)
Called when the Observed object is updated.
virtual DoubleWithUnit ils_half_width(int Spec_index) const
This is the half width of the ILS in wavenumber.
This class models an Instrument correction.
Simple Mixin to be and Observer of another object of class T.
Definition: observer.h:29

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