ReFRACtor
l_rad_rt.h
Go to the documentation of this file.
1 #ifndef L_RAD_RT_H
2 #define L_RAD_RT_H
3 
5 #include "rt_atmosphere.h"
6 #include "spectral_bound.h"
7 #include <boost/noncopyable.hpp>
8 #include <blitz/array.h>
9 #include "l_rad_driver.h"
10 
11 namespace FullPhysics {
12 /****************************************************************/
20  public Observer<RtAtmosphere>,
21  public boost::noncopyable {
22 public:
23  // These match numbers used internal to the Fortran code for LRad
24  enum BrdfType {
26  COXMUNK = 2,
27  BPDFVEGN = 3,
29  };
30 
32  const SpectralBound& Spec_bound,
33  const blitz::Array<double, 1>& Sza,
34  const blitz::Array<double, 1>& Zen,
35  const blitz::Array<double, 1>& Azm,
36  bool Pure_nadir,
37  bool Use_first_order_scatt_calc = true,
38  bool Do_second_order = false,
39  double Spectrum_spacing = 0.01,
40  const LRadDriver::PsMode ps_mode = LRadDriver::DETECT);
41 
44  const SpectralBound& Spec_bound,
45  const blitz::Array<double, 1>& Sza,
46  const blitz::Array<double, 1>& Zen,
47  const blitz::Array<double, 1>& Azm,
48  bool Pure_nadir,
49  int Number_stokes,
50  bool Do_second_order = false,
51  int Number_stream = 4,
52  double Spectrum_spacing = 0.01,
53  const LRadDriver::PsMode ps_mode = LRadDriver::DETECT);
54 
55  virtual int number_stokes() const { return driver->number_stokes(); }
56  virtual int number_stream() const { return driver->number_stream(); }
57 
59  virtual int surface_type() const { return surface_type_int; }
60 
63  return (*zmat_interpolate)(Wn);
64  }
65 
66  //-----------------------------------------------------------------------
70  //-----------------------------------------------------------------------
71  void notify_update(const RtAtmosphere& atm) { alt_spec_index_cache = -1; }
72 
73  virtual blitz::Array<double, 1> stokes_single_wn(double Wn, int Spec_index, const ArrayAd<double, 2>& Iv) const;
74  virtual ArrayAd<double, 1> stokes_and_jacobian_single_wn(double Wn, int Spec_index, const ArrayAd<double, 2>& Iv) const;
75 
77 
78  virtual void print(std::ostream& Os, bool Short_form = false) const;
79 
80 private:
81 
82  void initialize(const SpectralBound& Spec_bound, double Spectrum_spacing);
83 
84  int surface_type_int;
85 
88  void setup_z_matrix_interpol(const double wmin, const ArrayAd<double, 3>& pf_min, const double wmax, const ArrayAd<double, 3>& pf_max) const;
89 
90  // Interpolation variables for z-matrix
92  blitz::Array<double, 2> > > zmat_interpolate;
94  blitz::Array<double, 3> > > l_zmat_interpolate;
95 
96  // Helper methods for stokes calculation methods
97  ArrayAd<double, 2> get_z_matrix(const double Wn, int Spec_index, const ArrayAd<double, 2>& Iv) const;
98  void apply_jacobians(double Wn, int Spec_index, ArrayAd<double, 1>& stokes, const blitz::Array<double, 3>& jac_atm, const blitz::Array<double, 2>& jac_surf, const ArrayAd<double, 2>& Iv) const;
99 
100  // Control how to use the l_rad_driver
101  bool use_first_order_scatt_calc;
102  bool do_second_order;
103 
104  // Scene geometry
105  blitz::Array<double, 1> sza, zen, azm;
106 
107  // Mininum and maximum wavenumbers per spectrometer for z-matrix interpolation
108  std::vector<double> wmin, wmax;
109 
110  // Underlying RT that we are applying correction for.
112 
113  // Driver for l_rad Fortran code
115 
116  // Last index we updates the altitude for.
117  mutable int alt_spec_index_cache;
118  void update_altitude(int spec_index) const;
119 };
120 }
121 #endif
void notify_update(const RtAtmosphere &atm)
For performance, we cache some data as we calculate it.
Definition: l_rad_rt.h:71
virtual int number_stream() const
Number of streams to use in processing.
Definition: l_rad_rt.h:56
ArrayAd< double, 2 > interp_z_matrix(double Wn)
Return an interpolated z_matrix value for use in offline testing.
Definition: l_rad_rt.h:62
This class is responsible for setting up the atmosphere and ground information needed to run the Radi...
Definition: rt_atmosphere.h:51
virtual blitz::Array< double, 1 > stokes_single_wn(double Wn, int Spec_index, const ArrayAd< double, 2 > &Iv) const
Calculate stokes vector for the given wavenumber.
Definition: l_rad_rt.cc:330
LRadRt(const boost::shared_ptr< RadiativeTransferSingleWn > &Rt, const SpectralBound &Spec_bound, const blitz::Array< double, 1 > &Sza, const blitz::Array< double, 1 > &Zen, const blitz::Array< double, 1 > &Azm, bool Pure_nadir, bool Use_first_order_scatt_calc=true, bool Do_second_order=false, double Spectrum_spacing=0.01, const LRadDriver::PsMode ps_mode=LRadDriver::DETECT)
Constructor.
Definition: l_rad_rt.cc:67
virtual ArrayAd< double, 1 > stokes_and_jacobian_single_wn(double Wn, int Spec_index, const ArrayAd< double, 2 > &Iv) const
Calculate stokes vector and Jacobian for the given wavenumber.
Definition: l_rad_rt.cc:405
This class drives the LRAD code, which gives a polarization correction to scalar intensity and jacobi...
Definition: l_rad_rt.h:19
virtual int surface_type() const
Returns an integer with l_rad&#39;s representation of surface type.
Definition: l_rad_rt.h:59
This is a RadiativeTransfer that supplies an interface that can be called for a single wavenumber...
This gives the upper and lower bounds of the SpectralWindow.
This does linear interpolate between two points.
virtual blitz::Array< double, 2 > stokes(const SpectralDomain &Spec_domain, int Spec_index) const
Calculate stokes vector for the given set of wavenumbers/wavelengths.
virtual int number_stokes() const
Number of stokes parameters we will return in stokes and stokes_and_jacobian.
Definition: l_rad_rt.h:55
const boost::shared_ptr< RadiativeTransferSingleWn > & radiative_transfer() const
Definition: l_rad_rt.h:76
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual void print(std::ostream &Os, bool Short_form=false) const
Print to stream.
Definition: l_rad_rt.cc:493
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