OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
cz_sd_set.c
Go to the documentation of this file.
1 #include "l1czcs.h"
2 
3 void cz_sd_set(l1_data_struc *l1_data, gattr_struc *gattr)
4 /*******************************************************************
5 
6  cz_sd_set
7 
8  purpose: Propagate lat, lon extremes and some global
9  attribute values into the line-by-line values
10 
11  Returns type: void
12 
13  Parameters: (in calling order)
14  Type Name I/O Description
15  ---- ---- --- -----------
16  l1_data_struc * l1_data I arrays data counts, lat, lons
17  gattr_struc * gattr I/O structure with final
18  attributes
19 
20  Modification history:
21  Programmer Date Description of change
22  ---------- ---- ---------------------
23  W. Robinson 7-Sep-2004 Original development
24 
25  *******************************************************************/ {
26  int i, j, nctlpix, nlin, ctr_ctl_pt;
27  /*
28  * set up some sizes
29  */
30  nctlpix = gattr->n_ctl_pt;
31  nlin = gattr->scan_lines;
32  ctr_ctl_pt = (nctlpix - 1) / 2;
33  /*
34  * set up the lat, lon, tilt, attitude, slope, intercept and gain per line
35  */
36  for (i = 0; i < nlin; i++) {
37  l1_data->slat[i] = l1_data->ctl_pt_lat[ i * nctlpix ];
38  l1_data->slon[i] = l1_data->ctl_pt_lon[ i * nctlpix ];
39  l1_data->clat[i] = l1_data->ctl_pt_lat[ i * nctlpix + ctr_ctl_pt ];
40  l1_data->clon[i] = l1_data->ctl_pt_lon[ i * nctlpix + ctr_ctl_pt ];
41  l1_data->elat[i] = l1_data->ctl_pt_lat[ i * nctlpix + nctlpix - 1 ];
42  l1_data->elon[i] = l1_data->ctl_pt_lon[ i * nctlpix + nctlpix - 1 ];
43 
44  l1_data->tilt[i] = gattr->tilt;
45  l1_data->att_ang[ i * 3 ] = gattr->yaw;
46  l1_data->att_ang[ i * 3 + 1 ] = gattr->roll;
47  l1_data->att_ang[ i * 3 + 2 ] = gattr->pitch;
48  for (j = 0; j < 6; j++) {
49  l1_data->slope[ i * 6 + j ] = gattr->slope[j];
50  l1_data->intercept[ i * 6 + j ] = gattr->intercept[j];
51  }
52  l1_data->gain[i] = (short) gattr->gain;
53  }
54  return;
55 }
int j
Definition: decode_rs.h:73
int nlin
Definition: get_cmp.c:28
void cz_sd_set(l1_data_struc *l1_data, gattr_struc *gattr)
Definition: cz_sd_set.c:3
int i
Definition: decode_rs.h:71