@@ -125,11 +125,11 @@ |
//This is for limits on the values in the KNtable provided by USGS (Tyler) |
if(datain.length < 10){ |
ArrayList<String> errorMessage = new ArrayList<String>(); |
- errorMessage.add("The flood frequency analysis tool requires a minimum of 10 data points required for the Bulletin 17B statistical analysis. The record of data for this station has " + datain.length + " annual maxima flood observations."); |
+ errorMessage.add("The flood frequency analysis tool requires a minimum of 10 data points required for the Bulletin 17B statistical analysis. The record of data, based on the specified dates, for this station has " + datain.length + " annual maxima flood observations."); |
writeError(errorMessage); |
}else if(datain.length > 149){ |
ArrayList<String> errorMessage = new ArrayList<String>(); |
- errorMessage.add("The flood frequency analysis tool requires a maximum of 149 data points for use with the Bulletin 17B statistical analysis. The record of data for this station has " + datain.length + " annual maxima flood observations."); |
+ errorMessage.add("The flood frequency analysis tool requires a maximum of 149 data points for use with the Bulletin 17B statistical analysis. The record of data, based on the specified dates, for this station has " + datain.length + " annual maxima flood observations."); |
writeError(errorMessage); |
} |
|
@@ -553,9 +553,9 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.len = String.valueOf(sortedData_combined.length); |
this.units = "cfs"; |
@@ -156,11 +156,11 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("STORET")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.len = String.valueOf(allFlowData.length); |
this.start = allFlowData[0][0]; |
@@ -169,8 +169,7 @@ |
return reformatedData; |
} |
/** |
- * Writes out the dynamically created summary table to be displayed to the |
- * user along with the flood graph |
+ * Writes out the inputs files required for the BFLOW.exe software |
* |
* @param dynamicSummary string[][] array to be written as each line of the |
* text file |
@@ -179,7 +178,7 @@ |
* @param ndmax the integer number of maximum baseflow days for BFLOW |
* @throws IOException |
*/ |
- private void writeBFLOWinputFile(String[][] dynamicSummary, int ndmin, int ndmax) throws IOException { |
+ private void writeBFLOWinputFiles(String[][] dynamicSummary, int ndmin, int ndmax) throws IOException { |
//Write input data file for BFLOW |
String path = mainFolder + File.separator + "baseflow.txt"; |
FileWriter writer = new FileWriter(path, false); |
@@ -563,11 +562,11 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("STORET")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.len = String.valueOf(allFlowData.length); |
this.start = allFlowData[0][0]; |
@@ -930,7 +929,7 @@ |
String[][] inputFlowData = reformatBFLOWdata(sortedData_combined); |
|
//Write out the BFLOW input files |
- writeBFLOWinputFile(inputFlowData, ndmin, ndmax); |
+ writeBFLOWinputFiles(inputFlowData, ndmin, ndmax); |
|
//Call BFLOW model |
//Expected Input: "baseflow.txt" and "file.lst" |
@@ -1402,11 +1402,11 @@ |
String sourceText = ""; |
//Determine if current source is USGS or STORET to give credit for the data |
if(database.equalsIgnoreCase("USGS")){ |
- sourceText = "Stream flow data and water quality test data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ sourceText = "Stream flow data and water quality test data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("STORET")){ |
- sourceText = "Stream flow data and water quality test data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ sourceText = "Stream flow data and water quality test data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- sourceText = "Stream flow data and water quality test data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ sourceText = "Stream flow data and water quality test data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.dataSource = sourceText; |
|
@@ -1428,7 +1428,7 @@ |
dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n"; |
}else if(paragraphTitle.equals("Flow Duration Curve Overview: ")){ |
dynamic_paragraph = dynamic_paragraph + "A flow duration curve (FDC) is the ranked graphing of river flows on a scale of percent exceedance. For example a flow value associated with the flow interval of 15% means that particular flow value is met or exceeded only 15% of the time. This graph is meant to give a quick overview of the flow ranges, variability, and probability of flows of a river segment during the different flow periods of a river; which are High Flows from 0 to 10 percent flow interval, Moist Conditions 10-40, Mid-Range Flows 40-60, Dry Conditions 60-90, and Low Flows 90-100 (Cleland 2003).\n"; |
- dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n"; |
+ dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period or 'annual flow duration curves'.\n"; |
}else{ |
dynamic_paragraph = dynamic_paragraph + "Although some observed points may exceed the target curve's concentration there is no single apparent pollutant source.\n"; |
dynamic_paragraph = dynamic_paragraph + "Please click 'Further Model Information' for more pollutant source identification help.\n"; |
@@ -958,19 +958,20 @@ |
//Create the Y Axis |
LogarithmicAxis yAxis = new LogarithmicAxis("Recurrence Interval [years]"); |
yAxis.setAllowNegativesFlag(true); |
- double maxValue = 1; |
try{ |
- maxValue = Math.log10(doubleMath.max(doubleArray.getColumn(predictedData, 1))); |
- maxValue = Math.ceil(maxValue); |
+ double maxValue = Math.log10(doubleMath.max(doubleArray.getColumn(predictedData, 1))); |
+ if(Double.compare(maxValue, Double.NEGATIVE_INFINITY) != 0 && |
+ Double.compare(maxValue, Double.POSITIVE_INFINITY) != 0 ){ |
+ maxValue = Math.ceil(maxValue); |
+ yAxis.setRange(1, Math.pow(10, maxValue)); |
+ } |
}catch(ArrayIndexOutOfBoundsException e){ |
- maxValue = 1; |
System.err.print("No predicted data lambda values\n"); |
} |
- yAxis.setRange(1, Math.pow(10, maxValue)); |
plot.setRangeAxis(0, yAxis); |
|
//Add equation explaining the term lambda |
- XYTextAnnotation equation = new XYTextAnnotation(" Lambda = Drought Deficit / Drought Limit ", 9, Math.pow(10, maxValue)*0.5); |
+ XYTextAnnotation equation = new XYTextAnnotation(" Lambda = Drought Deficit / Drought Limit ", 9, yAxis.getUpperBound()*0.5); |
equation.setFont(graphing.masterFont); |
equation.setBackgroundPaint(Color.white); |
equation.setOutlinePaint(Color.black); |
@@ -1302,11 +1303,11 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("STORET")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.len = String.valueOf(sortedData_combined.length); |
this.start = String.valueOf(sortedData_combined[0][0]); |
@@ -207,11 +207,11 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.len = String.valueOf(peakFlowData.length); |
this.start = String.valueOf(peakFlowData[0][0]); |
@@ -885,11 +885,11 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data and water quality test data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("STORET")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ this.dataSource = "Stream flow data and water quality test data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data and water quality test data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.start = sortedData[0][0]; |
this.end = sortedData[sortedData.length - 1][0]; |
@@ -148,7 +148,7 @@ |
SimpleDateFormat desiredDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = desiredDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stage-Discharge Rating Curve data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stage-Discharge Rating Curve data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
this.ratingWarning = "The stage-discharge rating provided in this file should be" + |
" considered provisional and subject to change until published by USGS. Stage-discharge" + |
" ratings change over time as the channel features that control" + |
@@ -157,7 +157,7 @@ |
" rating before using it for decisions that concern personal or" + |
" public safety or operational consequences."; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stage-Discharge Rating Curve data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stage-Discharge Rating Curve data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
this.ratingWarning = "All data presented on the Colorado Division of Water Resources" |
+ " ColoradoWaterSMS web service are provisional and subject to revision. These" |
+ " data include water levels in lakes and reservoirs, and in streams, rivers," |
@@ -1946,11 +1946,11 @@ |
SimpleDateFormat sourceDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
String today = sourceDateFormat.format(currentDate); |
if(database.equalsIgnoreCase("USGS")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
+ this.dataSource = "Stream flow data and water quality test data retrieved from the U.S. Geological Survey, National Water Information System: Web Interface. http://waterdata.usgs.gov/nwis, accessed: " + today; |
}else if(database.equalsIgnoreCase("STORET")){ |
- this.dataSource = "Stream flow data and water quality test data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
+ this.dataSource = "Stream flow data and water quality test data retrieved from the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today; |
}else if(database.equalsIgnoreCase("CDWR")){ |
- this.dataSource = "Stream flow data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
+ this.dataSource = "Stream flow data retrieved from the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today; |
} |
this.len = String.valueOf(sortedData_combined.length); |
this.units = graphUnits; |