OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
main_l1aextract.c
Go to the documentation of this file.
1 #include "regen.h"
2 #include "regen_proto.h"
3 
4 int main(int32 argc, char *argv[]) {
5 
6  char *infile, *outfile;
7  int32 status, spix, epix, sscan, escan, pix_sub, sc_sub;
8 
9  /*** check Usage ***/
10 
11  if (argc != 9) {
12  system("clear");
13  printf("\n\n\nUsage: <%s> ", argv[0]);
14  printf("infile spix epix sscan escan pix_sub sc_sub outfile"
15  "\n where:"
16  "\n\tinfile - input l1a data HDF file"
17  "\n\tspix - start pixel number"
18  "\n\tepix - end pixel number"
19  "\n\tsscan - start scan line"
20  "\n\tescan - end scan line"
21  "\n\tpix_sub - pixel subsampling rate"
22  "\n\tsc_sub - scan line subsampling rate"
23  "\n\toutfile - output file name"
24  "\n\nNOTE: Start and End pixel/scanline will be set to input file's"
25  " nsamp\n\t and nrec respectively, if the given values are out"
26  " of range.\n\n");
27  exit(EXIT_FAILURE);
28  }
29 
30  /*** load input parameters into local variables */
31 
32  infile = argv[1];
33  outfile = argv[8];
34  spix = atoi(argv[2]);
35  epix = atoi(argv[3]);
36  sscan = atoi(argv[4]);
37  escan = atoi(argv[5]);
38  pix_sub = atoi(argv[6]);
39  sc_sub = atoi(argv[7]);
40 
41  /*** call regen */
42 
43  status = regen(infile, &spix, &epix, &sscan, &escan, pix_sub, sc_sub,
44  "ALL", outfile);
45 
46  if (status != EXIT_SUCCESS) {
47  printf("\nError: status returned = %d", status);
48  printf("\n%s\n", ERR_MSG);
49  exit(EXIT_FAILURE);
50  }
51 
52  printf("\nThe output file %s has been successfully generated\n", outfile);
53 
54  return EXIT_SUCCESS;
55 }
char ERR_MSG[255]
Definition: extract_sub.c:119
#define EXIT_SUCCESS
Definition: GEO_basic.h:72
int status
Definition: l1_czcs_hdf.c:32
int main(int32 argc, char *argv[])
int32 regen(char *infile, int32 *ssamp, int32 *esamp, int32 *srec, int32 *erec, int32 px_sub, int32 sc_sub, char *parm_list, char *outfile)
Definition: extract_sub.c:152
int32 spix
Definition: l1_czcs_hdf.c:21
int32 epix
Definition: l1_czcs_hdf.c:23