OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
timeutils.h
Go to the documentation of this file.
1 #ifndef _TIME_UTILS_H
2 #define _TIME_UTILS_H
3 
4 #include <stdint.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <time.h>
9 #include <math.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 int isleap(int year);
16 
17 time_t gmt_offset(void);
18 double yds2unix(int16_t year, int16_t day, double secs);
19 double yds2unix_(int16_t *year, int16_t *day, double *secs);
20 void unix2yds(double usec, int16_t *year, int16_t *day, double *secs);
21 char * unix2ydhmsf(double usec, char zone);
22 double ymds2unix(int16_t year, int16_t month, int16_t day, double secs);
23 void unix2ymds(double usec, int16_t *year, int16_t *mon, int16_t *day, double *secs);
24 void unix2ymdhms(double usec, int16_t *year, int16_t *mon, int16_t *day, int16_t *hour, int16_t *min, double *sec);
25 void yd2md(int16_t year, int16_t doy, int16_t *month, int16_t *dom);
26 char * ydhmsf(double dtime, char zone);
27 double now(void);
28 void ymdhms2ydmsec(int yy, int mm, int dd, int hh, int mn, int sc,
29  int32_t *year, int32_t *day, int32_t *msec);
30 void date2ydmsec(char *date, int32_t *year, int32_t *day, int32_t *msec);
31 void isodate2ydmsec(char *date, int32_t *year, int32_t *day, int32_t *msec);
32 char * unix2isodate(double dtime, char zone);
33 double zulu2unix(char *zulu);
34 double isodate2unix(const char *isodate);
35 void addmsec(int32_t *year, int32_t *day, int32_t *msec, int32_t delta);
36 
37 void get_time(char *pr_time);
38 
39 int leapseconds_since_1993(double tai93time);
40 int leapseconds_since_1993_unix(double unixtime);
41 double unix_to_tai93(double unixtime);
42 double tai93_to_unix(double tai93);
43 double unix_to_tai58(double unixtime);
44 double tai58_to_unix(double tai58);
45 
46 int32_t jday(int16_t i, int16_t j, int16_t k);
47 int jdate(int32_t julian, int32_t *year, int32_t *doy);
48 double yds2tai93(int16_t iyr, int16_t idy, double sec);
49 int ccsds_to_yds(uint8_t *cctime, int32_t *iyear, int32_t *iday, double *sec);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif
char * ydhmsf(double dtime, char zone)
Definition: ydhmsf.c:12
int jdate(int32_t julian, int32_t *year, int32_t *doy)
Definition: jdate.c:5
double ymds2unix(int16_t year, int16_t month, int16_t day, double secs)
Definition: ymds2unix.c:9
void get_time(char *pr_time)
Definition: get_time.c:28
int j
Definition: decode_rs.h:73
int32_t day
double yds2unix(int16_t year, int16_t day, double secs)
Definition: yds2unix.c:7
int isleap(int year)
Definition: isleap.c:3
These are used to scale the SD before writing it to the HDF4 file The default is and which means the product is not scaled at all Since the product is usually stored as a float inside of this is a way to write the float out as a integer l2prod min
char * unix2ydhmsf(double usec, char zone)
Definition: unix2ydhmsf.c:8
void unix2ymds(double usec, int16_t *year, int16_t *mon, int16_t *day, double *secs)
Definition: unix2ymds.c:8
double yds2tai93(int16_t iyr, int16_t idy, double sec)
Definition: yds2tai.c:4
int32 * msec
Definition: l1_czcs_hdf.c:31
void unix2yds(double usec, int16_t *year, int16_t *day, double *secs)
Definition: unix2yds.c:7
int leapseconds_since_1993_unix(double unixtime)
Definition: leapsecond.c:71
double unix_to_tai93(double unixtime)
Definition: yds2tai.c:11
void yd2md(int16_t year, int16_t doy, int16_t *month, int16_t *dom)
Definition: yd2md.c:6
double zulu2unix(char *zulu)
Definition: zulu2unix.c:3
int32_t jday(int16_t i, int16_t j, int16_t k)
Definition: jday.c:4
double tai93_to_unix(double tai93)
Definition: yds2tai.c:16
double unix_to_tai58(double unixtime)
Definition: yds2tai.c:23
const double delta
void addmsec(int32_t *year, int32_t *day, int32_t *msec, int32_t delta)
Definition: addmsec.c:3
void date2ydmsec(char *date, int32_t *year, int32_t *day, int32_t *msec)
Definition: date2ydmsec.c:4
void ymdhms2ydmsec(int yy, int mm, int dd, int hh, int mn, int sc, int32_t *year, int32_t *day, int32_t *msec)
Definition: ydhms2ydmsec.c:3
double yds2unix_(int16_t *year, int16_t *day, double *secs)
Definition: yds2unix.c:34
int leapseconds_since_1993(double tai93time)
Definition: leapsecond.c:58
double tai58_to_unix(double tai58)
Definition: yds2tai.c:29
char * unix2isodate(double dtime, char zone)
Definition: unix2isodate.c:10
void isodate2ydmsec(char *date, int32_t *year, int32_t *day, int32_t *msec)
Definition: date2ydmsec.c:20
integer function julian(DAY, MONTH, YEAR)
Definition: julian.f:2
int32_t idy
Definition: atrem_corl1.h:161
void unix2ymdhms(double usec, int16_t *year, int16_t *mon, int16_t *day, int16_t *hour, int16_t *min, double *sec)
Definition: unix2ymdhms.c:8
int i
Definition: decode_rs.h:71
int32_t iyr
Definition: atrem_corl1.h:161
int k
Definition: decode_rs.h:73
int ccsds_to_yds(uint8_t *cctime, int32_t *iyear, int32_t *iday, double *sec)
Definition: ccsds_to_yds.c:5
time_t gmt_offset(void)
Definition: gmt_offset.c:8
double now(void)
Definition: HISTORY.txt:361
double isodate2unix(const char *isodate)
Definition: unix2isodate.c:61