OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_attributes.c
Go to the documentation of this file.
1 #include "proto.h"
2 #include "mfhdf.h"
3 
4 int get_attributes(int32 sd_id, char *prefix, int *Nlines, int *Npixels, int *startpix, int *subsampling, int *year, int *doy, int *orbno, char *title) {
5  int32 int32tmp;
6 
7  /* get product name */
8  if (read_attr(sd_id, "Product Name", prefix) == -1) return -1;
9 
10  /* get number of scans */
11  if (read_attr(sd_id, "Number of Scan Lines", &int32tmp) == -1) return -1;
12  *Nlines = int32tmp;
13 
14  /* get number of pixels per scan : should be 1285 for LAC and 248 for GAC */
15  if (read_attr(sd_id, "Pixels per Scan Line", &int32tmp) == -1) return -1;
16  *Npixels = int32tmp;
17 
18  /* get LAC number of 1st archived pixel : should be 1 for LAC and 147 for GAC */
19  if (read_attr(sd_id, "LAC Pixel Start Number", &int32tmp) == -1) return -1;
20  *startpix = int32tmp;
21 
22  /* get LAC pixel subsampling : should be 1 for LAC and 4 for GAC */
23  if (read_attr(sd_id, "LAC Pixel Subsampling", &int32tmp) == -1) return -1;
24  *subsampling = int32tmp;
25 
26  /* get orbit number */
27  if (read_attr(sd_id, "Orbit Number", (int16 *) orbno) == -1) return -1;
28 
29  /* get product title */
30  if (read_attr(sd_id, "Title", title) == -1) return -1;
31 
32  return 0;
33 }
integer, parameter int16
Definition: cubeio.f90:3
int get_attributes(int32 sd_id, char *prefix, int *Nlines, int *Npixels, int *startpix, int *subsampling, int *year, int *doy, int *orbno, char *title)
Definition: get_attributes.c:4
int read_attr(int32 sd_id, char *attrname, void *attr)
Definition: read_write.c:61