Displaying differences for changeset
 
display as  

src/java/cfa/STORET_Data.java

@@ -571,7 +571,7 @@
         String zipfile = downloadUrl.substring(downloadUrl.indexOf("tmd"));
 
         //Download STORET data
-        System.out.println("Step 9: Downloading Zip file");
+        System.out.println("Step 9: Determining zip-file to download");
         String zipfile_location = downloadzip(downloadUrl, zipfile, mainFolder);
 
         //Close web interaction

src/java/cfa/guiDC_Model.java

@@ -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);

src/java/m/cfa/DurationCurve_V1_0.java

@@ -49,6 +49,7 @@
                 model.setHighPercentile(m.get("highPercentile").getDouble(VALUE));
                 model.setLowPercentile(m.get("lowPercentile").getDouble(VALUE));
                 model.setShowMonthlyStatsTF(m.get("showMonthlyStatsTF").getBoolean(VALUE));
+                model.setCalcFlowStatisticsFileTF(m.get("calcFlowStatisticsFileTF").getBoolean(VALUE));
                 model.setMQNperiod(m.get("mqn_period").getString(VALUE));
                 model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
                 model.setSTORETdata(m.get("STORETdata").getString(VALUE));
@@ -64,11 +65,19 @@
 
     @Override
     public File[] postprocess() throws Exception {
-        return Services.toFiles(model.getGraph(),
+        if(model.getCalcFlowStatisticsFileTF()){
+            return Services.toFiles(model.getGraph(),
                                 model.getDurationCurve_results().getName(),
                                 model.getFlowStatistics_summary().getName(),
                                 //Below are the result graph files for use by JHighCharts on eRAMS for duplicating the above graphs
                                 model.getDCgraphOutput().getName());
+        }else{
+            return Services.toFiles(model.getGraph(),
+                                model.getDurationCurve_results().getName(),
+                                //Below are the result graph files for use by JHighCharts on eRAMS for duplicating the above graphs
+                                model.getDCgraphOutput().getName());
+        }
+        
     }
 
     @Override

src/java/m/cfa/DurationCurve_V1_0Req.json

@@ -100,6 +100,11 @@
       "value": 0.25
     },
     {
+      "name": "calcFlowStatisticsFileTF",
+      "description": "If true, and wq_test == 'flow', then a series of flow statistics will be calculated and returned in a flow statistics file. If false, no flow statistics file is created.",
+      "value": true
+    },
+    {
       "name": "showMonthlyStatsTF",
       "description": "If true, and the 'wq_test' is flow, then monthly flow statistics will be included in the flow-statistics result file If false, only annual and period of record statistics will be included.",
       "value": false

src/java/m/cfa/Timeseries_V1_0Req.json

@@ -114,16 +114,16 @@
       "value": 0.25
     },
     {
+      "name": "calcFlowStatisticsFileTF",
+      "description": "If true, and wq_test == 'flow', then a series of flow statistics will be calculated and returned in a flow statistics file. If false, no flow statistics file is created.",
+      "value": true
+    },
+    {
       "name": "showMonthlyStatsTF",
       "description": "If true, and wq_test == 'flow', then monthly flow statistics will be included in the flow-statistics result file. If false, only annual and period of record statistics will be included.",
       "value": false
     },
     {
-      "name": "calcFlowStatisticsFileTF",
-      "description": "If true, and wq_test == 'flow', then a series of flow statistics will be calculated and returned in a flow statistics file. If false, no flow statistics file is created.",
-      "value": true
-    },
-    {
       "name": "calcCDPHElowflowTF",
       "description": "If true, and wq_test == 'flow', then design low-flow(s) will be calculated using the proceedure outlined by Colorado Division of Public Health and Environment's (CDPHE) DFLOW program and the inputs provided. If false, no CDPHE desing flow(s) will be calculated.",
       "value": false