OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
bindepths.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <mfhdf.h>
#include <genutils.h>
Include dependency graph for bindepths.c:

Go to the source code of this file.

Macros

#define USAGE   "\Usage: %s filename\n\where: filename is the full path to a SeaWiFS level-2 file that contains\n\ computed depth data.\n\This program maps SeaWiFS level-2 depth data to bins of a Plate Carree\n\projection that extends from 35 North to 35 South and from 180 West\n\to 180 East. The results are written to standard output as a series\n\of ASCII text records. Each output record contains a bin number and\n\pixel value separated by whitespace. Each bin represents one 0.01 by\n\0.01 degree subregion of the aforementioned area. Bins are numbered\n\from 0 to 251,999,999. Depths are expressed in meters.\n"
 
#define FILENAME   argv[1]
 
#define LAC_PIXEL_INSET   200
 
#define SCALE   100
 
#define READ_GLBL_ATTR(nam, ptr)
 
#define MALLOC(ptr, typ, num)
 
#define READ_SDS(nam, ptr, s0, s1, s2, e0, e1, e2)
 

Functions

void get_scan_coords (int32, int32, int32, float32 **, float32 **)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ FILENAME

#define FILENAME   argv[1]

Definition at line 32 of file bindepths.c.

◆ LAC_PIXEL_INSET

#define LAC_PIXEL_INSET   200

Definition at line 33 of file bindepths.c.

◆ MALLOC

#define MALLOC (   ptr,
  typ,
  num 
)
Value:
{ \
(ptr) = (typ *)malloc((num) * sizeof(typ)); \
if((ptr) == NULL){ \
fprintf(stderr,"-E- %s line %d: Memory allocation failure.\n", \
__FILE__,__LINE__); \
exit(EXIT_FAILURE); \
} \
}

Definition at line 45 of file bindepths.c.

◆ READ_GLBL_ATTR

#define READ_GLBL_ATTR (   nam,
  ptr 
)
Value:
{ \
if(SDreadattr(sd_id,SDfindattr(sd_id,(nam)),(VOIDP)(ptr))){ \
fprintf(stderr, \
"-E- %s line %d: Could not get global attribute, %s, from file, %s.\n", \
__FILE__,__LINE__,(nam),FILENAME); \
return(EXIT_FAILURE); \
} \
}

Definition at line 36 of file bindepths.c.

◆ READ_SDS

#define READ_SDS (   nam,
  ptr,
  s0,
  s1,
  s2,
  e0,
  e1,
  e2 
)
Value:
{ \
int32 start[3],edge[3]; \
edge[0]=(e0); edge[1]=(e1); edge[2]=(e2); \
start[0]=(s0); start[1]=(s1); start[2]=(s2); \
if(SDreaddata(SDselect(sd_id, SDnametoindex(sd_id, (nam))), \
start, NULL, edge, (VOIDP)(ptr)) == FAIL){ \
fprintf(stderr,"-E- %s line %d: Could not read SDS, %s.\n", \
__FILE__,__LINE__,(nam)); \
exit(EXIT_FAILURE); \
} \
}

Definition at line 54 of file bindepths.c.

◆ SCALE

#define SCALE   100

Definition at line 34 of file bindepths.c.

◆ USAGE

#define USAGE   "\Usage: %s filename\n\where: filename is the full path to a SeaWiFS level-2 file that contains\n\ computed depth data.\n\This program maps SeaWiFS level-2 depth data to bins of a Plate Carree\n\projection that extends from 35 North to 35 South and from 180 West\n\to 180 East. The results are written to standard output as a series\n\of ASCII text records. Each output record contains a bin number and\n\pixel value separated by whitespace. Each bin represents one 0.01 by\n\0.01 degree subregion of the aforementioned area. Bins are numbered\n\from 0 to 251,999,999. Depths are expressed in meters.\n"

Definition at line 20 of file bindepths.c.

Function Documentation

◆ get_scan_coords()

void get_scan_coords ( int32  s,
int32  npix,
int32  nctl,
float32 **  lat,
float32 **  lon 
)

Definition at line 185 of file bindepths.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 70 of file bindepths.c.

#define FAIL
Definition: ObpgReadGrid.h:18
#define NULL
Definition: decode_rs.h:63
#define FILENAME
Definition: bindepths.c:32