ReFRACtor
example_met_file.h
Go to the documentation of this file.
1 #ifndef EXAMPLE_MET_FILE_H
2 #define EXAMPLE_MET_FILE_H
3 #include "meteorology.h"
4 #include "hdf_file.h"
5 
6 namespace FullPhysics {
7 /****************************************************************/
13 class ExampleMetFile : public Meteorology {
14 public:
15  ExampleMetFile(const boost::shared_ptr<HdfFile>& input_file, const std::string& observation_id);
16  ExampleMetFile(const std::string& input_filename, const std::string& observation_id);
18 
19  // Define how to read various items
21  blitz::Array<double, 1> pressure_levels() const
22  { return read_array(group_name + "/pressure_levels"); }
23 
25  blitz::Array<double, 1> specific_humidity() const
26  { return read_array(group_name + "/specific_humidity" ); }
27 
28  double surface_pressure() const
29  { return read_scalar(group_name + "/surface_pressure" ); }
30 
31  double windspeed_u() const
32  { return read_scalar(group_name + "/windspeed_u" ); }
33 
34  double windspeed_v() const
35  { return read_scalar(group_name + "/windspeed_v" ); }
36 
38  blitz::Array<double, 1> temperature() const
39  { return read_array(group_name + "/temperature" ); }
40 
41  void print(std::ostream& Os) const { Os << "ExampleMetFile"; }
42 
43 private:
44 
45  //-----------------------------------------------------------------------
47  //-----------------------------------------------------------------------
48 
49  double read_scalar(const std::string& Field) const;
50  blitz::Array<double, 1> read_array(const std::string& Field) const;
51 
53  int data_index;
54 
55  // Name of the HDF group to read from
56  const std::string group_name = "Meteorology";
57 };
58 }
59 #endif
ExampleMetFile(const boost::shared_ptr< HdfFile > &input_file, const std::string &observation_id)
Constructor.
Defines the interface for supplying meteorological data.
Definition: meteorology.h:14
blitz::Array< double, 1 > temperature() const
Temperature profile in Kelvins on the meteorological pressure levels.
blitz::Array< double, 1 > specific_humidity() const
Specific humidty on the meteorological pressure levels.
virtual blitz::Array< double, 1 > specific_humidity() const =0
Specific humidty on the meteorological pressure levels.
double surface_pressure() const
Surface pressure in Pascals.
This class implements and example Meteorological reader that reads data from an HDF file with dataset...
double windspeed_v() const
The V component windspeed in m/s.
virtual blitz::Array< double, 1 > pressure_levels() const =0
Pressure levels in Pascals used for provided meteorological data.
virtual blitz::Array< double, 1 > temperature() const =0
Temperature profile in Kelvins on the meteorological pressure levels.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
blitz::Array< double, 1 > pressure_levels() const
Pressure levels in Pascals used for provided meteorological data.
double windspeed_u() const
The U component windspeed in m/s.
void print(std::ostream &Os) const

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