OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
read_landmask.c
Go to the documentation of this file.
1 
2 #include <stdio.h>
3 #include <math.h>
4 #include "hdf.h"
5 #include "mfhdf.h"
6 #include "export.h"
7 
8 void read_landmask(int argc, IDL_VPTR argv[]) {
9 
10  int32 i;
11  int32 j;
12  int32 k;
13  int32 sds_id;
14  int32 dims[8];
15  int32 rank;
16  int32 dtype;
17  int32 nattrs;
18  int32 status;
19 
20  static char buffer[120];
21  UCHAR *data;
22 
23  int32 nfiles;
24  int32 scan;
25  int32 nscan;
26  int32 ncol;
27  int32 offset;
28  int32 sd_id_r;
29 
30  int32 ndatasets;
31  int32 nglobal_attr;
32  int32 count;
33  int32 dim_id_r;
34 
35  int32 start[2] = {0, 0};
36  int32 edges[2] = {0, 0};
37 
38  int16 icol, irow;
39 
40  int32 gridrows;
41  int32 *numbin;
42  int32 *basebin;
43  int32 totbins;
44  float *latbin;
45 
46  IDL_VARIABLE *ret;
47  UCHAR dat_typ, n_dims;
48  IDL_LONG nelem, dim[8];
49 
50  start[0] = (IDL_LONG) argv[0]->value.l;
51  edges[0] = (IDL_LONG) argv[1]->value.l;
52 
53  sd_id_r = SDstart("/home/simbiosd/data/common/LandWater.ISIN.30arcsec.hdf",
54  DFACC_RDONLY);
55 
56  sds_id = SDselect(sd_id_r, 0);
57  status = SDgetinfo(sds_id, buffer, &rank, dims, &dtype, &nattrs);
58 
59  edges[0] = 1;
60  edges[1] = dims[1];
61 
62  n_dims = 2;
63  dim[0] = edges[0];
64  dim[1] = dims[1];
65  data = (UCHAR *) IDL_MakeTempArray(IDL_TYP_BYTE, n_dims, dim,
66  IDL_BARR_INI_ZERO, &ret);
67 
68  status = SDreaddata(sds_id, start, NULL, edges, (VOIDP) data);
69 
70  SDendaccess(sds_id);
71  SDend(sd_id_r);
72 
73  IDL_VarCopy(ret, argv[2]);
74 
75  return;
76 }
77 
integer, parameter int16
Definition: cubeio.f90:3
int32 value
Definition: Granule.c:1235
void read_landmask(int argc, IDL_VPTR argv[])
Definition: read_landmask.c:8
int j
Definition: decode_rs.h:73
int status
Definition: l1_czcs_hdf.c:32
#define NULL
Definition: decode_rs.h:63
MOD_PR01 Production producing one five minute granule of output data in each run It can be configured to produce as many as three five minute granules per run Each execution with one construction record and one date file for each dataset In normal these are created by which splits them out of the hour datasets For LANCE they are created by which merges all session MODIS L0 datasets overlapping the requested time and extracts from the merged data those packets which fall within that time period Each scan of data is stored in the L1A granule that covers the start time of that scan
Definition: MOD_PR01_pr.txt:19
int32 nscan
Definition: l1_czcs_hdf.c:19
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
dtype
Definition: DDataset.hpp:31
Extra metadata that will be written to the HDF4 file l2prod rank
l2prod offset
int i
Definition: decode_rs.h:71
int k
Definition: decode_rs.h:73
int count
Definition: decode_rs.h:79