GpsWeatherData.h
Go to the documentation of this file.
1 #ifndef _anal_GpsWeatherData_h_
2 #define _anal_GpsWeatherData_h_
3 
4 #include <iostream>
5 
6 
7 namespace anal {
8 
9  struct GpsWeatherData {
10  GpsWeatherData() = default;
11 
12  GpsWeatherData(const unsigned long int gps) : fGPSSecond(gps) { }
13 
14  void Interpolate(const GpsWeatherData& g1, const GpsWeatherData& g2,
15  const unsigned long int gps);
16 
17  bool operator<(const GpsWeatherData& d) const { return fGPSSecond < d.fGPSSecond; }
18 
19  friend
20  std::ostream&
21  operator<<(std::ostream& os, const GpsWeatherData& d)
22  {
23  return
24  os << d.fGPSSecond << ' '
25  << d.fTemperature << ' '
26  << d.fPressure;
27  }
28 
29  unsigned long int fGPSSecond = 0;
30  float fTemperature = 0; // C
31  float fPressure = 0; // hPa
32  };
33 
34 
35  //
36 
37 
38  /*
39  This is the format of the line in gps-weather.dat.bz2
40  file that can be obtained from Hernan Asorey's web page
41  http://auger.uis.edu.co/data/private.html
42 
43  http://auger.uis.edu.co/data/files/v2r0/gps-weather.dat.bz2
44  */
45 
46  struct GpsWeatherRawRow : public GpsWeatherData {
47 
48  void Clear() { *this = GpsWeatherRawRow(); }
49 
50  friend
51  std::istream&
52  operator>>(std::istream& is, GpsWeatherRawRow& g)
53  {
54  return
55  is >> g.fGPSSecond >> std::ws
56  >> g.fTemperature >> std::ws
57  >> g.fRelativeHumidity >> std::ws
58  >> g.fWindSpeed >> std::ws
59  >> g.fAverageWindSpeed >> std::ws
60  >> g.fMaxWindSpeed >> std::ws
61  >> g.fWindDirection >> std::ws
62  >> g.fPressure >> std::ws
63  >> g.fQuality;
64  }
65 
66  float fRelativeHumidity = 0; // %
67  float fWindSpeed = 0; // km/h
68  float fAverageWindSpeed = 0; // km/h
69  float fMaxWindSpeed = 0; // km/h
70  float fWindDirection = 0; // 0 = north, 90 = east
71  unsigned short fQuality = 0; // 0 = orig, 1 = interpolated,
72  // 2 = other station, 4 = long gap
73  };
74 
75 }
76 
77 
78 #endif
GpsWeatherData(const unsigned long int gps)
unsigned long int fGPSSecond
bool is(const double a, const double b)
Definition: testlib.cc:113
bool operator<(const GpsWeatherData &d) const
friend std::istream & operator>>(std::istream &is, GpsWeatherRawRow &g)
GpsWeatherData()=default
friend std::ostream & operator<<(std::ostream &os, const GpsWeatherData &d)
unsigned short fQuality
constexpr double g
Definition: AugerUnits.h:200
void Interpolate(const GpsWeatherData &g1, const GpsWeatherData &g2, const unsigned long int gps)

, generated on Tue Sep 26 2023.