OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
cz_meta_adj.c
Go to the documentation of this file.
1 #include "l1czcs.h"
2 #include <navigation.h>
3 
4 void cz_meta_adj(l1_data_struc *l1_data, gattr_struc *gattr)
5 /*******************************************************************
6 
7  cz_meta_adj
8 
9  purpose: adjust the metadata for the newly merged CZCS file
10  (note that it starts with the metadata from the first L1)
11 
12  Returns type: void
13 
14  Parameters: (in calling order)
15  Type Name I/O Description
16  ---- ---- --- -----------
17  l1_data_struc * l1_data I level-1 data struct
18  gattr_struc * gattr I/O global attribute struct
19 
20  Modification history:
21  Programmer Date Description of change
22  ---------- ---- ---------------------
23  W. Robinson, SAIC 2 Sep 2004 Original development
24 
25  *******************************************************************/
26  {
27  int32_t cmsec;
28  int clin, year, day, hr, min, msec;
29  float gmt, suna, sunz;
30  /*
31  * Note that some items are updated in cz_mov_scn
32  */
33  /*
34  * center time need doing and
35  * # scan control points
36  */
37  gattr->n_ctl_lin = gattr->scan_lines;
38  /*
39  * center time is gotten from msec of center line
40  */
41  clin = (gattr->scan_lines + 1) / 2;
42  cmsec = l1_data->msec[clin];
43  if (cmsec < l1_data->msec[0]) {
44  year = gattr->end_year;
45  day = gattr->end_day;
46  } else {
47  year = gattr->start_year;
48  day = gattr->start_day;
49  }
50  hr = cmsec / 3600000;
51  min = (cmsec / 60000) % 60;
52  msec = cmsec % 60000;
53  sprintf(gattr->center_time, "%4d%3.3d%2.2d%2.2d%5.5d", year, day,
54  hr, min, msec);
55 
56  /*
57  * get the center solar zenith from the center lat, lon, and time
58  */
59  cdata_();
60  gmt = (float) gattr->start_msec / (1000. * 3600.);
61  year = (int) gattr->start_year;
62  day = (int) gattr->start_day;
63  sunangs_(&year, &day, &gmt, &gattr->center_lon, &gattr->center_lat,
64  &sunz, &suna);
65  gattr->cntr_sol_zen = sunz;
66 
67  return;
68 }
int32_t day
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
int32 * msec
Definition: l1_czcs_hdf.c:31
void cz_meta_adj(l1_data_struc *l1_data, gattr_struc *gattr)
Definition: cz_meta_adj.c:4
void sunangs_(int *, int *, float *, float *, float *, float *, float *)
void cdata_()