OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
tmatrix.cpp
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * NAME: tmatrix.cpp
4 *
5 * DESCRIPTION: Source file for T-Matrix calculation
6 *
7 * REFERENCES:
8 *
9 * REVISION HISTORY:
10 * DATE: PR# AUTHOR Description
11 * -------- ------ -------- -----------------
12 * 05-02-2018 S. Anderson
13 *
14 * NOTES (MISCELLANEOUS) SECTION:
15 * none
16 *
17 **************************************************************************/
18 
19 #include <tmatrix.h>
20 
21 #include <genutils.h>
22 #include <TmParamsReader.h>
23 #include <TmProcess.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  tmatrix_init_options(list, "2.0");
42  if(argc == 1) {
44  exit(1);
45  }
46  tmatrix_read_options(list, argc, argv);
47 
48  if(clo_getBool(list, "verbose"))
49  want_verbose = 1;
50  else
51  want_verbose = 0;
52 
53  TmProcess* generator = new TmProcess();
54  generator->setHistory(tm_get_history(argc, argv));
55 
56  status = generator->initialize();
57 
58  if ( status != TM_SUCCESS ) {
59  return(status);
60  }
61 
62  status = generator->compute_dtdb();
63 
64  if ( status != TM_SUCCESS ) {
65  return(status);
66  }
67 
68 // status = generator->write_scatter_lut();
69 
70  if ( status != TM_SUCCESS ) {
71  std::cerr << "WARNING!!! NetCDF4 Scattering Matrix LUT NOT created" << std::endl;
72  }
73  else {
74  std::cerr << "NetCDF4 Scattering Matrix LUT created" << std::endl;
75  }
76 
77  delete generator;
78 
79  std::cerr << "\nAll NetCDF4 LUTs created. \n" << std::endl;
80 
81  return(status);
82 }
83 
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
void clo_setEnablePositionOptions(int val)
Definition: clo.c:1685
void setHistory(std::string history)
Definition: TmProcess.h:252
const int TM_SUCCESS
Definition: TmConstants.h:47
clo_optionList_t * clo_createList()
Definition: clo.c:532
virtual int compute_dtdb()
Definition: TmProcess.cpp:267
void clo_printUsage(clo_optionList_t *list)
Definition: clo.c:1988
int want_verbose
int main(int argc, char *argv[])
Definition: tmatrix.cpp:31
virtual int initialize()
Definition: TmProcess.cpp:89
string tm_get_history(int argc, char *argv[])
int clo_getBool(clo_optionList_t *list, const char *key)
Definition: clo.c:1375
void tmatrix_init_options(clo_optionList_t *list, const char *softwareVersion)
void tmatrix_read_options(clo_optionList_t *list, int argc, char *argv[])