Jpp  15.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JUTCTimeRange.hh
Go to the documentation of this file.
1 #ifndef __JUTC__JUTCTIMERANGE__
2 #define __JUTC__JUTCTIMERANGE__
3 
4 #include "JTools/JRange.hh"
5 #include "JLang/JManip.hh"
6 
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JUTC {}
13 namespace JPP { using namespace JUTC; }
14 
15 /**
16  * Auxiliaries for handling universal time coordinate (UTC).
17  */
18 namespace JUTC {
19 
20  using JTOOLS::JRange;
21 
22  /**
23  * UTC time range [s].
24  */
25  class JUTCTimeRange :
26  public JRange<double>
27  {
28  public:
29  /**
30  * Default constructor.
31  */
33  JRange<double>(0.0, 999999999999.9)
34  {}
35 
36 
37  /**
38  * Constructor.
39  *
40  * \param timerange UTC time range
41  */
42  JUTCTimeRange(const JRange<double>& timerange) :
43  JRange<double>(timerange)
44  {}
45 
46 
47  /**
48  * Constructor.
49  *
50  * \param Tmin_s minimal UTC time [s]
51  * \param Tmax_s maximal UTC time [s]
52  */
53  JUTCTimeRange(const double Tmin_s, const double Tmax_s) :
54  JRange<double>(Tmin_s, Tmax_s)
55  {}
56 
57 
58  /**
59  * Get UTC time range.
60  *
61  * \return UTC time range
62  */
64  {
65  return static_cast<const JUTCTimeRange&>(*this);
66  }
67 
68 
69  /**
70  * Set UTC time range.
71  *
72  * \param timerange UTC time range
73  */
74  void setUTCTimeRange(const JRange<double>& timerange)
75  {
76  static_cast<JUTCTimeRange&>(*this) = timerange;
77  }
78 
79 
80  /**
81  * Write UTC time range to output.
82  *
83  * \param out output stream
84  * \param utc UTC time range
85  * \return output stream
86  */
87  friend inline std::ostream& operator<<(std::ostream& out, const JUTCTimeRange& utc)
88  {
89  const JFormat format(out, getFormat<JUTCTimeRange>(JFormat_t(13, 1, std::ios::fixed)));
90 
91  return out << format << utc.getLowerLimit() << ' '
92  << format << utc.getUpperLimit();
93  }
94  };
95 }
96 
97 #endif
JUTCTimeRange(const JRange< double > &timerange)
Constructor.
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JUTCTimeRange()
Default constructor.
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:632
void setUTCTimeRange(const JRange< double > &timerange)
Set UTC time range.
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
JUTCTimeRange(const double Tmin_s, const double Tmax_s)
Constructor.
Range of values.
Definition: JRange.hh:38
I/O manipulators.
UTC time range [s].
Auxiliary class to define a range between two values.
friend std::ostream & operator<<(std::ostream &out, const JUTCTimeRange &utc)
Write UTC time range to output.
const JUTCTimeRange & getUTCTimeRange() const
Get UTC time range.
Data structure for format specifications.
Definition: JManip.hh:522
then usage $script< detector file >< tripodfile >< stage > input file nInput files correspond to the output of JAcousticsEventBuilder[.sh] nFirst stage eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY eval JPrintDetector a $DETECTOR O CAN source JAcoustics sh $DETECTOR_ID typeset A CONFIGURATION for key in Tmax_s