67 int istatus = DTDB_SUCCESS;
71 string filepath =
path +
"/VIIRS_DARKTARGET_LUT_" +
"version_source" +
".nc";
76 nc_output =
new NcFile(
filepath, NcFile::replace );
78 catch( NcException& e) {
80 cerr <<
"DtLutNetcdf:: Failure creating granule netCDF4 LUT file: " +
filepath +
"." << endl;
84 nc_output->putAtt(
"title",
"VIIRS DARKTARGET LUTs" );
92 if ( istatus != DTDB_SUCCESS ) {
93 cerr <<
"DtLutNetcdf:: Failure reading Gas Correction file " << endl;
97 if ( istatus != DTDB_SUCCESS ) {
98 cerr <<
"DtLutNetcdf:: Failure writing Gas Correction file to netCDF4 LUT file " << endl;
102 if (istatus == DTDB_SUCCESS) {
109 if ( istatus != DTDB_SUCCESS ) {
110 cerr <<
"DtLutNetcdf:: Failure reading land aerosol file " << endl;
114 if ( istatus != DTDB_SUCCESS ) {
115 cerr <<
"DtLutNetcdf:: Failure reading land aerosol file " << endl;
119 if ( istatus != DTDB_SUCCESS ) {
120 cerr <<
"DtLutNetcdf:: Failure reading land aerosol file " << endl;
124 if ( istatus != DTDB_SUCCESS ) {
125 cerr <<
"DtLutNetcdf:: Failure reading land aerosol file " << endl;
129 if ( istatus != DTDB_SUCCESS ) {
130 cerr <<
"DtLutNetcdf:: Failure reading land aerosol map file " << endl;
134 if ( istatus != DTDB_SUCCESS ) {
135 cerr <<
"DtLutNetcdf:: Failure writing land aerosol file to netCDF4 LUT file " << endl;
139 if (istatus == DTDB_SUCCESS) {
146 if ( istatus != DTDB_SUCCESS ) {
147 cerr <<
"DtLutNetcdf:: Failure reading ocean small aerosol file " << endl;
151 if ( istatus != DTDB_SUCCESS ) {
152 cerr <<
"DtLutNetcdf:: Failure reading ocean small aerosol file " << endl;
156 if ( istatus != DTDB_SUCCESS ) {
157 cerr <<
"DtLutNetcdf:: Failure reading ocean small aerosol file " << endl;
161 if ( istatus != DTDB_SUCCESS ) {
162 cerr <<
"DtLutNetcdf:: Failure reading ocean small aerosol file " << endl;
167 if ( istatus != DTDB_SUCCESS ) {
168 cerr <<
"DtLutNetcdf:: Failure reading ocean big aerosol file " << endl;
172 if ( istatus != DTDB_SUCCESS ) {
173 cerr <<
"DtLutNetcdf:: Failure reading ocean big aerosol file " << endl;
177 if ( istatus != DTDB_SUCCESS ) {
178 cerr <<
"DtLutNetcdf:: Failure reading ocean big aerosol file " << endl;
182 if ( istatus != DTDB_SUCCESS ) {
183 cerr <<
"DtLutNetcdf:: Failure reading ocean big aerosol file " << endl;
187 if ( istatus != DTDB_SUCCESS ) {
188 cerr <<
"DtLutNetcdf:: Failure writing ocean big aerosol file to netCDF4 LUT file " << endl;
192 if (istatus == DTDB_SUCCESS) {
199 if ( istatus != DTDB_SUCCESS ) {
200 cerr <<
"DtLutNetcdf:: Failure reading Transmission H20 file " << endl;
205 if ( istatus != DTDB_SUCCESS ) {
206 cerr <<
"DtLutNetcdf:: Failure reading Transmission H20 file " << endl;
211 if ( istatus != DTDB_SUCCESS ) {
212 cerr <<
"DtLutNetcdf:: Failure reading Transmission H20 file " << endl;
217 if ( istatus != DTDB_SUCCESS ) {
218 cerr <<
"DtLutNetcdf:: Failure reading Transmission H20 file " << endl;
223 if ( istatus != DTDB_SUCCESS ) {
224 cerr <<
"DtLutNetcdf:: Failure reading Transmission H20 file " << endl;
229 if ( istatus != DTDB_SUCCESS ) {
230 cerr <<
"DtLutNetcdf:: Failure reading Transmission H20 file " << endl;
253 if ( istatus != DTDB_SUCCESS ) {
254 cerr <<
"DtLutNetcdf:: Failure writing Water Vapor files to netCDF4 LUT file " << endl;
258 if (istatus == DTDB_SUCCESS) {
277 int status = DTDB_SUCCESS;
283 if (
status != DTDB_SUCCESS) {
284 cerr <<
"DtLutNetcdf::read_grib_lut(): " <<
285 "Failure reading GRIB binary ancillary file." << endl;
291 if (
status != DTDB_SUCCESS) {
292 cerr <<
"DtLutNetcdf::read_grib_lut(): " <<
293 "Failure reading GRIB hdf4 ancillary file." << endl;
299 if (
status != DTDB_SUCCESS) {
300 cerr <<
"DtLutNetcdf::read_ozone(): " <<
301 "Failure reading hdf4 ozone ancillary file." << endl;
306 cerr <<
"DtLutNetcdf::read_grib_lut(): " <<
307 "Failure obtaining GRIB ozone input file path." << endl;
313 cerr <<
"DtLutNetcdf::read_grib_lut(): " <<
314 "Failure obtaining GRIB input file path." << endl;
330 int status = DTDB_SUCCESS;
333 bool isFileBigEndian =
false;
334 std::ifstream fin(
filepath.c_str(), std::ios::in | std::ios::binary);
336 fin.read( (
char*) gdas->data, GRIB_ARRAY_SIZE);
337 bool good = fin.good();
340 cerr <<
"DtLutNetcdf::read_grib_bin() Error reading LUT data " <<
INPUT_GRIB << endl;
345 cerr <<
"DtLutNetcdf::read_grib_bin() Error opening LUT file " <<
INPUT_GRIB << endl;
349 for (
int i=0;
i<DATA_BINS;
i++) {
350 for (
int j=0;
j<LAT_BINS;
j++) {
351 for (
int k=0;
k<LON_BINS;
k++) {
357 memcpy(grib_lut->
pwat, gdas->data[50], GRIB_ROW_SIZE);
358 memcpy(grib_lut->
ugrd, gdas->data[51], GRIB_ROW_SIZE);
359 memcpy(grib_lut->
vgrd, gdas->data[52], GRIB_ROW_SIZE);
360 memcpy(grib_lut->
ozone, gdas->data[54], GRIB_ROW_SIZE);
375 int status = DTDB_SUCCESS;
377 int sdfid = SDstart(
filepath.c_str(), DFACC_RDONLY);
378 int vfid = Hopen(
filepath.c_str(), DFACC_RDONLY, 0);
380 int vgroup_ref = Vfind(vfid,
"Geophysical Data");
381 int vgid = Vattach(vfid, vgroup_ref,
"r");
382 int nrefs = Vntagrefs(vgid);
385 Vgettagrefs(vgid, tag,
ref, nrefs);
386 for (
int iRef=0; iRef<nrefs; iRef++) {
387 if ((tag[iRef]!=DFTAG_NDG) && (tag[iRef]!=DFTAG_SD)) {
390 int index = SDreftoindex(sdfid,
ref[iRef]);
391 int sdsid = SDselect(sdfid,
index);
396 int start[2] = {0,0};
398 SDgetinfo(sdsid,
name, &
rank, dims, &numtype, &numatt);
400 if (sname ==
"z_wind") {
402 if (
status != DTDB_SUCCESS) {
403 cerr <<
"DtLutNetcdf::read_grib_hdf(): " <<
404 "Failure reading hdf4 z_wind ancillary data." << endl;
408 if (sname ==
"m_wind") {
410 if (
status != DTDB_SUCCESS) {
411 cerr <<
"DtLutNetcdf::read_grib_hdf(): " <<
412 "Failure reading hdf4 m_wind ancillary data." << endl;
416 if (sname ==
"p_water") {
418 if (
status != DTDB_SUCCESS) {
419 cerr <<
"DtLutNetcdf::read_grib_hdf(): " <<
420 "Failure reading hdf4 p_water ancillary data." << endl;
442 int status = DTDB_SUCCESS;
444 int sdfid = SDstart(
filepath.c_str(), DFACC_RDONLY);
445 int vfid = Hopen(
filepath.c_str(), DFACC_RDONLY, 0);
447 int vgroup_ref = Vfind(vfid,
"Geophysical Data");
448 int vgid = Vattach(vfid, vgroup_ref,
"r");
449 int nrefs = Vntagrefs(vgid);
452 Vgettagrefs(vgid, tag,
ref, nrefs);
453 for (
int iRef=0; iRef<nrefs; iRef++) {
454 if ((tag[iRef]!=DFTAG_NDG) && (tag[iRef]!=DFTAG_SD)) {
457 int index = SDreftoindex(sdfid,
ref[iRef]);
458 int sdsid = SDselect(sdfid,
index);
463 int start[2] = {0,0};
465 SDgetinfo(sdsid,
name, &
rank, dims, &numtype, &numatt);
467 if (sname ==
"ozone") {
469 if (
status != DTDB_SUCCESS) {
470 cerr <<
"DtLutNetcdf::read_ozone(): " <<
471 "Failure reading hdf4 ozone ancillary data." << endl;
493 int status = DTDB_SUCCESS;
496 if(filePath.empty()) {
497 cerr <<
"DtGranule::read_gas_correction_file() Invalid path for gas correction file." << endl;
500 ifstream fin(filePath.c_str());
502 std::cout <<
"DtGranule::read_gas_correction_file() Error opening gas correction file." << endl;
508 while (getline(fin,
line)) {
509 stringstream ss(
line);
530 int status = DTDB_SUCCESS;
534 if(filePath.empty()) {
535 cerr <<
"DtLutNetcdf::read_aerosol_file() Invalid path for aerosol LUT file." << endl;
538 ifstream fin(filePath.c_str());
540 std::cout <<
"DtLutNetcdf::read_aerosol_file() Error opening aerosol LUT file." << endl;
545 for (
int iTab=0; iTab<NLTABLE; iTab++) {
549 stringstream ss(
line);
551 for (
int i=0;
i<NLTHE;
i++) {
558 for (
int i=0;
i<NLPHI;
i++) {
563 for (
int iTau=0; iTau<NLTAU; iTau++) {
568 ss >> dummy >> la_lut->
SSA_NL0[iTab][wnum][iTau];
569 ss >> dummy >> la_lut->
QEXT_NL0[iTab][wnum][iTau];
570 ss >> dummy >> la_lut->
BEXT_NL0[iTab][wnum][iTau];
571 ss >> dummy >> la_lut->
VEXT_NL0[iTab][wnum][iTau];
572 ss >> dummy >> la_lut->
MEXT_NL0[iTab][wnum][iTau];
577 ss >> dummy >> la_lut->
WAV_NL[wnum];
578 ss >> dummy >> la_lut->
OPTH_NL0[iTab][wnum][iTau];
579 ss >> dummy >> la_lut->
ROD[wnum];
580 ss >> dummy >> la_lut->
GOD[wnum];
581 for (
int iThet0=0; iThet0<NLTHET0; iThet0++) {
585 ss >> dummy >> la_lut->
THET0_NL[iThet0];
586 ss >> dummy >> la_lut->
MU0_NL[iThet0];
587 ss >> dummy >> la_lut->
SBAR_NL0[iTab][wnum][iTau][iThet0];
588 ss >> dummy >> la_lut->
Fd_NL0[iTab][wnum][iTau][iThet0];
595 for (
int iThe=0; iThe<NLTHE; iThe++) {
596 ss >> la_lut->
T_NL0[iTab][wnum][iTau][iThet0][iThe];
599 for (
int iThe=0; iThe<NLTHE; iThe++) {
606 for (
int iPhi=0; iPhi<NLPHI; iPhi++) {
607 ss >> la_lut->
INT_NL0[iTab][wnum][iTau][iThet0][iThe][iPhi];
619 for (
int iTab=0; iTab<NLTABLE; iTab++) {
620 for (
int iTau=0; iTau<NLTAU; iTau++) {
621 for (
int iWav=0; iWav<NLUTWAV; iWav++) {
623 la_lut->
QEXT_NL0[iTab][iWav][iTau] /
624 la_lut->
QEXT_NL0[iTab][IW550][iTau];
645 int status = DTDB_SUCCESS;
648 if(filePath.empty()) {
649 cerr <<
"DtLutNetcdf::read_aerosol_map() Invalid path for aerosol LUT file." << endl;
652 ifstream fin(filePath.c_str());
654 std::cout <<
"DtLutNetcdf::read_aerosol_map() Error opening aerosol LUT file." << endl;
662 for (
int iLat=0; iLat<NUM_LATS; iLat++) {
663 for (
int iLon=0; iLon<NUM_LONS-1; iLon++) {
664 getline(fin,
line,
',');
665 stringstream ss(
line);
669 stringstream ss(
line);
687 int status = DTDB_SUCCESS;
690 if(filePath.empty()) {
691 cerr <<
"DtProcessOcean::read_small_aerosol_file() Invalid path for aerosol LUT file." << endl;
694 ifstream fin(filePath.c_str());
696 std::cout <<
"DtProcessOcean::read_small_aerosol_file() Error opening aerosol LUT file." << endl;
703 for (
int iWav=0; iWav<NWAV; iWav++) {
706 stringstream ss(
line);
707 ss >> dummy >> oa_lut->
WAVE[iWav];
717 ss >> dummy >> oa_lut->
TAUAS[iWav][0][0];
722 for (
int il=0; il<2; il++) {
729 for (
int iTho=0; iTho<NTH0; iTho++) {
730 ss >> oa_lut->
THET0[iTho];
741 for (
int il=0; il<2; il++) {
748 for (
int iTho=0; iTho<NTH0; iTho++) {
752 for (
int il=0; il<2; il++) {
759 for (
int iTho=0; iTho<NTH0; iTho++) {
763 for (
int iTho=0; iTho<NTH0; iTho++) {
766 for (
int il=0; il<3; il++) {
772 ss >> dummy >> dummy;
773 for (
int iTh=0; iTh<NTHET; iTh++) {
774 ss >> oa_lut->
THET[iTh];
776 for (
int iPhi=0; iPhi<NPHI; iPhi++) {
778 for (
int il=0; il<3; il++) {
784 ss >> oa_lut->
JPHI[iPhi];
785 for (
int iTh=0; iTh<NTHET; iTh++) {
786 ss >> oa_lut->
REF_RAYALL[iWav][iLut][iTho][iTh][iPhi];
791 for (
int iCase=0; iCase<NUMCASES; iCase++) {
792 for (
int iWav=0; iWav<NWAV; iWav++) {
793 for (
int iTau=1; iTau<NAOT; iTau++) {
796 stringstream ss(
line);
797 ss >> dummy >> oa_lut->
WAVE[iWav];
804 ss >> dummy >> oa_lut->
RGSS[iCase] >> dummy >> oa_lut->
SIGMAS[iCase];
813 ss >> dummy >> dummy >> dummy >> oa_lut->
MOMENTSSMALL[iCase][0][iLut] >>
814 dummy >> dummy >> dummy >> oa_lut->
MOMENTSSMALL[iCase][1][iLut];
818 ss >> dummy >> dummy >> dummy >> oa_lut->
MOMENTSSMALL[iCase][2][iLut] >>
819 dummy >> dummy >> dummy >> oa_lut->
MOMENTSSMALL[iCase][3][iLut];
823 ss >> dummy >> dummy >> dummy >> oa_lut->
ALBEDOSMALL[iWav][iCase][iLut] >>
824 dummy >> dummy >> dummy >> oa_lut->
ASSYMSMALL[iWav][iCase][iLut];
828 ss >> dummy >> oa_lut->
CCNSMALL[iCase][iLut] >>
829 dummy >> dummy >> dummy >> oa_lut->
BACKSCTTSMALL[iWav][iCase][iLut];
833 ss >> dummy >> dummy >> QSCT >>
834 dummy >> dummy >> oa_lut->
EXTSMALL[iWav][iCase][iLut];
844 ss >> dummy >> oa_lut->
TAUAS[iWav][iCase][iTau];
850 for (
int il=0; il<2; il++) {
857 for (
int iTho=0; iTho<NTH0; iTho++) {
858 ss >> oa_lut->
THET0[iTho];
869 for (
int il=0; il<2; il++) {
876 for (
int iTho=0; iTho<NTH0; iTho++) {
880 for (
int il=0; il<2; il++) {
887 for (
int iTho=0; iTho<NTH0; iTho++) {
891 for (
int iTho=0; iTho<NTH0; iTho++) {
894 for (
int il=0; il<3; il++) {
900 ss >> dummy >> dummy;
901 for (
int iTh=0; iTh<NTHET; iTh++) {
902 ss >> oa_lut->
THET[iTh];
904 for (
int iPhi=0; iPhi<NPHI; iPhi++) {
906 for (
int il=0; il<3; il++) {
912 ss >> oa_lut->
JPHI[iPhi];
913 for (
int iTh=0; iTh<NTHET; iTh++) {
914 ss >> oa_lut->
AINTS[iWav][iCase][iTau][iLut][iTho][iTh][iPhi];
920 oa_lut->
TAUAS[iWav][iCase][0]=oa_lut->
TAUAS[iWav][0][0];
921 for (
int iTho=0; iTho<NTH0; iTho++) {
927 for (
int iPhi=0; iPhi<NPHI; iPhi++) {
944 int status = DTDB_SUCCESS;
947 if(filePath.empty()) {
948 cerr <<
"DtProcessOcean::read_ocean_big_aerosol_file() Invalid path for aerosol LUT file." << endl;
951 ifstream fin(filePath.c_str());
953 std::cout <<
"DtProcessOcean::big_ocean_small_aerosol_file() Error opening aerosol LUT file." << endl;
960 for (
int iCase=0; iCase<NUMCASEB; iCase++) {
961 for (
int iWav=0; iWav<NWAV; iWav++) {
962 for (
int iTau=1; iTau<NAOT; iTau++) {
965 stringstream ss(
line);
966 ss >> dummy >> oa_lut->
WAVE[iWav];
972 ss >> dummy >> dummy >> oa_lut->
RGSB[iCase]
973 >> dummy >> oa_lut->
SIGMAB[iCase];
983 ss >> dummy >> dummy >> dummy >> oa_lut->
MOMENTSBIG[iCase][0][iLut] >>
984 dummy >> dummy >> dummy >> oa_lut->
MOMENTSBIG[iCase][1][iLut];
988 ss >> dummy >> dummy >> dummy >> oa_lut->
MOMENTSBIG[iCase][2][iLut] >>
989 dummy >> dummy >> dummy >> oa_lut->
MOMENTSBIG[iCase][3][iLut];
993 ss >> dummy >> dummy >> dummy >> oa_lut->
ALBEDOBIG[iWav][iCase][iLut] >>
994 dummy >> dummy >> dummy >> oa_lut->
ASSYMBIG[iWav][iCase][iLut];
998 ss >> dummy >> dummy >> dummy >> dummy >>
1003 ss >> dummy >> dummy >> QSCT >>
1004 dummy >> dummy >> oa_lut->
EXTBIG[iWav][iCase][iLut];
1014 ss >> dummy >> oa_lut->
TAUAB[iWav][iCase][iTau];
1020 for (
int il=0; il<2; il++) {
1027 for (
int iTho=0; iTho<NTH0; iTho++) {
1028 ss >> oa_lut->
THET0[iTho];
1039 for (
int il=0; il<2; il++) {
1046 for (
int iTho=0; iTho<NTH0; iTho++) {
1047 ss >> oa_lut->
ALBEDO_R_BIG[iWav][iCase][iTau][iLut][iTho];
1050 for (
int il=0; il<2; il++) {
1057 for (
int iTho=0; iTho<NTH0; iTho++) {
1058 ss >> oa_lut->
ALBEDO_T_BIG[iWav][iCase][iTau][iLut][iTho];
1061 for (
int iTho=0; iTho<NTH0; iTho++) {
1064 for (
int il=0; il<3; il++) {
1070 ss >> dummy >> dummy;
1071 for (
int iTh=0; iTh<NTHET; iTh++) {
1072 ss >> oa_lut->
THET[iTh];
1074 for (
int iPhi=0; iPhi<NPHI; iPhi++) {
1076 for (
int il=0; il<3; il++) {
1082 ss >> oa_lut->
JPHI[iPhi];
1083 for (
int iTh=0; iTh<NTHET; iTh++) {
1084 ss >> oa_lut->
AINTB[iWav][iCase][iTau][iLut][iTho][iTh][iPhi];
1106 int status = DTDB_SUCCESS;
1109 if(filePath.empty()) {
1110 cerr <<
"DtLutNetcdf::read_transm_h2o_file() Invalid path for LUT file." << endl;
1113 ifstream fin(filePath.c_str());
1115 std::cout <<
"DtLutNetcdf::read_transm_h2o_file() Error opening LUT file." << endl;
1119 for (
int iR=0; iR<TRANSM_H2O_ROWS; iR++) {
1121 stringstream ss(
line);
1122 for (
int iV=0; iV<TRANSM_H2O_VALS; iV++) {
1140 int status = DTDB_SUCCESS;
1143 if(filePath.empty()) {
1145 "DtLutNetcdf::read_ch19_to_ch2_ratio_file() Invalid path for LUT file." << endl;
1148 ifstream fin(filePath.c_str());
1151 "DtLutNetcdf::read_ch19_to_ch2_ratio_file() Error opening LUT file." << endl;
1155 for (
int iR=0; iR<REFL_CH2_ROWS; iR++) {
1157 stringstream ss(
line);
1158 for (
int iV=0; iV<REFL_CH2_VALS; iV++) {
1176 int status = DTDB_SUCCESS;
1179 if(filePath.empty()) {
1181 "DtLutNetcdf::read_ch2_file() Invalid path for LUT file." << endl;
1184 ifstream fin(filePath.c_str());
1187 "DtLutNetcdf::read_ch2_file() Error opening LUT file." << endl;
1191 for (
int iR=0; iR<REFL_CH2_ROWS; iR++) {
1193 stringstream ss(
line);
1194 for (
int iV=0; iV<REFL_CH2_VALS; iV++) {
1212 int status = DTDB_SUCCESS;
1215 if(filePath.empty()) {
1217 "DtLutNetcdf::read_weight_table_file() Invalid path for LUT file." << endl;
1220 ifstream fin(filePath.c_str());
1223 "DtLutNetcdf::read_weight_table_file() Error opening LUT file." << endl;
1228 for (
int iR=0; iR<TRANSM_H2O_ROWS; iR++) {
1230 stringstream ss(
line);
1231 for (
int iV=0; iV<WEIGHT_VALS; iV++) {
1232 ss >> wv_lut->
WEIGHTS[iR][iV];
1255 vector<NcDim> O3_dims;
1259 vector<NcDim> H2O_dims;
1264 var.putVar( gc_lut->
MBAND );
1267 var.putVar( gc_lut->
VBAND );
1270 var.putVar( gc_lut->
WAVE );
1273 var.putVar( gc_lut->
MOL );
1284 var = lut_grp.addVar(
"O3_COEF", ncFloat, O3_dims );
1285 var.putVar( gc_lut->
O3_COEF );
1287 var = lut_grp.addVar(
"H2O_COEF", ncFloat, H2O_dims );
1290 return DTDB_SUCCESS;
1317 vector<NcDim> map_dims;
1322 vector<NcDim> tab3_dims;
1327 vector<NcDim> tab4_dims;
1333 vector<NcDim> tab5_dims;
1340 vector<NcDim> tab6_dims;
1348 vector<NcDim> siz3_dims;
1353 vector<NcDim> siz4_dims;
1359 vector<NcDim> siz5_dims;
1366 vector<NcDim> siz6_dims;
1374 NcVar var = lut_grp.addVar(
"AEROSOL_ALL", ncInt, map_dims );
1378 var.putVar( la_lut->
PHI_NL );
1381 var.putVar( la_lut->
THE_NL );
1387 var.putVar( la_lut->
MU0_NL );
1390 var.putVar( la_lut->
WAV_NL );
1392 var = lut_grp.addVar(
"OPTH_NL0", ncFloat, tab3_dims );
1395 var = lut_grp.addVar(
"MASSCOEF_NL0", ncFloat, tab3_dims );
1398 var = lut_grp.addVar(
"EXTNORM_NL0", ncFloat, tab3_dims );
1401 var = lut_grp.addVar(
"SSA_NL0", ncFloat, tab3_dims );
1402 var.putVar( la_lut->
SSA_NL0 );
1404 var = lut_grp.addVar(
"QEXT_NL0", ncFloat, tab3_dims );
1407 var = lut_grp.addVar(
"BEXT_NL0", ncFloat, tab3_dims );
1410 var = lut_grp.addVar(
"VEXT_NL0", ncFloat, tab3_dims );
1413 var = lut_grp.addVar(
"MEXT_NL0", ncFloat, tab3_dims );
1416 var = lut_grp.addVar(
"SBAR_NL0", ncFloat, tab4_dims );
1419 var = lut_grp.addVar(
"INT_NL0", ncFloat, tab6_dims );
1420 var.putVar( la_lut->
INT_NL0 );
1422 var = lut_grp.addVar(
"Fd_NL0", ncFloat, tab4_dims );
1423 var.putVar( la_lut->
Fd_NL0 );
1425 var = lut_grp.addVar(
"T_NL0", ncFloat, tab5_dims );
1426 var.putVar( la_lut->
T_NL0 );
1428 var = lut_grp.addVar(
"OMEGA0", ncFloat, tab3_dims );
1429 var.putVar( la_lut->
OMEGA0 );
1432 var.putVar( la_lut->
ROD );
1435 var.putVar( la_lut->
GOD );
1437 return DTDB_SUCCESS;
1462 vector<NcDim> moments_dims;
1467 vector<NcDim> tab2s_dims;
1471 vector<NcDim> tab3s_dims;
1476 vector<NcDim> tau3s_dims;
1481 vector<NcDim> tab5s_dims;
1488 vector<NcDim> tab7s_dims;
1498 var.putVar( oa_lut->
JPHI );
1501 var.putVar( oa_lut->
PHC );
1504 var.putVar( oa_lut->
THET );
1507 var.putVar( oa_lut->
THET0 );
1510 var.putVar( oa_lut->
WAVE );
1512 var = lut_grp.addVar(
"EXTSMALL", ncFloat, tab3s_dims );
1516 var.putVar( oa_lut->
RGSS );
1519 var.putVar( oa_lut->
SIGMAS );
1521 var = lut_grp.addVar(
"MOMENTSSMALL", ncFloat, moments_dims );
1524 var = lut_grp.addVar(
"CCNSMALL", ncFloat, tab2s_dims );
1527 var = lut_grp.addVar(
"BACKSCTTSMALL", ncFloat, tab3s_dims );
1530 var = lut_grp.addVar(
"ASSYMSMALL", ncFloat, tab3s_dims );
1533 var = lut_grp.addVar(
"ALBEDOSMALL", ncFloat, tab3s_dims );
1536 var = lut_grp.addVar(
"ALBEDO_R_SMALL", ncFloat, tab5s_dims );
1539 var = lut_grp.addVar(
"ALBEDO_T_SMALL", ncFloat, tab5s_dims );
1542 var = lut_grp.addVar(
"AINTS", ncFloat, tab7s_dims );
1543 var.putVar( oa_lut->
AINTS );
1545 var = lut_grp.addVar(
"TAUAS", ncFloat, tau3s_dims );
1546 var.putVar( oa_lut->
TAUAS );
1551 vector<NcDim> momentb_dims;
1556 vector<NcDim> tab2b_dims;
1560 vector<NcDim> tab3b_dims;
1565 vector<NcDim> tau3b_dims;
1570 vector<NcDim> tab5b_dims;
1577 vector<NcDim> tab7b_dims;
1586 vector<NcDim> alb2_dims;
1590 vector<NcDim> ray5_dims;
1597 var = lut_grp.addVar(
"EXTBIG", ncFloat, tab3b_dims );
1598 var.putVar( oa_lut->
EXTBIG );
1601 var.putVar( oa_lut->
RGSB );
1604 var.putVar( oa_lut->
SIGMAB );
1606 var = lut_grp.addVar(
"MOMENTSBIG", ncFloat, momentb_dims );
1609 var = lut_grp.addVar(
"BACKSCTTBIG", ncFloat, tab3b_dims );
1612 var = lut_grp.addVar(
"ASSYMBIG", ncFloat, tab3b_dims );
1615 var = lut_grp.addVar(
"ALBEDOBIG", ncFloat, tab3b_dims );
1618 var = lut_grp.addVar(
"ALBEDO_R_BIG", ncFloat, tab5b_dims );
1621 var = lut_grp.addVar(
"ALBEDO_T_BIG", ncFloat, tab5b_dims );
1624 var = lut_grp.addVar(
"AINTB", ncFloat, tab7b_dims );
1625 var.putVar( oa_lut->
AINTB );
1627 var = lut_grp.addVar(
"TAUAB", ncFloat, tau3b_dims );
1628 var.putVar( oa_lut->
TAUAB );
1633 var = lut_grp.addVar(
"ALBEDO_R_RAY", ncFloat, alb2_dims );
1636 var = lut_grp.addVar(
"ALBEDO_T_RAY", ncFloat, alb2_dims );
1639 var = lut_grp.addVar(
"REF_RAYALL", ncFloat, ray5_dims );
1642 return DTDB_SUCCESS;
1664 vector<NcDim> H2O_dims;
1677 NcVar var = lut_grp.addVar(
"TRANSM_H20", ncFloat, H2O_dims );
1689 return DTDB_SUCCESS;
1701 int status = DTDB_SUCCESS;
1709 nc_input =
new NcFile(
filepath, NcFile::read );
1711 catch( NcException& e) {
1713 cerr <<
"DtLutNetcdf:: Failure opening netcdf LUT file: " +
filepath << endl;
1718 NcVar var = lut_grp.getVar (
"MBAND" );
1719 var.getVar( gc_lut.
MBAND );
1721 var = lut_grp.getVar (
"VBAND" );
1722 var.getVar( gc_lut.
VBAND );
1724 var = lut_grp.getVar (
"WAVE" );
1725 var.getVar( gc_lut.
WAVE );
1727 var = lut_grp.getVar (
"MOL" );
1728 var.getVar( gc_lut.
MOL );
1730 var = lut_grp.getVar (
"OPT_O3_CLIM" );
1733 var = lut_grp.getVar (
"OPT_H2O_CLIM" );
1736 var = lut_grp.getVar (
"OPT_CO2_CLIM" );
1739 var = lut_grp.getVar (
"O3_COEF" );
1742 var = lut_grp.getVar (
"H2O_COEF" );
1759 int status = DTDB_SUCCESS;
1767 nc_input =
new NcFile(
filepath, NcFile::read );
1769 catch( NcException& e) {
1771 cerr <<
"DtLutNetcdf:: Failure opening netcdf LUT file: " +
filepath << endl;
1776 NcVar var = lut_grp.getVar(
"AEROSOL_ALL");
1779 var = lut_grp.getVar(
"PHI_NL" );
1780 var.getVar( la_lut.
PHI_NL );
1782 var = lut_grp.getVar(
"THE_NL" );
1783 var.getVar( la_lut.
THE_NL );
1785 var = lut_grp.getVar(
"THET0_NL" );
1788 var = lut_grp.getVar(
"MU0_NL" );
1789 var.getVar( la_lut.
MU0_NL );
1791 var = lut_grp.getVar(
"WAV_NL" );
1792 var.getVar( la_lut.
WAV_NL );
1794 var = lut_grp.getVar(
"OPTH_NL0" );
1797 var = lut_grp.getVar(
"MASSCOEF_NL0" );
1800 var = lut_grp.getVar(
"EXTNORM_NL0" );
1803 var = lut_grp.getVar(
"SSA_NL0" );
1806 var = lut_grp.getVar(
"QEXT_NL0" );
1809 var = lut_grp.getVar(
"BEXT_NL0" );
1812 var = lut_grp.getVar(
"VEXT_NL0" );
1815 var = lut_grp.getVar(
"MEXT_NL0" );
1818 var = lut_grp.getVar(
"SBAR_NL0" );
1821 var = lut_grp.getVar(
"INT_NL0" );
1824 var = lut_grp.getVar(
"Fd_NL0" );
1825 var.getVar( la_lut.
Fd_NL0 );
1827 var = lut_grp.getVar(
"T_NL0" );
1828 var.getVar( la_lut.
T_NL0 );
1830 var = lut_grp.getVar(
"OMEGA0" );
1831 var.getVar( la_lut.
OMEGA0 );
1833 var = lut_grp.getVar(
"ROD" );
1834 var.getVar( la_lut.
ROD );
1836 var = lut_grp.getVar(
"GOD" );
1837 var.getVar( la_lut.
GOD );
1854 int status = DTDB_SUCCESS;
1862 nc_input =
new NcFile(
filepath, NcFile::read );
1864 catch( NcException& e) {
1866 cerr <<
"DtLutNetcdf:: Failure opening netcdf LUT file: " +
filepath << endl;
1871 NcVar var = lut_grp.getVar (
"JPHI" );
1872 var.getVar( oa_lut.
JPHI );
1874 var = lut_grp.getVar (
"PHC" );
1875 var.getVar( oa_lut.
PHC );
1877 var = lut_grp.getVar (
"THET" );
1878 var.getVar( oa_lut.
THET );
1880 var = lut_grp.getVar (
"THET0" );
1881 var.getVar( oa_lut.
THET0 );
1883 var = lut_grp.getVar (
"WAVE" );
1884 var.getVar( oa_lut.
WAVE );
1886 var = lut_grp.getVar (
"EXTSMALL" );
1889 var = lut_grp.getVar (
"RGSS" );
1890 var.getVar( oa_lut.
RGSS );
1892 var = lut_grp.getVar(
"SIGMAS" );
1893 var.getVar( oa_lut.
SIGMAS );
1895 var = lut_grp.getVar(
"MOMENTSSMALL" );
1898 var = lut_grp.getVar(
"CCNSMALL" );
1901 var = lut_grp.getVar(
"BACKSCTTSMALL" );
1904 var = lut_grp.getVar(
"ASSYMSMALL" );
1907 var = lut_grp.getVar(
"ALBEDOSMALL" );
1910 var = lut_grp.getVar(
"ALBEDO_R_SMALL" );
1913 var = lut_grp.getVar(
"ALBEDO_T_SMALL" );
1916 var = lut_grp.getVar(
"AINTS" );
1917 var.getVar( oa_lut.
AINTS );
1919 var = lut_grp.getVar(
"TAUAS" );
1920 var.getVar( oa_lut.
TAUAS );
1922 var = lut_grp.getVar(
"EFFRADSMALL" );
1925 var = lut_grp.getVar(
"EXTBIG" );
1926 var.getVar( oa_lut.
EXTBIG );
1928 var = lut_grp.getVar(
"RGSB" );
1929 var.getVar( oa_lut.
RGSB );
1931 var = lut_grp.getVar(
"SIGMAB" );
1932 var.getVar( oa_lut.
SIGMAB );
1934 var = lut_grp.getVar(
"MOMENTSBIG" );
1937 var = lut_grp.getVar(
"BACKSCTTBIG" );
1940 var = lut_grp.getVar(
"ASSYMBIG" );
1943 var = lut_grp.getVar(
"ALBEDOBIG" );
1946 var = lut_grp.getVar(
"ALBEDO_R_BIG" );
1949 var = lut_grp.getVar(
"ALBEDO_T_BIG" );
1952 var = lut_grp.getVar(
"AINTB" );
1953 var.getVar( oa_lut.
AINTB );
1955 var = lut_grp.getVar(
"TAUAB" );
1956 var.getVar( oa_lut.
TAUAB );
1958 var = lut_grp.getVar(
"EFFRADBIG" );
1961 var = lut_grp.getVar(
"ALBEDO_R_RAY" );
1964 var = lut_grp.getVar(
"ALBEDO_T_RAY" );
1967 var = lut_grp.getVar(
"REF_RAYALL" );
1984 int status = DTDB_SUCCESS;
1992 nc_input =
new NcFile(
filepath, NcFile::read );
1994 catch( NcException& e) {
1996 cerr <<
"DtLutNetcdf:: Failure opening netcdf LUT file: " +
filepath << endl;
2001 NcVar var = lut_grp.getVar (
"TRANSM_H20" );
2031 nc_output->putAtt(
"license",
license_);
2040 nc_output->putAtt(
"project",
project_);
2047 nc_output->putAtt(
"history",
history_);
2052 if (!pge_name_.empty()) {
2053 nc_output->putAtt(
"PGE_Name",pge_name_);
2056 if (!versionid_.empty()) {
2057 nc_output->putAtt(
"VersionId",versionid_);
2063 return DTDB_SUCCESS;
2076 unsigned short checkValue = 0xAABB;
2077 unsigned char* bytePtr =
reinterpret_cast<unsigned char*
>(&checkValue);
2079 if (bytePtr[0] == 0xAA)