ReFRACtor
example_level_1b.h
Go to the documentation of this file.
1 #ifndef EXAMPLE_L1B_H
2 #define EXAMPLE_L1B_H
3 
5 #include "hdf_file.h"
6 #include "unit.h"
7 #include "double_with_unit.h"
8 
9 namespace FullPhysics {
10 
11 /****************************************************************/
17 public:
18  ExampleLevel1b(const boost::shared_ptr<HdfFile>& input_file, const std::string& observation_id);
19  ExampleLevel1b(const std::string& input_filename, const std::string& observation_id);
20  virtual ~ExampleLevel1b() {}
21 
22  virtual int number_spectrometer() const;
23 
24  virtual DoubleWithUnit latitude(int i) const
25  { return read_scalar_with_unit(group_name + "/latitude", i, units::deg); }
26 
27  virtual DoubleWithUnit longitude(int i) const
28  { return read_scalar_with_unit(group_name + "/longitude", i, units::deg); }
29 
30  virtual DoubleWithUnit solar_zenith(int i) const
31  { return read_scalar_with_unit(group_name + "/solar_zenith", i, units::deg); }
32 
33  virtual DoubleWithUnit solar_azimuth(int i) const
34  { return read_scalar_with_unit(group_name + "/solar_azimuth", i, units::deg); }
35 
36  virtual DoubleWithUnit altitude(int i) const
37  { return read_scalar_with_unit(group_name + "/altitude", i, units::deg); }
38 
39  virtual DoubleWithUnit sounding_zenith(int i) const
40  { return read_scalar_with_unit(group_name + "/observation_zenith", i, units::deg); }
41 
42  virtual DoubleWithUnit sounding_azimuth(int i) const
43  { return read_scalar_with_unit(group_name + "/observation_azimuth", i, units::deg); }
44 
45  virtual blitz::Array<double, 1> stokes_coefficient(int i) const
46  { return read_array(group_name + "/stokes_coefficient", i); }
47 
48  virtual DoubleWithUnit relative_velocity(int i) const
49  { return read_scalar_with_unit(group_name + "/relative_velocity", i, units::deg); }
50 
52  { return read_array_with_unit(group_name + "/spectral_coefficient", i, units::micron); }
53 
54  virtual Time time(int i) const
55  { return Time::time_pgs(read_scalar(group_name + "/time_tai93", i)); }
56 
57  virtual void print(std::ostream& Os) const { Os << "ExampleL1b"; };
58 
59  virtual SpectralRange radiance(int Spec_index) const;
60 
61 private:
62  DoubleWithUnit read_scalar_with_unit(const std::string& dataset_name, int i, const Unit& default_unit) const;
63  double read_scalar(const std::string& dataset_name, int i) const;
64 
65  ArrayWithUnit<double, 1> read_array_with_unit(const std::string& dataset_name, int i, const Unit& default_unit) const;
66  blitz::Array<double, 1> read_array(const std::string& dataset_name, int i) const;
67 
69  int data_index;
70 
71  const std::string group_name = "Level1b";
72 };
73 }
74 #endif
virtual blitz::Array< double, 1 > stokes_coefficient(int i) const
Return stokes coefficients.
virtual Time time(int i) const
Time of sounding.
This is used to wrap the nominal Level 1B file reader.
virtual DoubleWithUnit sounding_zenith(int i) const
Sounding zenith.
virtual DoubleWithUnit solar_zenith(int i) const
Solar zenith.
virtual DoubleWithUnit relative_velocity(int i) const
Relative velocity.
virtual void print(std::ostream &Os) const
Print description of object.
ExampleLevel1b(const boost::shared_ptr< HdfFile > &input_file, const std::string &observation_id)
const Unit micron("micron", 1e-6 *m)
virtual int number_spectrometer() const
Number of spectrometers.
virtual DoubleWithUnit sounding_azimuth(int i) const
Sounding azimuth.
virtual DoubleWithUnit longitude(int i) const
Longitude.
We frequently have a double with units associated with it.
We have a number of different spectrums that appear in different parts of the code.
This is an example L1B reader that reads a HDF formatted file that corresponds one-to-one with the ex...
This is a simple time class.
Definition: fp_time.h:29
virtual DoubleWithUnit altitude(int i) const
Altitude.
Libraries such as boost::units allow unit handling where we know the units at compile time...
Definition: unit.h:25
virtual DoubleWithUnit latitude(int i) const
Latitude.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual DoubleWithUnit solar_azimuth(int i) const
Solar azimuth.
virtual ArrayWithUnit< double, 1 > spectral_coefficient(int i) const
Returns coefficients for an equation describing the special domain used to translate radiance value i...
static Time time_pgs(double pgs)
Return time from given PGS toolkit time (epoch of 1993-01-01).
Definition: fp_time.h:56
virtual SpectralRange radiance(int Spec_index) const
Radiance, for given spectral band.
const Unit deg("deg", pi/180.0 *rad)

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