OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
goci.h
Go to the documentation of this file.
1 
8 #ifndef GOCI_H
9 #define GOCI_H
10 
11 #include <proj.h>
12 
13 typedef struct goci_l1b_t {
14  // info
15 
16  int npixels;
17  int nscans;
18  int nbands;
20  PJ *pj;
21  double startX;
22  double startY;
23  double deltaX;
24  double deltaY;
25  float sat_pos[3];
27  // HDF5 values
28 
29  hid_t fid;
30  hid_t gid;
31  hid_t dset_id[8];
32  int32_t slot_nav_avail;
33  float *slot_rel_time;
34  unsigned char *slot_asg;
36 } goci_l1b_t;
37 
38 /*
39  * GOCI slot nav table from L1B
40  */
41 typedef struct slot_nav_str_def {
42  int32_t band_num;
43  int32_t slot_num;
44  float rel_time;
45  float sc_att[3];
46  float xo;
47  float yo;
48  float xs;
49  float ys;
50  float xpo;
51  float ypo;
52  float xps;
53  float yps;
54  int32_t num_a_parm;
55  float a_parm[16];
56  int32_t num_b_parm;
57  float b_parm[16];
58  int32_t num_c_parm;
59  float c_parm[16];
60  int32_t num_d_parm;
61  float d_parm[16];
62  int32_t num_ap_parm;
63  float ap_parm[16];
64  int32_t num_bp_parm;
65  float bp_parm[16];
66  int32_t num_cp_parm;
67  float cp_parm[16];
68  int32_t num_dp_parm;
69  float dp_parm[16];
70 } slot_nav_str;
71 
72 int goci_proj4_open(goci_l1b_t *l1b);
73 void goci_proj4_convert(goci_l1b_t *l1b, int numPoints, double *x, double *y);
74 void goci_proj4_close(goci_l1b_t *l1b);
75 
76 int goci_l1b_open(const char *src_path, goci_l1b_t **goci_l1b);
77 int goci_l1b_close(goci_l1b_t *goci_l1b);
78 int goci_l1b_get_date(goci_l1b_t *goci_l1b, char *tim_str, int *year,
79  int *month, int *day);
80 int goci_l1b_get_time(goci_l1b_t *goci_l1b, char *tim_str, int *hour,
81  int *min, int *sec);
82 int goci_l1b_get_band(goci_l1b_t *goci_l1b, int band, int line,
83  uint32_t *buf);
84 int32_t goci_slot_init(hid_t file_id, hsize_t *dims, float *slot_rel_time,
85  unsigned char *slot_asg, int32_t *slot_nav_avail);
86 int32_t goci_slot_nav(int32_t ipix, int32_t ilin, int32_t bnd, int32_t itile,
87  slot_nav_str *slot_nav, int32_t nbnd, int32_t nslot,
88  unsigned char *bnd_tile_lut, float *nradsq);
89 unsigned char goci_slot_time(int32_t ipix, int32_t ilin, goci_l1b_t *goci_l1b,
90  float *rel_sec);
91 
92 #endif
int32_t slot_nav_avail
Definition: goci.h:32
int goci_l1b_get_date(goci_l1b_t *goci_l1b, char *tim_str, int *year, int *month, int *day)
read a date of GOCI data
Definition: goci.c:415
int32_t band_num
Definition: goci.h:42
int32_t goci_slot_nav(int32_t ipix, int32_t ilin, int32_t bnd, int32_t itile, slot_nav_str *slot_nav, int32_t nbnd, int32_t nslot, unsigned char *bnd_tile_lut, float *nradsq)
Definition: goci_slot.c:302
double startY
Definition: goci.h:22
double deltaY
Definition: goci.h:24
int32_t day
float ap_parm[16]
Definition: goci.h:63
unsigned char goci_slot_time(int32_t ipix, int32_t ilin, goci_l1b_t *goci_l1b, float *rel_sec)
Definition: goci_slot.c:436
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
float rel_time
Definition: goci.h:44
void goci_proj4_close(goci_l1b_t *l1b)
free all memory related to proj4
Definition: goci.c:205
void goci_proj4_convert(goci_l1b_t *l1b, int numPoints, double *x, double *y)
int goci_proj4_open(goci_l1b_t *l1b)
init proj4 for GOCI geolocation
Definition: goci.c:31
int32_t num_cp_parm
Definition: goci.h:66
float b_parm[16]
Definition: goci.h:57
float ypo
Definition: goci.h:51
double deltaX
Definition: goci.h:23
float c_parm[16]
Definition: goci.h:59
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second band
int32_t num_bp_parm
Definition: goci.h:64
float d_parm[16]
Definition: goci.h:61
float sc_att[3]
Definition: goci.h:45
int goci_l1b_close(goci_l1b_t *goci_l1b)
close GOCI bands
Definition: goci.c:370
float dp_parm[16]
Definition: goci.h:69
float bp_parm[16]
Definition: goci.h:65
float yps
Definition: goci.h:53
int nbnd
Definition: get_cmp.c:29
int32_t num_d_parm
Definition: goci.h:60
float a_parm[16]
Definition: goci.h:55
hid_t fid
Definition: goci.h:29
float yo
Definition: goci.h:47
int32_t num_a_parm
Definition: goci.h:54
int32_t slot_num
Definition: goci.h:43
PJ * pj
Definition: goci.h:20
int goci_l1b_get_time(goci_l1b_t *goci_l1b, char *tim_str, int *hour, int *min, int *sec)
read a time of GOCI data
Definition: goci.c:452
float * slot_rel_time
Definition: goci.h:33
float xpo
Definition: goci.h:50
int nscans
Definition: goci.h:17
int32_t num_b_parm
Definition: goci.h:56
int32_t goci_slot_init(hid_t file_id, hsize_t *dims, float *slot_rel_time, unsigned char *slot_asg, int32_t *slot_nav_avail)
Definition: goci_slot.c:20
float xs
Definition: goci.h:48
float cp_parm[16]
Definition: goci.h:67
float xo
Definition: goci.h:46
hid_t dset_id[8]
Definition: goci.h:31
int32_t num_dp_parm
Definition: goci.h:68
double startX
Definition: goci.h:21
int32_t num_c_parm
Definition: goci.h:58
hid_t gid
Definition: goci.h:30
unsigned char * slot_asg
Definition: goci.h:34
int nbands
Definition: goci.h:18
int goci_l1b_get_band(goci_l1b_t *goci_l1b, int band, int line, uint32_t *buf)
read specified band and line from GOCI file.
Definition: goci.c:488
int goci_l1b_open(const char *src_path, goci_l1b_t **goci_l1b)
open GOCI bands
Definition: goci.c:226
float sat_pos[3]
Definition: goci.h:25
float ys
Definition: goci.h:49
int npixels
Definition: goci.h:16
float xps
Definition: goci.h:52
int32_t num_ap_parm
Definition: goci.h:62