OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
wr_geo_scan.c
Go to the documentation of this file.
1 #include "viirs_sim_sdr.h"
2 
3 int wr_geo_scan(int iscn, out_rec_struc *out_rec)
4 /*-----------------------------------------------------------------------------
5  Program: wr_sdr_scan.c
6 
7  Description: write scan of data to the VIIRS geolocation SDR
8 
9  Arguments:
10  Type Name I/O Description
11  ---- ---- --- -----------
12  int iscn I scan to write
13  out_rec_struc * out_rec I/O output record controls
14 
15  Modification history:
16 
17  W. Robinson, SAIC 21 Oct 2008 Original development
18  W. Robinson, SAIC 15 Mar 2010 reconfigure to scan oriented output
19 
20 ----------------------------------------------------------------------------*/ {
21  int ilin, start[2], count[2];
22  /*
23  * latitude
24  */
25  ilin = iscn * out_rec->ndet_scan;
26  start[0] = ilin;
27  start[1] = 0;
28  count[0] = out_rec->ndet_scan;
29  count[1] = out_rec->npix;
30  if (h5io_wr_ds_slice(&(out_rec->geo_dat_id[0]), start, count,
31  out_rec->lat) != 0) {
32  printf("%s: lat output failed on scan: %d\n", __FILE__, iscn);
33  return 1;
34  }
35  /* longitude */
36  if (h5io_wr_ds_slice(&(out_rec->geo_dat_id[1]), start, count,
37  out_rec->lon) != 0) {
38  printf("%s: lon output failed on scan: %d\n", __FILE__, iscn);
39  return 1;
40  }
41  /* sensor azimuth */
42  if (h5io_wr_ds_slice(&(out_rec->geo_dat_id[2]), start, count,
43  out_rec->sena) != 0) {
44  printf("%s: sena output failed on scan: %d\n", __FILE__, iscn);
45  return 1;
46  }
47  /* sensor zenith */
48  if (h5io_wr_ds_slice(&(out_rec->geo_dat_id[3]), start, count,
49  out_rec->senz) != 0) {
50  printf("%s: senz output failed on scan: %d\n", __FILE__, iscn);
51  return 1;
52  }
53  /* solar azimuth */
54  if (h5io_wr_ds_slice(&(out_rec->geo_dat_id[4]), start, count,
55  out_rec->sola) != 0) {
56  printf("%s: sola output failed on scan: %d\n", __FILE__, iscn);
57  return 1;
58  }
59  /* solar zenith */
60  if (h5io_wr_ds_slice(&(out_rec->geo_dat_id[5]), start, count,
61  out_rec->solz) != 0) {
62  printf("%s: solz output failed on scan: %d\n", __FILE__, iscn);
63  return 1;
64  }
65  return 0;
66 }
int h5io_wr_ds_slice(h5io_str *ds_id, int *start, int *count, void *data)
Definition: h5io.c:1175
int wr_geo_scan(int iscn, out_rec_struc *out_rec)
Definition: wr_geo_scan.c:3
int count
Definition: decode_rs.h:79