OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
generate_db_luts.cpp
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * NAME: generate_db_luts.cpp
4 *
5 * DESCRIPTION: Source file for generating netCDF4 LUTs from Deep blue algorithm
6 * LUTs.
7 *
8 * REFERENCES:
9 *
10 * REVISION HISTORY:
11 * DATE: PR# AUTHOR Description
12 * -------- ------ -------- -----------------
13 * 05-02-2018 S. Anderson
14 *
15 * NOTES (MISCELLANEOUS) SECTION:
16 * none
17 *
18 **************************************************************************/
19 
20 #include <genutils.h>
21 #include <DDOptions.h>
22 #include "deepblue/DbLutNetcdf.h"
23 
24 //-----------------------------------------------------------------------------
25 //
26 // Main Function
27 //
28 //-----------------------------------------------------------------------------
29 
30 int main(int argc, char* argv[])
31 {
32  int status = 0;
33 
35 // clo_setEnablePositionOptions(1);
36 
37  //char softwareVersion[200];
38  //sprintf(softwareVersion, "%d.%d.%d-r%d", L3MAPGEN_VERSION_MAJOR, L3MAPGEN_VERSION_MINOR,
39  // L3MAPGEN_VERSION_PATCH_LEVEL, SVN_REVISION);
40  init_options(list, "2.0");
41  if(argc == 1) {
43  exit(1);
44  }
45  read_options(list, argc, argv);
46 
47  if(clo_getBool(list, "verbose"))
48  want_verbose = 1;
49  else
50  want_verbose = 0;
51 
52  DbLutNetcdf* generator = new DbLutNetcdf();
53  generator->setHistory(get_history(argc, argv));
54 
55  status = generator->initialize();
56 
57  if ( status != DTDB_SUCCESS ) {
58  return(status);
59  }
60 
61  status = generator->create_db_nc4_lut();
62 
63  if ( status != DTDB_SUCCESS ) {
64  std::cerr << "\nWARNING!!! Only "<< status <<" of 15 LUTs created" << std::endl;
65  status = DTDB_FAIL;
66  }
67  else {
68  std::cerr << "\nNetCDF4 Deep Blue LUTs created successfully" << std::endl;
69  }
70 
71  delete generator;
72 
73  return(status);
74 }
75 
void read_options(clo_optionList_t *list, int argc, char *argv[])
Definition: DDOptions.cpp:576
int status
Definition: l1_czcs_hdf.c:32
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
Definition: CMakeLists.txt:7
clo_optionList_t * clo_createList()
Definition: clo.c:532
string get_history(int argc, char *argv[])
Definition: DDOptions.cpp:496
void clo_printUsage(clo_optionList_t *list)
Definition: clo.c:1988
void init_options(clo_optionList_t *list, const char *softwareVersion)
Definition: DDOptions.cpp:535
int want_verbose
int initialize()
Definition: DbLutNetcdf.cpp:57
int create_db_nc4_lut()
Definition: DbLutNetcdf.cpp:69
int main(int argc, char *argv[])
int clo_getBool(clo_optionList_t *list, const char *key)
Definition: clo.c:1375
void setHistory(std::string history)
Definition: DbLutNetcdf.h:482