Aether  0.0
Ionosphere-Thermosphere model
time_conversion.h
1 // Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
2 // Full license can be found in License.md
3 
4 #ifndef INCLUDE_TIME_CONVERSION_H_
5 #define INCLUDE_TIME_CONVERSION_H_
6 
7 /**************************************************************
8  * These are functions that convert time between different systems.
9  * - real time is seconds past January 1, 1965 00 UT
10  * - integer time is a vector of:
11  * (year, month, day, hour, minute, second, millisecond)
12  * - jday is julian day, which is the day of year (jan 1 = 1)
13  **************************************************************/
14 
15 #include <vector>
16 
17 /**************************************************************
18  \brief convert time from integer array to day of year (jday)
19  \param itime integer vector (y,m,d,h,m,s,ms)
20 **/
21 double time_int_to_jday(std::vector<int> itime);
22 
23 /**************************************************************
24  \brief converts year, month, day to day of year
25  \param year the year
26  \param month the month (1 = jan)
27  \param day day of the month (1 = 1)
28 **/
29 int day_of_year(int year, int month, int day);
30 
31 /**************************************************************
32  \brief converts integer vector time to real time
33  \param itime integer vector (y,m,d,h,m,s,ms)
34 **/
35 double time_int_to_real(std::vector<int> itime);
36 
37 /**************************************************************
38  \brief converts real time to an integer vector (y,m,d,h,m,s,ms)
39  \param timereal seconds past January 1, 1965 00 UT
40 **/
41 std::vector<int> time_real_to_int(double timereal);
42 
43 /**************************************************************
44  \brief runs a test on the time conversion routines.
45 **/
46 int test_time_routines();
47 
48 /**************************************************************
49  \brief displays the integer time array
50  \param itime integer vector (y,m,d,h,m,s,ms)
51 **/
52 void display_itime(std::vector<int> itime);
53 
54 #endif // INCLUDE_TIME_CONVERSION_H_