OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
generate_dt_luts.cpp
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * NAME: generate_dt_luts.cpp
4 *
5 * DESCRIPTION: Source file for generating netCDF4 LUTs from Darktarget algorithm
6 * LUTs.
7 *
8 *
9 * REFERENCES:
10 *
11 * REVISION HISTORY:
12 * DATE: PR# AUTHOR Description
13 * -------- ------ -------- -----------------
14 * 05-02-2017 S. Anderson
15 *
16 * NOTES (MISCELLANEOUS) SECTION:
17 * none
18 *
19 **************************************************************************/
20 
21 #include <genutils.h>
22 #include <DDOptions.h>
23 #include "darktarget/DtLutNetcdf.h"
24 
25 //-----------------------------------------------------------------------------
26 //
27 // Main Function
28 //
29 //-----------------------------------------------------------------------------
30 
31 int main(int argc, char* argv[])
32 {
33  int status = 0;
34 
37 
38  //char softwareVersion[200];
39  //sprintf(softwareVersion, "%d.%d.%d-r%d", L3MAPGEN_VERSION_MAJOR, L3MAPGEN_VERSION_MINOR,
40  // L3MAPGEN_VERSION_PATCH_LEVEL, SVN_REVISION);
41  init_options(list, "2.0");
42  if(argc == 1) {
44  exit(1);
45  }
46  read_options(list, argc, argv);
47 
48  if(clo_getBool(list, "verbose"))
49  want_verbose = 1;
50  else
51  want_verbose = 0;
52 
53  DtLutNetcdf* generator = new DtLutNetcdf();
54  generator->setHistory(get_history(argc, argv));
55 
56  status = generator->initialize();
57 
58  if ( status != DD_SUCCESS ) {
59  return(status);
60  }
61 
62  status = generator->create_dt_nc4_lut();
63 
64  if ( status != DD_SUCCESS ) {
65  std::cerr << "WARNING!!! NetCDF4 Darktarget Aerosol LUT NOT created" << std::endl;
66  }
67  else {
68  std::cerr << "NetCDF4 Darktarget Aerosol LUT created" << std::endl;
69  }
70 
71  delete generator;
72 
73  std::cerr << "\nAll NetCDF4 LUTs created. \n" << std::endl;
74 
75  return(status);
76 }
77 
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
int initialize()
Definition: DtLutNetcdf.cpp:52
void clo_setEnablePositionOptions(int val)
Definition: clo.c:1685
void setHistory(std::string history)
Definition: DtLutNetcdf.h:248
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 main(int argc, char *argv[])
int clo_getBool(clo_optionList_t *list, const char *key)
Definition: clo.c:1375
int create_dt_nc4_lut()
Definition: DtLutNetcdf.cpp:64