Skip to content

Commit

Permalink
v2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Simons committed Feb 16, 2022
1 parent 03644ad commit 3a9fee1
Show file tree
Hide file tree
Showing 21 changed files with 209 additions and 98 deletions.
13 changes: 5 additions & 8 deletions WEB-INF/classes/gov/noaa/pfel/coastwatch/TestAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ public static void main(String args[]) throws Throwable {
// 1) run:
// EDD.verbose = true;
// EDDGridFromDap.testUAFSubThreddsCatalog(0); //0= entire official clean catalog ~16hrs
// 2) Results file is /data/_erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml
// Log file is /data/_erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml.log.txt
// 2) Results file is /erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml
// Log file is /erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml.log.txt
// 3) Look at problems, creator_, title, .... Make improvements.
// from /data/_erddapBPD/logs:
// from /erddapBPD/logs:
// grep "SimpleException: Error while getting DAS from"
// grep "unable to get axis"
// grep "unsorted axis"
Expand Down Expand Up @@ -375,7 +375,7 @@ public static void main(String args[]) throws Throwable {

/*
//This downloads AWS S3 directory into to a jsonlCSV file
//The lower level copy (written to file as it is downloaded) is in _erddapBPD/datasets/_GenerateDatasetsXml
//The lower level copy (written to file as it is downloaded) is in erddapBPD/datasets/_GenerateDatasetsXml
FileVisitorDNLS.verbose=true;
FileVisitorDNLS.reallyVerbose=true;
FileVisitorDNLS.debugMode=true;
Expand All @@ -393,7 +393,7 @@ public static void main(String args[]) throws Throwable {
String2.log(File2.directReadFrom88591File(outName));
String2.log("The Results are in " + outName + "\n" +
"The lower level (partial?) copy (written to file as it is downloaded)\n" +
"is in _erddapBPD/datasets/_GenerateDatasetsXml .");
"is in erddapBPD/datasets/_GenerateDatasetsXml .");
/* */

// Do this periodically to update the local cache of InPort xml files
Expand Down Expand Up @@ -1090,9 +1090,6 @@ public static void main(String args[]) throws Throwable {
boolean interactive = false;
boolean doSlowTestsToo = false;

//TestSSR.testAwsTransferManager();
//DasDds.main(new String[]{"nceiPH53sstn1day", "-verbose"});

//EDDGridFromNcFiles.testNcml();

/* for releases, this line should have open/close comment */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static String decodeNcDump(String s) {
int sLength = s.length();

//remove dir name from first line (since this is sometimes sent to ERDDAP users)
//"netcdf /data/_erddapBPD/cache/_test/EDDGridFromDap_Axis.nc {\n" +
//"netcdf /erddapBPD/cache/_test/EDDGridFromDap_Axis.nc {\n" +
int po = 0;
int brPo = s.indexOf(" {");
if (brPo >= 0) {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9810,7 +9810,7 @@ public static void testReadNDNc() throws Exception {
Test.ensureEqual(results, expected, "results=\n" + results);

//test String vars
fiName = "c:/data/_erddapBPD/copy/cPostDet3/BARBARAx20BLOCK/LAMNAx20DITROPIS/Nx2fA/52038_A69-1303_1059305.nc";
fiName = "c:/erddapBPD/copy/cPostDet3/BARBARAx20BLOCK/LAMNAx20DITROPIS/Nx2fA/52038_A69-1303_1059305.nc";
table.readNDNc(fiName, null, 0, //standardizeWhat=0
null, 0, 0);
results = table.dataToString(4);
Expand Down
38 changes: 19 additions & 19 deletions WEB-INF/classes/gov/noaa/pfel/erddap/Erddap.java
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
//convert the info into pseudo datasets.xml
String content =
"Data Provider Form - Part 1\n" + //important! Bob's erd.data gmail filter looks for 'Data Provider Form'
" from " + fromInfo + "\n" +
" from " + XML.encodeAsHTML(fromInfo) + "\n" +
" ipAddress=" + ipAddress + "\n" +
"\n" +
"griddedOption=" + griddedOptions[griddedOption] + "\n" +
Expand Down Expand Up @@ -2318,7 +2318,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,

//hidden fields
writer.write(
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
widgets.hidden("timestamp", tTimestamp) +
"\n");

//begin text
Expand All @@ -2344,7 +2344,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
30, 50, tYourName, ""))
.replace("&widgetEmailAddress;", widgets.textField("emailAddress", "", //tooltip
30, 50, tEmailAddress, ""))
.replace("&tTimestamp;", tTimestamp);
.replace("&tTimestamp;", XML.encodeAsHTML(tTimestamp));
writer.write(dataProviderContactInfo
/*
"<h2>Your Contact Information</h2>\n" +
Expand All @@ -2356,7 +2356,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
" <br>What is your email address? " +
widgets.textField("emailAddress", "", //tooltip
30, 50, tEmailAddress, "") +
" <br>This dataset submission's timestamp is " + tTimestamp + ".\n" +
" <br>This dataset submission's timestamp is " + XML.encodeAsHTML(tTimestamp) + ".\n" +
"\n"
*/);
String dataProviderData = EDStatic.dataProviderDataAr[language]
Expand Down Expand Up @@ -2594,7 +2594,7 @@ public void doDataProviderForm2(int language, HttpServletRequest request,
tKeywords.sortIgnoreCase();
String content =
"Data Provider Form - Part 2\n" + //important! Bob's erd.data gmail filter looks for this
" from " + fromInfo + "\n" +
" from " + XML.encodeAsHTML(fromInfo) + "\n" +
" ipAddress=" + ipAddress + "\n" +
"\n" +
" <addAttributes>\n" +
Expand Down Expand Up @@ -2671,9 +2671,9 @@ public void doDataProviderForm2(int language, HttpServletRequest request,

//hidden fields
writer.write(
widgets.hidden("yourName", XML.encodeAsHTML(tYourName)) +
widgets.hidden("emailAddress", XML.encodeAsHTML(tEmailAddress)) +
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
widgets.hidden("yourName", tYourName) +
widgets.hidden("emailAddress", tEmailAddress) +
widgets.hidden("timestamp", tTimestamp) +
"\n");

//begin text
Expand Down Expand Up @@ -3066,7 +3066,7 @@ public void doDataProviderForm3(int language, HttpServletRequest request,
StringBuilder content = new StringBuilder();
content.append(
"Data Provider Form - Part 3\n" + //important! Bob's erd.data gmail filter looks for this
" from " + fromInfo + "\n" +
" from " + XML.encodeAsHTML(fromInfo) + "\n" +
" ipAddress=" + ipAddress + "\n" +
"\n" +
"groupOf10=" + groupOptions[tGroup] + "\n" +
Expand Down Expand Up @@ -3138,9 +3138,9 @@ public void doDataProviderForm3(int language, HttpServletRequest request,

//hidden fields
writer.write(
widgets.hidden("yourName", XML.encodeAsHTML(tYourName)) +
widgets.hidden("emailAddress", XML.encodeAsHTML(tEmailAddress)) +
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
widgets.hidden("yourName", tYourName) +
widgets.hidden("emailAddress", tEmailAddress) +
widgets.hidden("timestamp", tTimestamp) +
"\n");

//begin text
Expand Down Expand Up @@ -3383,7 +3383,7 @@ public void doDataProviderForm4(int language, HttpServletRequest request,
//convert the info into pseudo datasets.xml
String content =
"Data Provider Form - Part 4\n" + //important! Bob's erd.data gmail filter looks for this
" from " + fromInfo + "\n" +
" from " + XML.encodeAsHTML(fromInfo) + "\n" +
" ipAddress=" + ipAddress + "\n" +
"\n" +
"Other comments:\n" +
Expand Down Expand Up @@ -3432,9 +3432,9 @@ public void doDataProviderForm4(int language, HttpServletRequest request,

//hidden fields
writer.write(
widgets.hidden("yourName", XML.encodeAsHTML(tYourName)) +
widgets.hidden("emailAddress", XML.encodeAsHTML(tEmailAddress)) +
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
widgets.hidden("yourName", tYourName) +
widgets.hidden("emailAddress", tEmailAddress) +
widgets.hidden("timestamp", tTimestamp) +
"\n");

//begin text
Expand Down Expand Up @@ -3532,10 +3532,10 @@ public void doDataProviderFormDone(int language, HttpServletRequest request,

//begin text
writer.write(EDStatic.dpf_congratulationAr[language]
.replace("&tTimestamp;", tTimestamp)
.replace("&tTimestamp;", XML.encodeAsHTML(tTimestamp))
.replaceAll("&tErddapUrl;", tErddapUrl)
.replace("&tYourName;", SSR.minimalPercentEncode(tYourName))
.replace("&tEmailAddress;", SSR.minimalPercentEncode(tEmailAddress))
.replace("&tYourName;", XML.encodeAsHTML(tYourName))
.replace("&tEmailAddress;", XML.encodeAsHTML(tEmailAddress))

// "<h2>You're done! Congratulations! Thank you!</h2>\n" +
// "The ERDDAP administrator will email you soon to figure out the best way transfer\n" +
Expand Down
12 changes: 6 additions & 6 deletions WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -7081,12 +7081,12 @@ private double validateGreaterThanThrowOrRepair(int precision, double value,
*
* @param language the index of the selected language
* @param minX the minimum X / longitude value to validate. minX should
* be < maxX
* be &lt; maxX
* @param maxX the maximum X / longitude value to check. minX should be
* < maxX
* @param minY the minimum Y / latitude value to check. minY should be <
* &lt; maxX
* @param minY the minimum Y / latitude value to check. minY should be &lt;
* maxY
* @param maxY the minimum Y / latitude value to check. minY should be <
* @param maxY the minimum Y / latitude value to check. minY should be &lt;
* maxY
*/
public void validateLatLon(int language, double minX, double maxX,
Expand Down Expand Up @@ -7451,7 +7451,7 @@ public boolean saveAsKml(int language,
//.transparentPng uses Sgt.makeCleanMap which projects data (even, e.g., Mercator)
//so resulting .png will use a geographic projection.

//although the Google docs say lon must be +-180, lon > 180 is sortof ok!
//although the Google docs say lon must be +-180, lon > 180 is sort of ok!
EDVLonGridAxis lonEdv = (EDVLonGridAxis)axisVariables[lonIndex];
EDVLatGridAxis latEdv = (EDVLatGridAxis)axisVariables[latIndex];

Expand Down Expand Up @@ -14762,7 +14762,7 @@ public static void testSaveAsImage() throws Throwable {

// Make fully valid image
testSaveAsImageVsExpected(eddGrid, dir, requestUrl,
MessageFormat.format(userDapQueryTemplate, 30, 40, 210, 220),
MessageFormat.format(userDapQueryTemplate, 30, 40, 210, 220), //#'s are minY, maxY, minX, maxX
fileTypeName,
"46bbbefee2b781a7eed98f8e3b855527ba45711cf806a04cf2704a141e0a6c6f" /* expected */);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7803,7 +7803,7 @@ public static void testMatchAxisNDigits() throws Throwable {
int language = 0;

//force reload files
File2.delete("/data/_erddapBPD/dataset/ay/erdATssta3day/fileTable.nc");
File2.delete("/erddapBPD/dataset/ay/erdATssta3day/fileTable.nc");

//load dataset
testVerboseOn();
Expand Down Expand Up @@ -15451,7 +15451,7 @@ public static void test(StringBuilder errorSB, boolean interactive,
if (test == 0) testNc(deleteCachedDatasetInfo);
if (test == 1) testCwHdf(deleteCachedDatasetInfo);
if (test == 2) testHdf();
if (test == 3) testNcml();
if (test == 3) testNcml(); //!!!this is the only test which fails when I use separate netcdf-java Maven artifacts
if (test == 4) testNccsv();
if (test == 5) testGrib_43(deleteCachedDatasetInfo); //42 or 43 for netcdfAll 4.2- or 4.3+
if (test == 6) testGrib2_43(deleteCachedDatasetInfo); //42 or 43 for netcdfAll 4.2- or 4.3+
Expand Down
19 changes: 11 additions & 8 deletions WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,17 @@ public abstract class EDDTable extends EDD {
public static String orderByOptions[] = { "",
"orderBy", "orderByClosest", "orderByCount", "orderByLimit",
"orderByMax", "orderByMin", "orderByMinMax", "orderByMean", "orderBySum"};
public static String DEFAULT_ORDERBYCLOSEST = "1 hour";
public static String DEFAULT_ORDERBYLIMIT = "100";
/** These are used on web pages when a user changes orderBy.
* They parallel the orderByOptions. */
public static String orderByExtraDefaults[] = { "",
"", DEFAULT_ORDERBYCLOSEST, "", DEFAULT_ORDERBYLIMIT,
"", "", "", ""};
"", "", "", DEFAULT_ORDERBYLIMIT,
"", "", "", "", ""};
/** This is the minimum number of orderBy variables that must be specified
(not counting the orderByExtra item). */
public static byte minOrderByVariables[] = { 0,
1, 1, 0, 0,
1, 1, 1, 0};
1, 1, 1, 0, 0};

/** This is used in many file types as the row identifier. */
public final static String ROW_NAME = "row"; //see also Table.ROW_NAME
Expand Down Expand Up @@ -10160,16 +10159,20 @@ else if (tOp == REGEX_OP_INDEX ||
StringArray names = StringArray.fromCSV(
obPart.substring(start.length(), obPart.length() - 2));
StringArray goodNames = new StringArray();
boolean usesExtra = orderByExtraDefaults[i].length() > 0; //e.g., orderByLimit, orderByClosest
boolean usesExtra = orderByExtraDefaults[i].length() > 0; //e.g., orderByLimit
int nNames = names.size() - (usesExtra? 1 : 0); //if uses extra, don't check last item
if (nNames < minOrderByVariables[i])
continue; //too few items in csv
for (int n = 0; n < nNames; n++) {
if (String2.indexOf(dataVariableDestinationNames, names.get(n)) < 0)
String tName = names.get(n);
int divPo = tName.indexOf('/');
if (divPo > 0)
tName = tName.substring(0, divPo);
if (String2.indexOf(dataVariableDestinationNames, tName) < 0)
continue;
goodNames.add(names.get(n));
if (resultsVariables.indexOf(names.get(n)) < 0)
resultsVariables.add(names.get(n));
if (resultsVariables.indexOf(tName) < 0)
resultsVariables.add(tName);
}
if (goodNames.size() >= minOrderByVariables[i]) {
//success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ public class EDDTableCopyPost extends EDDTableCopy {

//find activation_time is after surgery_time
TableWriterAll twa = new TableWriterAll(tedd, null,
"c:/data/_erddapBPD/cache/cPostSurg3/", "findSurgeryBeforeActivation");
"c:/erddapBPD/cache/cPostSurg3/", "findSurgeryBeforeActivation");
tedd.getDataForDapQuery(language, loggedInAs, "requestUrl",
"unique_tag_id,activation_time,surgery_time,PI", twa);
Table table = twa.cumulativeTable();
Expand Down
Loading

0 comments on commit 3a9fee1

Please sign in to comment.