Skip to content

Commit

Permalink
v2.01
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Simons committed Jul 2, 2019
1 parent a4c9b1d commit f5ae1c0
Show file tree
Hide file tree
Showing 45 changed files with 956 additions and 1,158 deletions.
13 changes: 7 additions & 6 deletions WEB-INF/classes/com/cohort/util/File2.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,13 @@ public static int deleteIfOld(String dir, long time,
}
int nDeleted = files.length - nDir + nRemain;
if (nDir != 0 || nDeleted != 0 || nRemain != 0)
String2.log("File2.deleteIfOld(" + dir +
(time == Long.MAX_VALUE? "" :
", " + Calendar2.safeEpochSecondsToIsoStringTZ(time / 1000.0, "" + time)) +
") nDir=" + nDir +
" nDeleted=" + nDeleted +
" nRemain=" + (nRemain < 0? String2.ERROR : nRemain));
String2.log("File2.deleteIfOld(" +
String2.left(dir +
(time == Long.MAX_VALUE? "" :
", " + Calendar2.safeEpochSecondsToIsoStringTZ(time / 1000.0, "" + time)), 50) +
") nDir=" + String2.right("" + nDir, 2) +
" nDeleted=" + String2.right("" + nDeleted, 4) +
" nRemain=" + String2.right(nRemain < 0? String2.ERROR : "" + nRemain, 2));
return nRemain;
} catch (Exception e3) {
String2.log(MustBe.throwable(String2.ERROR + " in File2.deleteIfOld(" +
Expand Down
35 changes: 20 additions & 15 deletions WEB-INF/classes/gov/noaa/pfel/coastwatch/TestAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static void main(String args[]) throws Throwable {
// Table.testReadMultidimNc();
// Table.testReadNcCFMATimeSeriesReversed(false); //readMultidimNc
// {
// String tFileName = "C:/data/gtspp/bestNcZip/gtspp_31645513_xb_111.nc";
// String tFileName = "C:/temp/gtspp_34775909_ba_111.nc";
// String2.log(NcHelper.ncdump(tFileName, "-h"));
// Table table = new Table();
// table.readMultidimNc(tFileName, null, null, null, true, true, null, null, null);
Expand Down Expand Up @@ -837,12 +837,12 @@ public static void main(String args[]) throws Throwable {
// "", // tSortFilesBySourceNames,
// "", "", "", "", 0, "", null)); //info, institution, summary, title, standardizeWhat=0, cacheFromUrl, atts


// Sync with various remote directories
// Table table = FileVisitorDNLS.sync(
// "http://flux.aos.wisc.edu/data/aoss/ghg/DataLog_User_Sync/2016/07/",
// "/u00/data/points/lterWiscAoss/2016/07/",
// ".*\\.dat", true, ".*", true); //doIt
// FileVisitorDNLS.sync(
// "https://www.ngdc.noaa.gov/thredds/catalog/dart_bpr/processed", //omit /catalog.html
// "/u00/data/points/nceiDartBpr/",
// ".*\\.nc", true, ".*", false).dataToString(); //recursive, doAll (or just 1)
// String2.log(NcHelper.ncdump("/u00/data/points/nceiDartBpr/ed/21413/21413_20061126to20080422_qc.nc", "-h"));

// Do this periodically to update the local cache of InPort xml files
// Last done: 2017-08-09, now /inport-xml/
Expand Down Expand Up @@ -1071,9 +1071,9 @@ public static void main(String args[]) throws Throwable {


// String2.log(NcHelper.ncdump("/u00/data/points/caricoos/181p1_historic.nc", "-v metaStationLatitude;metaStationLongitude"));
/* s = EDDTableFromMultidimNcFiles.generateDatasetsXml(
//EDStatic.unitTestDataDir + "nc", "GL_.*\\.nc", "",
"/data/joe/", "20171208.syslog\\.nc", "",
/*
s = EDDTableFromMultidimNcFiles.generateDatasetsXml(
"/u00/data/points/nceiDartBpr", ".*\\.nc", "",
"", //dims
1440,
"", "", "", "", //pre, post, extract, varname
Expand All @@ -1082,10 +1082,10 @@ public static void main(String args[]) throws Throwable {
"", "", "", "",
0, //standardizeWhat 1+2(numericTime)+256(catch numeric mv)+4096(units)
"", //treatDimensionsAs
"", //cacheFromUrl
"https://www.ngdc.noaa.gov/thredds/catalog/dart_bpr/processed", //cacheFromUrl /catalog.html
null) + "\n";
String2.setClipboardString(s); String2.log(s);
/* */
// */
// Table.debugMode = true; DasDds.main(new String[]{"joe", "-verbose"});
// EDDTableFromMultidimNcFiles.testBasic();
// EDDTableFromMultidimNcFiles.testCharAsString(true);
Expand Down Expand Up @@ -1225,6 +1225,7 @@ public static void main(String args[]) throws Throwable {
EDDGridAggregateExistingDimension.testGenerateDatasetsXml(); //after EDDGridFromDap
EDDGridFromAudioFiles.testGenerateDatasetsXml();
EDDGridFromAudioFiles.testGenerateDatasetsXml2();
EDDGridFromDap.testGenerateDatasetsXml(); //often not accessible
EDDGridFromDap.testGenerateDatasetsXml2();
//EDDGridFromDap.testGenerateDatasetsXml3(); //source is gone
Expand All @@ -1236,6 +1237,8 @@ public static void main(String args[]) throws Throwable {
EDDGridFromNcFiles.testGenerateDatasetsXml2();
EDDGridFromNcFiles.testGenerateDatasetsXml3();
EDDGridFromNcFiles.testGenerateDatasetsXmlAwsS3(); //slow!
EDDGridFromNcFiles.testGenerateDatasetsXmlCopy();
EDDGridFromNcFiles.testGenerateDatasetsXmlWithRemoteThreddsFiles();
EDDGridFromNcFilesUnpacked.testGenerateDatasetsXml();
EDDGridLonPM180.testGenerateDatasetsXmlFromErddapCatalog();
Expand Down Expand Up @@ -1264,11 +1267,13 @@ public static void main(String args[]) throws Throwable {
EDDTableFromJsonlCSVFiles.testGenerateDatasetsXml();
EDDTableFromMultidimNcFiles.testGenerateDatasetsXml();
EDDTableFromMultidimNcFiles.testGenerateDatasetsXmlSeaDataNet();
EDDTableFromMultidimNcFiles.testGenerateDatasetsXmlDimensions();
EDDTableFromNcCFFiles.testGenerateDatasetsXml();
EDDTableFromNcCFFiles.testGenerateDatasetsXml2();
EDDTableFromNccsvFiles.testGenerateDatasetsXml();
EDDTableFromNcFiles.testGenerateDatasetsXml();
EDDTableFromNcFiles.testGenerateDatasetsXml2();
EDDTableFromNcFiles.testCopyFilesGenerateDatasetsXml();
//EDDTableFromNWISDV.testGenerateDatasetsXml(); //inactive
EDDTableFromOBIS.testGenerateDatasetsXml();
EDDTableFromSOS.testGenerateDatasetsXml(true); //useCachedInfo);
Expand All @@ -1280,9 +1285,9 @@ public static void main(String args[]) throws Throwable {

//2018-09-13 https: works in browser by not yet in Java
// String2.log(EDDTableFromThreddsFiles.generateDatasetsXml(
// "http://tds.coaps.fsu.edu/thredds/catalog/samos/data/research/WTEP/2012/catalog.xml",
// "https://tds.coaps.fsu.edu/thredds/catalog/samos/data/research/WTEP/2012/catalog.xml",
// "WTEP_20120215.*",
// "http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/quick/WTEP/2012/WTEP_20120215v10002.nc",
// "https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/quick/WTEP/2012/WTEP_20120215v10002.nc",
// "https://data.nodc.noaa.gov/thredds/dodsC/testdata/netCDFTemplateExamples/timeSeries/catalog.xml",
// "BodegaMarineLabBuoyCombined.nc",
// "https://data.nodc.noaa.gov/thredds/dodsC/testdata/netCDFTemplateExamples/timeSeries/BodegaMarineLabBuoyCombined.nc",
Expand Down Expand Up @@ -1479,7 +1484,7 @@ public static void main(String args[]) throws Throwable {

// set jplG1SST flags !!!!!
//SSR.touchUrl(
// "http://upwell.pfeg.noaa.gov/erddap/setDatasetFlag.txt?datasetID=jplG1SST&flagKey=1879976078",
// "https://upwell.pfeg.noaa.gov/erddap/setDatasetFlag.txt?datasetID=jplG1SST&flagKey=1879976078",
// 60000);

//while email systems are down...
Expand All @@ -1496,7 +1501,7 @@ public static void main(String args[]) throws Throwable {
// Projects.erddapTunnelTest();
// Projects.makeNetcheckErddapTests( //results are on clipboard
// "https://coastwatch.pfeg.noaa.gov/erddap/");
// "http://upwell.pfeg.noaa.gov/erddap/");
// "https://upwell.pfeg.noaa.gov/erddap/");
// "http://75.101.155.155/erddap/");
// :8081 led to out-of-date oceanwatch dataset!! but now disabled
// Projects.testOpendapAvailability("https://oceanwatch.pfeg.noaa.gov/thredds/dodsC/satellite/CM/usfc/hday",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,8 @@ public static void testFindAllScalarOrMultiDimVars() throws Throwable {


//test of DArray DAP dataset
//2018-09-13 https: works in browser by not yet in Java
url = "http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
//2018-09-13 https: works in browser by not yet in Java. 2019-06-28 https works in Java
url = "https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
String2.log("\n*** test of DArray DAP dataset\n" + url);
try {
dConnect = new DConnect(url, true, 1, 1);
Expand Down Expand Up @@ -2134,8 +2134,8 @@ public static void dapToNc(String dapUrl, String varNames[], String projection,

/** This tests getting attibutes, notably the DODS_strlen attribute. */
public static void testGetAttributes() throws Throwable {
//https almost works, but java objects to invalid certificate
String url = "http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
//https almost works, but java objects to invalid certificate. 2019-06 https works in Java
String url = "https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
String2.log("\n* OpendapHelper.testGetAttributes\n" + url);
try {
DConnect dConnect = new DConnect(url, true, 1, 1);
Expand Down Expand Up @@ -2189,7 +2189,7 @@ public static void testDapToNcDArray() throws Throwable {
String today = Calendar2.getCurrentISODateTimeStringLocalTZ().substring(0, 10);

fileName = SSR.getTempDirectory() + "testDapToNcDArray.nc";
String dArrayUrl = "http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
String dArrayUrl = "https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
try {
dapToNc(dArrayUrl,
//note that request for zztop is ignored (because not found)
Expand Down Expand Up @@ -2328,7 +2328,7 @@ public static void testDapToNcDArray() throws Throwable {
try {
String2.log("\n* testDapToNcDArray Subset");
fileName = SSR.getTempDirectory() + "testDapToNcDArraySubset.nc";
String dArraySubsetUrl = "http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
String dArraySubsetUrl = "https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc";
dapToNc(dArraySubsetUrl,
new String[] {"zztop", "time", "lat", "lon", "PL_HD", "flag"}, "[0:10:99]", //projection
fileName, false); //jplMode
Expand Down Expand Up @@ -2418,7 +2418,7 @@ public static void testDapToNcDArray() throws Throwable {
" {75.53, 75.72, 76.65, 76.43, 76.58, 63.34, 266.49, 246.52, 220.81, 242.11}\n" +
"}\n";
/* from
http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc.ascii?time[0:10:99],lat[0:10:99],lon[0:10:99],PL_HD[0:10:99]
https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc.ascii?time[0:10:99],lat[0:10:99],lon[0:10:99],PL_HD[0:10:99]
time[10] 16870896, 16870906, 16870916, 16870926, 16870936, 16870946, 16870956, 16870966, 16870976, 16870986
lat[10] 44.63, 44.63, 44.63, 44.63, 44.63, 44.63, 44.63, 44.63, 44.62, 44.61
lon[10] 235.95, 235.95, 235.95, 235.95, 235.95, 235.95, 235.95, 235.95, 235.94, 235.91
Expand Down Expand Up @@ -2463,7 +2463,7 @@ public static void testDapToNcDArray() throws Throwable {
results = t.toString();
expected =
"java.lang.RuntimeException: ERROR in OpendapHelper.dapToNc\n" +
" url=http://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc\n" +
" url=https://tds.coaps.fsu.edu/thredds/dodsC/samos/data/research/WTEP/2012/WTEP_20120128v30001.nc\n" +
" varNames=zztop,time,lat,lon,PL_HD,history projection=null\n" +
" file=C:/programs/_tomcat/webapps/cwexperimental/WEB-INF/temp/testDapToNcDArraySubset.nc\n" +
"var=history has different dimensions than previous vars.";
Expand Down
Loading

0 comments on commit f5ae1c0

Please sign in to comment.