OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
dataday.h
Go to the documentation of this file.
1 /*
2  * dataday.h
3  *
4  * Created on: Jan 22, 2015
5  * Author: rhealy
6  */
7 
8 #ifndef SRC_L2BIN_DATADAY_H_
9 #define SRC_L2BIN_DATADAY_H_
10 #include <time.h>
11 #include <libnav.h>
12 
13 #define DATELINE_NOT_CROSSED 0
14 #define DATELINE_CROSSED 1
15 #define DATELINE_NORTH_POLE 2
16 #define DATELINE_SOUTH_POLE 3
17 #define DATELINE_IRREGULAR 4
18 #define INVALID_COORD 99999.999
19 
20 #define EPOCH_YEAR 1970
21 #define SECONDS_PER_YEAR 31536000
22 #define SECONDS_PER_LEAP_YEAR 31622400
23 #define MALLOC(ptr,typ,num) { \
24  (ptr) = (typ *)malloc((num) * sizeof(typ)); \
25  if((ptr) == NULL){ \
26  fprintf(stderr,"-E- %s line %d: Memory allocation failure.\n", \
27  __FILE__,__LINE__); \
28  exit(EXIT_FAILURE); \
29  } \
30 }
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 enum hort {
38 };
39 
40 struct coord {
41  float lat;
42  float lon;
43  struct coord *next;
44 };
45 void get_coord_extrema(int isnight, int n,
46  float *olat, float *olon, float *north, float *south,
47  float *west, float *east, int *dateline);
48 void get_datadays(time_t starttime, float eqxhour, int isnight,
49  int dateline, float west, float east,
50  int32_t *dataday0, int32_t *dataday1);
51 extern void cdata_();
52 void push(struct coord **vrtx, enum hort hort, float lat, float lon);
53 
54 int daynight_outlines(int32_t *year, int32_t *dayOfYear,
55  int32_t *msecondOfDay, int32_t wid, int32_t hgt,
56  float **lat, float **lon, int32_t n[2],
57  float *olat[2], float *olon[2], int8_t **dorn);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 #endif /* SRC_L2BIN_DATADAY_H_ */
float * hgt
float lat
Definition: dataday.h:41
void push(struct coord **vrtx, enum hort hort, float lat, float lon)
@ head
Definition: dataday.h:37
void get_coord_extrema(int isnight, int n, float *olat, float *olon, float *north, float *south, float *west, float *east, int *dateline)
Definition: dataday.c:65
float * lat
float lon
Definition: dataday.h:42
struct coord * next
Definition: dataday.h:43
void cdata_()
int daynight_outlines(int32_t *year, int32_t *dayOfYear, int32_t *msecondOfDay, int32_t wid, int32_t hgt, float **lat, float **lon, int32_t n[2], float *olat[2], float *olon[2], int8_t **dorn)
Definition: dataday.c:244
hort
Definition: dataday.h:36
@ tail
Definition: dataday.h:37
float * lon
void get_datadays(time_t starttime, float eqxhour, int isnight, int dateline, float west, float east, int32_t *dataday0, int32_t *dataday1)
Definition: dataday.c:17
Definition: dataday.h:40