@@ -1,5 +1,6 @@ |
package m.cfa.timeseries; |
|
+import csip.Executable; |
import m.cfa.FlowStatistics; |
import m.cfa.Data; |
import m.cfa.DoubleArray; |
@@ -1939,11 +1940,13 @@ |
* Primary TimeSeries |
* It calls the subfunctions based on user selection/inputs. |
* Calls STORET or USGS database queries and their respective subfunctions |
+ * @param e DFLOW executable file |
* @param storetResourceFile python driver.py resource file for storet data extraction |
* @throws IOException |
* @throws InterruptedException |
+ * @throws java.text.ParseException |
*/ |
- public void run(File storetResourceFile) throws IOException, InterruptedException, ParseException, Exception { |
+ public void run(Executable e, File storetResourceFile) throws IOException, InterruptedException, ParseException, Exception { |
//If no date input, make it the maximum of available data |
if(beginDate == null || beginDate.equalsIgnoreCase("")){ |
beginDate = "1850-01-01"; |
@@ -2053,10 +2056,15 @@ |
//Calculate CDPHE design low flow |
if(calcCDPHElowflowTF){ |
CDPHE_lowFlowStats cdphe_lowflow = new CDPHE_lowFlowStats(); |
+ DFLOW_lowFlowStats dflow_lowflow = new DFLOW_lowFlowStats(); |
if(CDPHE_lowFlowType.equalsIgnoreCase("extreme-value")){ |
//Calculate the Extreme-value based design flow: |
extremeValueDFLOW = cdphe_lowflow.CDPHE_ExtremeValue(sortedData_combined, CDPHE_m, CDPHE_R, CDPHE_waterYearBegin); |
|
+ }if(CDPHE_lowFlowType.equalsIgnoreCase("dflow-extreme-value")){ |
+ //Calculate the Extreme-value based design flow: |
+ extremeValueDFLOW = dflow_lowflow.CDPHE_ExtremeValue(e, directory, sortedData_combined, CDPHE_m, CDPHE_R); |
+ |
}else if(CDPHE_lowFlowType.equalsIgnoreCase("biological")){ |
//Calculate the Biologically based design flow: |
double[] biologial_flows = cdphe_lowflow.CDPHE_Biological(sortedData_combined, CDPHE_m, CDPHE_R, CDPHE_clusterLength, CDPHE_clusterCountMax); |
@@ -2074,14 +2082,39 @@ |
biologicalDFLOW_nov = biologial_flows[11]; |
biologicalDFLOW_dec = biologial_flows[12]; |
|
+ }else if(CDPHE_lowFlowType.equalsIgnoreCase("dflow-biological")){ |
+ //Calculate the Biologically based design flow: |
+ double[] biologial_flows = dflow_lowflow.CDPHE_Biological(e, directory, sortedData_combined, CDPHE_m, CDPHE_R, CDPHE_clusterLength, CDPHE_clusterCountMax); |
+ biologicalDFLOW_all = biologial_flows[0]; |
+ biologicalDFLOW_jan = biologial_flows[1]; |
+ biologicalDFLOW_feb = biologial_flows[2]; |
+ biologicalDFLOW_mar = biologial_flows[3]; |
+ biologicalDFLOW_apr = biologial_flows[4]; |
+ biologicalDFLOW_may = biologial_flows[5]; |
+ biologicalDFLOW_jun = biologial_flows[6]; |
+ biologicalDFLOW_jul = biologial_flows[7]; |
+ biologicalDFLOW_aug = biologial_flows[8]; |
+ biologicalDFLOW_sep = biologial_flows[9]; |
+ biologicalDFLOW_oct = biologial_flows[10]; |
+ biologicalDFLOW_nov = biologial_flows[11]; |
+ biologicalDFLOW_dec = biologial_flows[12]; |
+ |
}else if(CDPHE_lowFlowType.equalsIgnoreCase("human-health")){ |
//Calculate the Human-health based design flow: |
humanHealthDFLOW = cdphe_lowflow.CDPHE_HumanHealth(sortedData_combined); |
|
+ }else if(CDPHE_lowFlowType.equalsIgnoreCase("dflow-human-health")){ |
+ //Calculate the Human-health based design flow: |
+ humanHealthDFLOW = dflow_lowflow.CDPHE_HumanHealth(e, directory, sortedData_combined); |
+ |
}else if(CDPHE_lowFlowType.equalsIgnoreCase("reg31")){ |
//Calcualte the Regulation 31 summary of design flows: |
reg31DFLOWsummary = cdphe_lowflow.CDPHE_REG31(sortedData_combined); |
|
+ }else if(CDPHE_lowFlowType.equalsIgnoreCase("dflow-reg31")){ |
+ //Calcualte the Regulation 31 summary of design flows: |
+ reg31DFLOWsummary = dflow_lowflow.CDPHE_REG31(e, directory, sortedData_combined); |
+ |
}else if(CDPHE_lowFlowType.equalsIgnoreCase("all")){ |
//Calculate all design flows |
extremeValueDFLOW = cdphe_lowflow.CDPHE_ExtremeValue(sortedData_combined, CDPHE_m, CDPHE_R, CDPHE_waterYearBegin); |
@@ -2101,6 +2134,26 @@ |
biologicalDFLOW_dec = biologial_flows[12]; |
humanHealthDFLOW = cdphe_lowflow.CDPHE_HumanHealth(sortedData_combined); |
reg31DFLOWsummary = cdphe_lowflow.CDPHE_REG31(sortedData_combined); |
+ |
+ }else if(CDPHE_lowFlowType.equalsIgnoreCase("dflow-all")){ |
+ //Calculate all design flows |
+ extremeValueDFLOW = dflow_lowflow.CDPHE_ExtremeValue(e, directory, sortedData_combined, CDPHE_m, CDPHE_R); |
+ double[] biologial_flows = dflow_lowflow.CDPHE_Biological(e, directory, sortedData_combined, CDPHE_m, CDPHE_R, CDPHE_clusterLength, CDPHE_clusterCountMax); |
+ biologicalDFLOW_all = biologial_flows[0]; |
+ biologicalDFLOW_jan = biologial_flows[1]; |
+ biologicalDFLOW_feb = biologial_flows[2]; |
+ biologicalDFLOW_mar = biologial_flows[3]; |
+ biologicalDFLOW_apr = biologial_flows[4]; |
+ biologicalDFLOW_may = biologial_flows[5]; |
+ biologicalDFLOW_jun = biologial_flows[6]; |
+ biologicalDFLOW_jul = biologial_flows[7]; |
+ biologicalDFLOW_aug = biologial_flows[8]; |
+ biologicalDFLOW_sep = biologial_flows[9]; |
+ biologicalDFLOW_oct = biologial_flows[10]; |
+ biologicalDFLOW_nov = biologial_flows[11]; |
+ biologicalDFLOW_dec = biologial_flows[12]; |
+ humanHealthDFLOW = dflow_lowflow.CDPHE_HumanHealth(e, directory, sortedData_combined); |
+ reg31DFLOWsummary = dflow_lowflow.CDPHE_REG31(e, directory, sortedData_combined); |
} |
} |
}else{ |
@@ -2148,6 +2201,6 @@ |
public static void main(String[] args) throws IOException, InterruptedException, Exception { |
//Run model |
guiTimeseries_Model timeseries_Model = new guiTimeseries_Model(); |
- timeseries_Model.run(null); |
+ timeseries_Model.run(null, null); |
} |
} |
\ No newline at end of file |