Home
Install
Use
Develop
Support
News
Credits
hosted by
|
11 #ifndef __GENUTIL_MJD_H
12 #define __GENUTIL_MJD_H
34 void add_day ( double dd);
38 static const MJD zero;
40 static double precision;
41 static unsigned ostream_precision;
46 MJD () { days=0;secs=0;fracsec=0.0; };
50 MJD ( int intday, double fracday);
51 MJD ( double dd, double ss, double fs);
52 MJD ( int dd, int ss, double fs);
55 MJD ( const char* mjdstring);
59 MJD ( const struct tm& greg);
60 MJD ( const struct timeval& tp);
63 MJD ( const utc_t& utc);
66 MJD ( const std::string& mjd);
69 int Construct ( const char* mjdstr);
72 int Construct (time_t time);
75 int Construct ( const struct tm& greg);
78 int Construct ( const struct timeval& tp);
81 int Construct ( const utc_t& utc);
85 int Construct (uint64_t bat);
87 double in_seconds() const;
88 double in_days() const;
89 double in_minutes() const;
92 int UTC (utc_t* utc, double* fsec=NULL) const;
93 int gregorian ( struct tm* gregdate, double* fsec=NULL) const;
95 MJD & operator = ( const MJD &);
96 MJD & operator += ( const MJD &);
97 MJD & operator -= ( const MJD &);
98 MJD & operator += ( const double &);
99 MJD & operator -= ( const double &);
100 MJD & operator *= ( const double &);
101 MJD & operator /= ( const double &);
102 friend const MJD operator + ( const MJD &, const MJD &);
103 friend const MJD operator - ( const MJD &, const MJD &);
104 friend const MJD operator + ( const MJD &, double);
105 friend const MJD operator - ( const MJD &, double);
106 friend const MJD operator * ( const MJD &, double);
107 friend const MJD operator * ( double a, const MJD& m)
109 friend const MJD operator / ( const MJD &, double);
112 friend const MJD operator - ( MJD m);
114 friend int operator > ( const MJD &, const MJD &);
115 friend int operator < ( const MJD &, const MJD &);
116 friend int operator >= ( const MJD &, const MJD &);
117 friend int operator <= ( const MJD &, const MJD &);
118 friend int operator == ( const MJD &, const MJD &);
119 friend int operator != ( const MJD &, const MJD &);
122 float plotval() const { return float (in_days()); };
126 double fracday() const;
127 int get_secs() const { return(secs);};
128 double get_fracsec() const { return(fracsec);};
131 double LST ( double longitude) const;
134 double GMST () const;
136 std::string printdays ( unsigned precision) const;
138 int print (FILE *stream);
139 int println (FILE *stream);
140 std::string printall() const;
141 std::string printdays() const;
142 std::string printhhmmss() const;
143 std::string printfs() const;
144 std::string strtempo() const;
148 char* datestr ( char* dstr, int len, const char* format) const;
151 std::string datestr ( const char* format, unsigned fractional_second_digits = 0) const;
154 friend int mpiPack_size ( const MJD&, MPI_Comm comm, int* size);
155 friend int mpiPack ( const MJD&, void* outbuf, int outcount,
156 int* position, MPI_Comm comm);
157 friend int mpiUnpack ( void* inbuf, int insize, int* position,
158 MJD*, MPI_Comm comm);
162 friend bool equal ( const MJD &m1, const MJD &m2);
166 inline double cast_double( const MJD&m) { return m.in_days();}
168 std::ostream& operator<< (std::ostream& ostr, const MJD& mjd);
169 std::istream& operator>> (std::istream& istr, MJD& mjd);
174 class numeric_limits< MJD> {
176 static const int digits10 = 15;
A convenient exception handling class. Definition: Error.h:54
Class for representing modified Julian dates with high precision. Definition: MJD.h:27
Generated using doxygen 1.8.17
|