Skip to content

Commit 3a9fee1

Browse files
author
Bob Simons
committed
v2.17
1 parent 03644ad commit 3a9fee1

21 files changed

+209
-98
lines changed

WEB-INF/classes/gov/noaa/pfel/coastwatch/TestAll.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ public static void main(String args[]) throws Throwable {
240240
// 1) run:
241241
// EDD.verbose = true;
242242
// EDDGridFromDap.testUAFSubThreddsCatalog(0); //0= entire official clean catalog ~16hrs
243-
// 2) Results file is /data/_erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml
244-
// Log file is /data/_erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml.log.txt
243+
// 2) Results file is /erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml
244+
// Log file is /erddapBPD/logs/UAFdatasets[uafi]_[dateTime].xml.log.txt
245245
// 3) Look at problems, creator_, title, .... Make improvements.
246-
// from /data/_erddapBPD/logs:
246+
// from /erddapBPD/logs:
247247
// grep "SimpleException: Error while getting DAS from"
248248
// grep "unable to get axis"
249249
// grep "unsorted axis"
@@ -375,7 +375,7 @@ public static void main(String args[]) throws Throwable {
375375

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

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

1093-
//TestSSR.testAwsTransferManager();
1094-
//DasDds.main(new String[]{"nceiPH53sstn1day", "-verbose"});
1095-
10961093
//EDDGridFromNcFiles.testNcml();
10971094

10981095
/* for releases, this line should have open/close comment */

WEB-INF/classes/gov/noaa/pfel/coastwatch/griddata/NcHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static String decodeNcDump(String s) {
147147
int sLength = s.length();
148148

149149
//remove dir name from first line (since this is sometimes sent to ERDDAP users)
150-
//"netcdf /data/_erddapBPD/cache/_test/EDDGridFromDap_Axis.nc {\n" +
150+
//"netcdf /erddapBPD/cache/_test/EDDGridFromDap_Axis.nc {\n" +
151151
int po = 0;
152152
int brPo = s.indexOf(" {");
153153
if (brPo >= 0) {

WEB-INF/classes/gov/noaa/pfel/coastwatch/pointdata/Table.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9810,7 +9810,7 @@ public static void testReadNDNc() throws Exception {
98109810
Test.ensureEqual(results, expected, "results=\n" + results);
98119811

98129812
//test String vars
9813-
fiName = "c:/data/_erddapBPD/copy/cPostDet3/BARBARAx20BLOCK/LAMNAx20DITROPIS/Nx2fA/52038_A69-1303_1059305.nc";
9813+
fiName = "c:/erddapBPD/copy/cPostDet3/BARBARAx20BLOCK/LAMNAx20DITROPIS/Nx2fA/52038_A69-1303_1059305.nc";
98149814
table.readNDNc(fiName, null, 0, //standardizeWhat=0
98159815
null, 0, 0);
98169816
results = table.dataToString(4);

WEB-INF/classes/gov/noaa/pfel/erddap/Erddap.java

+19-19
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
22682268
//convert the info into pseudo datasets.xml
22692269
String content =
22702270
"Data Provider Form - Part 1\n" + //important! Bob's erd.data gmail filter looks for 'Data Provider Form'
2271-
" from " + fromInfo + "\n" +
2271+
" from " + XML.encodeAsHTML(fromInfo) + "\n" +
22722272
" ipAddress=" + ipAddress + "\n" +
22732273
"\n" +
22742274
"griddedOption=" + griddedOptions[griddedOption] + "\n" +
@@ -2318,7 +2318,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
23182318

23192319
//hidden fields
23202320
writer.write(
2321-
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
2321+
widgets.hidden("timestamp", tTimestamp) +
23222322
"\n");
23232323

23242324
//begin text
@@ -2344,7 +2344,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
23442344
30, 50, tYourName, ""))
23452345
.replace("&widgetEmailAddress;", widgets.textField("emailAddress", "", //tooltip
23462346
30, 50, tEmailAddress, ""))
2347-
.replace("&tTimestamp;", tTimestamp);
2347+
.replace("&tTimestamp;", XML.encodeAsHTML(tTimestamp));
23482348
writer.write(dataProviderContactInfo
23492349
/*
23502350
"<h2>Your Contact Information</h2>\n" +
@@ -2356,7 +2356,7 @@ public void doDataProviderForm1(int language, HttpServletRequest request,
23562356
" <br>What is your email address? " +
23572357
widgets.textField("emailAddress", "", //tooltip
23582358
30, 50, tEmailAddress, "") +
2359-
" <br>This dataset submission's timestamp is " + tTimestamp + ".\n" +
2359+
" <br>This dataset submission's timestamp is " + XML.encodeAsHTML(tTimestamp) + ".\n" +
23602360
"\n"
23612361
*/);
23622362
String dataProviderData = EDStatic.dataProviderDataAr[language]
@@ -2594,7 +2594,7 @@ public void doDataProviderForm2(int language, HttpServletRequest request,
25942594
tKeywords.sortIgnoreCase();
25952595
String content =
25962596
"Data Provider Form - Part 2\n" + //important! Bob's erd.data gmail filter looks for this
2597-
" from " + fromInfo + "\n" +
2597+
" from " + XML.encodeAsHTML(fromInfo) + "\n" +
25982598
" ipAddress=" + ipAddress + "\n" +
25992599
"\n" +
26002600
" <addAttributes>\n" +
@@ -2671,9 +2671,9 @@ public void doDataProviderForm2(int language, HttpServletRequest request,
26712671

26722672
//hidden fields
26732673
writer.write(
2674-
widgets.hidden("yourName", XML.encodeAsHTML(tYourName)) +
2675-
widgets.hidden("emailAddress", XML.encodeAsHTML(tEmailAddress)) +
2676-
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
2674+
widgets.hidden("yourName", tYourName) +
2675+
widgets.hidden("emailAddress", tEmailAddress) +
2676+
widgets.hidden("timestamp", tTimestamp) +
26772677
"\n");
26782678

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

31393139
//hidden fields
31403140
writer.write(
3141-
widgets.hidden("yourName", XML.encodeAsHTML(tYourName)) +
3142-
widgets.hidden("emailAddress", XML.encodeAsHTML(tEmailAddress)) +
3143-
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
3141+
widgets.hidden("yourName", tYourName) +
3142+
widgets.hidden("emailAddress", tEmailAddress) +
3143+
widgets.hidden("timestamp", tTimestamp) +
31443144
"\n");
31453145

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

34333433
//hidden fields
34343434
writer.write(
3435-
widgets.hidden("yourName", XML.encodeAsHTML(tYourName)) +
3436-
widgets.hidden("emailAddress", XML.encodeAsHTML(tEmailAddress)) +
3437-
widgets.hidden("timestamp", XML.encodeAsHTML(tTimestamp)) +
3435+
widgets.hidden("yourName", tYourName) +
3436+
widgets.hidden("emailAddress", tEmailAddress) +
3437+
widgets.hidden("timestamp", tTimestamp) +
34383438
"\n");
34393439

34403440
//begin text
@@ -3532,10 +3532,10 @@ public void doDataProviderFormDone(int language, HttpServletRequest request,
35323532

35333533
//begin text
35343534
writer.write(EDStatic.dpf_congratulationAr[language]
3535-
.replace("&tTimestamp;", tTimestamp)
3535+
.replace("&tTimestamp;", XML.encodeAsHTML(tTimestamp))
35363536
.replaceAll("&tErddapUrl;", tErddapUrl)
3537-
.replace("&tYourName;", SSR.minimalPercentEncode(tYourName))
3538-
.replace("&tEmailAddress;", SSR.minimalPercentEncode(tEmailAddress))
3537+
.replace("&tYourName;", XML.encodeAsHTML(tYourName))
3538+
.replace("&tEmailAddress;", XML.encodeAsHTML(tEmailAddress))
35393539

35403540
// "<h2>You're done! Congratulations! Thank you!</h2>\n" +
35413541
// "The ERDDAP administrator will email you soon to figure out the best way transfer\n" +

WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDGrid.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -7081,12 +7081,12 @@ private double validateGreaterThanThrowOrRepair(int precision, double value,
70817081
*
70827082
* @param language the index of the selected language
70837083
* @param minX the minimum X / longitude value to validate. minX should
7084-
* be < maxX
7084+
* be &lt; maxX
70857085
* @param maxX the maximum X / longitude value to check. minX should be
7086-
* < maxX
7087-
* @param minY the minimum Y / latitude value to check. minY should be <
7086+
* &lt; maxX
7087+
* @param minY the minimum Y / latitude value to check. minY should be &lt;
70887088
* maxY
7089-
* @param maxY the minimum Y / latitude value to check. minY should be <
7089+
* @param maxY the minimum Y / latitude value to check. minY should be &lt;
70907090
* maxY
70917091
*/
70927092
public void validateLatLon(int language, double minX, double maxX,
@@ -7451,7 +7451,7 @@ public boolean saveAsKml(int language,
74517451
//.transparentPng uses Sgt.makeCleanMap which projects data (even, e.g., Mercator)
74527452
//so resulting .png will use a geographic projection.
74537453

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

@@ -14762,7 +14762,7 @@ public static void testSaveAsImage() throws Throwable {
1476214762

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

WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDGridFromNcFiles.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -7803,7 +7803,7 @@ public static void testMatchAxisNDigits() throws Throwable {
78037803
int language = 0;
78047804

78057805
//force reload files
7806-
File2.delete("/data/_erddapBPD/dataset/ay/erdATssta3day/fileTable.nc");
7806+
File2.delete("/erddapBPD/dataset/ay/erdATssta3day/fileTable.nc");
78077807

78087808
//load dataset
78097809
testVerboseOn();
@@ -15451,7 +15451,7 @@ public static void test(StringBuilder errorSB, boolean interactive,
1545115451
if (test == 0) testNc(deleteCachedDatasetInfo);
1545215452
if (test == 1) testCwHdf(deleteCachedDatasetInfo);
1545315453
if (test == 2) testHdf();
15454-
if (test == 3) testNcml();
15454+
if (test == 3) testNcml(); //!!!this is the only test which fails when I use separate netcdf-java Maven artifacts
1545515455
if (test == 4) testNccsv();
1545615456
if (test == 5) testGrib_43(deleteCachedDatasetInfo); //42 or 43 for netcdfAll 4.2- or 4.3+
1545715457
if (test == 6) testGrib2_43(deleteCachedDatasetInfo); //42 or 43 for netcdfAll 4.2- or 4.3+

WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDTable.java

+11-8
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,17 @@ public abstract class EDDTable extends EDD {
148148
public static String orderByOptions[] = { "",
149149
"orderBy", "orderByClosest", "orderByCount", "orderByLimit",
150150
"orderByMax", "orderByMin", "orderByMinMax", "orderByMean", "orderBySum"};
151-
public static String DEFAULT_ORDERBYCLOSEST = "1 hour";
152151
public static String DEFAULT_ORDERBYLIMIT = "100";
153152
/** These are used on web pages when a user changes orderBy.
154153
* They parallel the orderByOptions. */
155154
public static String orderByExtraDefaults[] = { "",
156-
"", DEFAULT_ORDERBYCLOSEST, "", DEFAULT_ORDERBYLIMIT,
157-
"", "", "", ""};
155+
"", "", "", DEFAULT_ORDERBYLIMIT,
156+
"", "", "", "", ""};
158157
/** This is the minimum number of orderBy variables that must be specified
159158
(not counting the orderByExtra item). */
160159
public static byte minOrderByVariables[] = { 0,
161160
1, 1, 0, 0,
162-
1, 1, 1, 0};
161+
1, 1, 1, 0, 0};
163162

164163
/** This is used in many file types as the row identifier. */
165164
public final static String ROW_NAME = "row"; //see also Table.ROW_NAME
@@ -10160,16 +10159,20 @@ else if (tOp == REGEX_OP_INDEX ||
1016010159
StringArray names = StringArray.fromCSV(
1016110160
obPart.substring(start.length(), obPart.length() - 2));
1016210161
StringArray goodNames = new StringArray();
10163-
boolean usesExtra = orderByExtraDefaults[i].length() > 0; //e.g., orderByLimit, orderByClosest
10162+
boolean usesExtra = orderByExtraDefaults[i].length() > 0; //e.g., orderByLimit
1016410163
int nNames = names.size() - (usesExtra? 1 : 0); //if uses extra, don't check last item
1016510164
if (nNames < minOrderByVariables[i])
1016610165
continue; //too few items in csv
1016710166
for (int n = 0; n < nNames; n++) {
10168-
if (String2.indexOf(dataVariableDestinationNames, names.get(n)) < 0)
10167+
String tName = names.get(n);
10168+
int divPo = tName.indexOf('/');
10169+
if (divPo > 0)
10170+
tName = tName.substring(0, divPo);
10171+
if (String2.indexOf(dataVariableDestinationNames, tName) < 0)
1016910172
continue;
1017010173
goodNames.add(names.get(n));
10171-
if (resultsVariables.indexOf(names.get(n)) < 0)
10172-
resultsVariables.add(names.get(n));
10174+
if (resultsVariables.indexOf(tName) < 0)
10175+
resultsVariables.add(tName);
1017310176
}
1017410177
if (goodNames.size() >= minOrderByVariables[i]) {
1017510178
//success

WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDTableCopyPost.javaINACTIVE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ public class EDDTableCopyPost extends EDDTableCopy {
13591359

13601360
//find activation_time is after surgery_time
13611361
TableWriterAll twa = new TableWriterAll(tedd, null,
1362-
"c:/data/_erddapBPD/cache/cPostSurg3/", "findSurgeryBeforeActivation");
1362+
"c:/erddapBPD/cache/cPostSurg3/", "findSurgeryBeforeActivation");
13631363
tedd.getDataForDapQuery(language, loggedInAs, "requestUrl",
13641364
"unique_tag_id,activation_time,surgery_time,PI", twa);
13651365
Table table = twa.cumulativeTable();

0 commit comments

Comments
 (0)