Due to the lapse in federal government funding, NASA is not updating this website. We sincerely regret this inconvenience.
NASA Logo
Ocean Color Science Software

ocssw V2022
ObpgReadGrid.h
Go to the documentation of this file.
1 #ifndef ObpgReadGrid_h
2 #define ObpgReadGrid_h
3 
4 #include <cstdlib>
5 #include <cstdio>
6 #include <cmath>
7 #include <string>
8 #include <netcdf>
9 
10 using namespace std;
11 using namespace netCDF;
12 using namespace netCDF::exceptions;
13 
14 #ifndef SUCCESS
15 #define SUCCESS 0
16 #endif
17 #ifndef FAIL
18 #define FAIL 1
19 #endif
20 
21 typedef struct {
22  size_t ny;
23  double nyPerDeg;
24  double latOrigin;
25  size_t nx;
26  double nxPerDeg;
27  double lonOrigin;
28  unsigned char **data;
29 } GridStruct;
30 
31 void printGrid(GridStruct grid);
32 void deletenc2d(unsigned char**& data);
33 unsigned char** readnc2d(NcVar ncVar,
34  size_t y0, size_t y1,
35  size_t x0, size_t x1);
36 
37 NcVar openGridFile(string filePath, string varName);
38 int getGridValue(GridStruct grid, float lat, float lon, unsigned char *value);
39 int loadGrid(NcVar var, float NSEW[4], GridStruct *grid);
40 
41 #endif
size_t nx
Definition: ObpgReadGrid.h:25
int32 value
Definition: Granule.c:1235
unsigned char ** readnc2d(NcVar ncVar, size_t y0, size_t y1, size_t x0, size_t x1)
double lonOrigin
Definition: ObpgReadGrid.h:27
int loadGrid(NcVar var, float NSEW[4], GridStruct *grid)
int getGridValue(GridStruct grid, float lat, float lon, unsigned char *value)
NcVar openGridFile(string filePath, string varName)
double latOrigin
Definition: ObpgReadGrid.h:24
unsigned char ** data
Definition: ObpgReadGrid.h:28
size_t ny
Definition: ObpgReadGrid.h:22
void printGrid(GridStruct grid)
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
void deletenc2d(unsigned char **&data)
double nyPerDeg
Definition: ObpgReadGrid.h:23
double nxPerDeg
Definition: ObpgReadGrid.h:26