@@ -26,7 +26,7 @@ |
import org.jfree.data.xy.XYSeriesCollection; |
|
/** |
-* Last Updated: 26-January-2015 |
+* Last Updated: 24-February-2015 |
* @author Tyler Wible |
* @since 12-June-2011 |
*/ |
@@ -53,6 +53,7 @@ |
double highPercentile = 0.75; |
double lowPercentile = 0.25; |
boolean showMonthlyStatsTF = false; |
+ boolean calcFlowStatisticsFileTF = true; |
String mQnPeriod = "false";//"7Q10";// |
boolean useSTORETretrieval = false;//true;// |
String STORETdata = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1$$Date\t00600\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";// |
@@ -132,6 +133,9 @@ |
public String getDataSource(){ |
return dataSource; |
} |
+ public boolean getCalcFlowStatisticsFileTF(){ |
+ return calcFlowStatisticsFileTF; |
+ } |
public String getLowFlowErrorMessage(){ |
return lowFlowErrorMessage; |
} |
@@ -203,6 +207,9 @@ |
public void setShowMonthlyStatsTF(boolean showMonthlyStatsTF) { |
this.showMonthlyStatsTF = showMonthlyStatsTF; |
} |
+ public void setCalcFlowStatisticsFileTF(boolean calcFlowStatisticsFileTF) { |
+ this.calcFlowStatisticsFileTF = calcFlowStatisticsFileTF; |
+ } |
public void setMQNperiod(String mQnPeriod) { |
this.mQnPeriod = mQnPeriod; |
} |
@@ -289,6 +296,7 @@ |
} |
|
//While the dataset is still sorted by date, pull out the mQn value and start/end dates for analysis summary |
+ double mQn = 0; |
int m=0, n=0; |
if(mQnHide == false){ |
//Pull out mQn-period variables |
@@ -296,19 +304,25 @@ |
String nString = mQnPeriod.substring(mQnPeriod.indexOf("Q")+1); |
m = Integer.parseInt(mString); |
n = Integer.parseInt(nString); |
+ calcFlowStatisticsFileTF = true; |
} |
|
//Calculate the flow stats file |
FlowStatistics flowStats = new FlowStatistics(); |
- Object[] returnValue = flowStats.calculateAllStatisticsSummaries(mainFolder, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, m, n, showMonthlyStatsTF, |
- seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End); |
- double mQn = (Double) returnValue[0]; |
- String MQNmessage = (String) returnValue[1]; |
- if(!mQnHide){ |
- this.lowFlowErrorMessage = MQNmessage; |
- DoubleMath doubleMath = new DoubleMath(); |
- this.mQnVal = doubleMath.round(mQn, 2); |
+ if(calcFlowStatisticsFileTF){ |
+ Object[] returnValue = flowStats.calculateAllStatisticsSummaries(mainFolder, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, |
+ m, n, showMonthlyStatsTF, seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End); |
+ |
+ //Calculate low flow |
+ mQn = (Double) returnValue[0]; |
+ String MQNmessage = (String) returnValue[1]; |
+ if(!mQnHide){ |
+ this.lowFlowErrorMessage = MQNmessage; |
+ DoubleMath doubleMath = new DoubleMath(); |
+ this.mQnVal = doubleMath.round(mQn, 2); |
+ } |
} |
+ |
this.start = sortedData_combined[0][0]; |
this.end = sortedData_combined[sortedData_combined.length - 1][0]; |
this.flowLen = String.valueOf(sortedData_combined.length); |
@@ -682,7 +696,8 @@ |
} |
|
//While the dataset is still sorted by date, pull out the mQn value and start/end dates for analysis summary |
- boolean mQnHide = mQnPeriod.contains("false"); |
+ boolean mQnHide = mQnPeriod.contains("false"); |
+ double mQn = 0; |
int m=0, n=0; |
if(mQnHide == false){ |
//Pull out mQn-period variables |
@@ -690,24 +705,30 @@ |
String nString = mQnPeriod.substring(mQnPeriod.indexOf("Q")+1); |
m = Integer.parseInt(mString); |
n = Integer.parseInt(nString); |
+ calcFlowStatisticsFileTF = true; |
} |
|
//Calculate the flow stats file |
FlowStatistics flowStats = new FlowStatistics(); |
- Object[] returnValue = flowStats.calculateAllStatisticsSummaries(mainFolder, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, m, n, showMonthlyStatsTF, |
- seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End); |
- double mQn = (Double) returnValue[0]; |
- String MQNmessage = (String) returnValue[1]; |
- //Also multiply the mQn flow value(cfs) by the conversion and water quality target |
- mQn = mQn*conversion*wqTarget; |
- if(!mQnHide){ |
- if(!MQNmessage.equalsIgnoreCase("")){//if the MQNmessage is not blank add it to the dynamic summary |
- this.lowFlowErrorMessage = MQNmessage; |
- }else{ |
- DoubleMath doubleMath = new DoubleMath(); |
- this.mQnVal = doubleMath.round(mQn, 2); |
+ if(calcFlowStatisticsFileTF){ |
+ Object[] returnValue = flowStats.calculateAllStatisticsSummaries(mainFolder, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, m, n, |
+ showMonthlyStatsTF, seasonBegin, seasonEnd, period1Begin, period1End, period2Begin, period2End, period3Begin, period3End); |
+ |
+ //Calculate low flow |
+ mQn = (Double) returnValue[0]; |
+ String MQNmessage = (String) returnValue[1]; |
+ //Also multiply the mQn flow value(cfs) by the conversion and water quality target |
+ mQn = mQn*conversion*wqTarget; |
+ if(!mQnHide){ |
+ if(!MQNmessage.equalsIgnoreCase("")){//if the MQNmessage is not blank add it to the dynamic summary |
+ this.lowFlowErrorMessage = MQNmessage; |
+ }else{ |
+ DoubleMath doubleMath = new DoubleMath(); |
+ this.mQnVal = doubleMath.round(mQn, 2); |
+ } |
} |
} |
+ |
this.start = sortedData_combined[0][0]; |
this.end = sortedData_combined[sortedData_combined.length - 1][0]; |
this.flowLen = String.valueOf(sortedData_combined.length); |