UtcTprhData.h
Go to the documentation of this file.
1 #ifndef _anal_UtcTprhData_h_
2 #define _anal_UtcTprhData_h_
3 
4 #include <iostream>
5 
6 
7 namespace anal {
8 
9  /*
10  This is the part of the data that actually stays in memory.
11  Move any items needed for energy corrections from class UtcTprhRawRow
12  to this class UtcTprhData.
13  */
14 
15  struct UtcTprhData {
16 
17  UtcTprhData() = default;
18 
19  UtcTprhData(const unsigned long int gps) : fGPSSecond(gps) { }
20 
21  void Interpolate(const UtcTprhData& g1, const UtcTprhData& g2,
22  const unsigned long int gps);
23 
24  bool operator<(const UtcTprhData& d) const { return fGPSSecond < d.fGPSSecond; }
25 
26  friend
27  std::ostream&
28  operator<<(std::ostream& os, const UtcTprhData& d)
29  {
30  return
31  os << d.fGPSSecond << ' '
32  << d.fTemperature << ' '
33  << d.fPressure << ' '
34  << d.fDensity << ' '
35  << d.fDailyAvgDensity << ' '
37  }
38 
39  unsigned long int fGPSSecond = 0;
40  float fTemperature = 0; // C
41  float fPressure = 0; // hPa
42  float fDensity = 0; // kg / m^3
43  float fDailyAvgDensity = 0; // kg / m^3
44  float fDensity2HoursBefore = 0; // kg / m^3
45 
46  };
47 
48 
49  //
50 
51 
52  /*
53  This is the format of the line in utctprh.dat.bz2
54  file that can be obtained from Hernan Asorey's web page
55  http://auger.uis.edu.co/data/private.html
56 
57  http://auger.uis.edu.co/data/files/v2r0/utctprh.dat.bz2
58  */
59 
60  struct UtcTprhRawRow : public UtcTprhData {
61 
62  void Clear() { *this = UtcTprhRawRow(); }
63 
64  friend
65  std::istream&
66  operator>>(std::istream& is, UtcTprhRawRow& g)
67  {
68  is >> g.fUTCSecond >> std::ws
69  >> g.fTemperature >> std::ws
70  >> g.fPressure >> std::ws
71  >> g.fDensity >> std::ws
72  >> g.fDailyAvgDensity >> std::ws
73  >> g.fN6T5Hexagons >> std::ws
74  >> g.fN5T5Hexagons >> std::ws
75  >> g.fQuality >> std::ws
76  >> g.fBadPeriod >> std::ws
77  >> g.fUndocumentedQuantity1 >> std::ws
78  >> g.fDensity2HoursBefore >> std::ws
80  const unsigned long int unixGpsDiff =
81  315964800ul - 25ul; // leap seconds as in 2014
82  if (is && g.fUTCSecond)
83  g.fGPSSecond = g.fUTCSecond - unixGpsDiff;
84  return is;
85  }
86 
87  unsigned long int fUTCSecond = 0;
88  float fN6T5Hexagons = 0;
89  float fN5T5Hexagons = 0;
90  unsigned short fQuality = 0; // 0 = orig,
91  // 1 = interpolated,
92  // 2 = other station,
93  // 3 = moni files,
94  // 4 = long gap
95  unsigned short fBadPeriod = 0;
96  //
98  float fDailyAvgDensityCentered = 0; // kg / m^3
99 
100  };
101 
102 }
103 
104 
105 #endif
bool operator<(const UtcTprhData &d) const
Definition: UtcTprhData.h:24
bool is(const double a, const double b)
Definition: testlib.cc:113
float fDailyAvgDensityCentered
Definition: UtcTprhData.h:98
#define ul(text)
float fUndocumentedQuantity1
Definition: UtcTprhData.h:97
constexpr double g
Definition: AugerUnits.h:200
friend std::ostream & operator<<(std::ostream &os, const UtcTprhData &d)
Definition: UtcTprhData.h:28
friend std::istream & operator>>(std::istream &is, UtcTprhRawRow &g)
Definition: UtcTprhData.h:66
UtcTprhData()=default
unsigned long int fUTCSecond
Definition: UtcTprhData.h:87
unsigned short fQuality
Definition: UtcTprhData.h:90
unsigned short fBadPeriod
Definition: UtcTprhData.h:95
unsigned long int fGPSSecond
Definition: UtcTprhData.h:39
UtcTprhData(const unsigned long int gps)
Definition: UtcTprhData.h:19
float fDensity2HoursBefore
Definition: UtcTprhData.h:44
float fDailyAvgDensity
Definition: UtcTprhData.h:43
void Interpolate(const UtcTprhData &g1, const UtcTprhData &g2, const unsigned long int gps)
Definition: UtcTprhData.cc:8

, generated on Tue Sep 26 2023.