Displaying differences for changeset
 
display as  

src/java/cfa/Bulletin17B.java

@@ -316,8 +316,8 @@
 
         if(Math.abs(G - gg) > 0.5){
             //Notify user more weight should be given to station skew    (Jeff)
-            System.out.println("\nThere is a large discrepency (> 0.5) between the\ncalculated station skew (G = " + G + ") and the generalized skew (GG = " + gg + ").");
-            System.out.println("\nMore weight should be given to the Station skew.\n");
+            System.out.println("\nThere is a large discrepency (> 0.5) between the calculated station skew (G = " + G + ") and the generalized skew (GG = " + gg + ").");
+            System.out.println("More weight should be given to the Station skew.\n");
         }
         KNtable = null;  //clear KNtable
 
@@ -341,7 +341,6 @@
                     System.out.println("Date: " + String.valueOf(datain[i][0]) + "\tFlow: " + String.valueOf(datain[i][1]));
                 }
             }
-            System.out.println("\n");
         }
 
         double[][][] freqCurveArray = freqCurve(Xmean, S, G, ktable);//[K floodfreq Gzero] = freqCurve(Xmean, S, G, ktable);
@@ -532,7 +531,6 @@
 
         //Assemble a summary of return periods and flow values    (Tyler)
         summaryTable = probFreqData(dataout, summaryTable);
-        System.out.println("\nFinished analyses.\n");
         return summaryTable;
     }
     /**
@@ -910,12 +908,12 @@
         double[] xLimits = {doubleMath.min(gridMajor), 1.02*doubleMath.max(gridMajor)};
 
         //Check if there is any historical data below the calculated ymin, if so reset ymin to the smaller of the two values
-        System.out.println("Y max: " + ymax);
-        System.out.println("Y min: " + ymin);
+        //System.out.println("Y max: " + ymax);
+        //System.out.println("Y min: " + ymin);
         if(yRnk[yRnk.length - 1][1] < ymin){
             ymin = 0.8*yRnk[yRnk.length - 1][1];
         }
-        System.out.println("Y min: " + ymin);
+        //System.out.println("Y min: " + ymin);
         double[] yLimits = {ymin, ymax};
         //Determine the necessary offsets to create the proper graph
         //Note: this resets values of global variables:
@@ -1135,8 +1133,7 @@
             ChartUtilities.saveChartAsJPEG(new File(path), parentChart, 1280, 800);
             System.out.println("JFreeChart created properly at: " + path);
         }catch(IOException e) {
-            System.out.println("Problem occurred creating chart");
-            System.out.println(e);
+            System.err.println("A problem occurred while trying to creating the chart.");
         }
     }
     /**
@@ -1386,7 +1383,7 @@
 
         minLimit = Math.floor(minLimit);
         maxLimit = Math.ceil(maxLimit);
-        System.out.println("Log Limits: " + minLimit + "\t" + maxLimit);
+        //System.out.println("Log Limits: " + minLimit + "\t" + maxLimit);
 
         //Determine based on current data range what the offsets should be
         if(Double.isInfinite(minLimit)){
@@ -1396,7 +1393,7 @@
             yAxisLimit = -25;
             legendOffset = 0.01;
             tickMarkOffset = 1.25;
-            System.out.println("Resetting yLimit:" + yAxisLimit);
+            //System.out.println("Resetting yLimit:" + yAxisLimit);
             yLimits[0] = -1;
 
         }else if(minLimit <= 0 && maxLimit == 3){//USGS 09085400

src/java/cfa/guiTimeseries_Model.java

@@ -33,14 +33,13 @@
 import org.jfree.data.time.Day;
 import org.jfree.data.time.Month;
 import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
 import org.jfree.data.time.Year;
 import org.jfree.data.xy.XYDataset;
 import org.jfree.data.xy.XYSeries;
 import org.jfree.data.xy.XYSeriesCollection;
 
 /**
-* Last Updated: 9-November-2015
+* Last Updated: 10-November-2015
 * @author Tyler Wible
 * @since 24-June-2011
 */
@@ -241,9 +240,6 @@
     public String getDataSource(){
         return dataSource;
     }
-    public boolean getCalcFlowStatisticsFileTF(){
-        return calcFlowStatisticsFileTF;
-    }
     public String getCDPHE_ExtremeValueDFLOW(){
         return String.valueOf(extremeValueDFLOW);
     }
@@ -1998,10 +1994,12 @@
         
         //Perform operations on daily data before it is converted to the user desired timeStep
         createTimeseriesMonthlyGraph(sortedData_combined, period1Data, period2Data, period3Data, monthlyYaxisTitle);
-        //createTimeseriesEnvelopeGraph(sortedData_combined, yAxisTitle, true);
         
         FlowStatistics flowStats = new FlowStatistics();
         if(wqTest.equalsIgnoreCase("flow")){
+            //Create Envelope Graph
+            createTimeseriesEnvelopeGraph(sortedData_combined, yAxisTitle, true);
+            
             //Calculate Hydrologic Indicators of Alteration
             if(calcFlowStatisticsFileTF){
                 flowStats.calculateAllStatisticsSummaries(mainFolder, stationID, stationName, sortedData_combined, highPercentile, lowPercentile, 0, 0, showMonthlyStatsTF,

src/java/m/cfa/Timeseries_V1_0.java

@@ -63,62 +63,24 @@
     @Override
     protected void postProcess() throws Exception {
         // files
-        if(model.getCalcFlowStatisticsFileTF()){
-            putResult(new File(model.getGraph()),
-                      new File(model.getBoxplot()),
-                      new File(model.getHistogram()),
-                      new File(model.getMonthlyGraph()),
-                      //new File(model.getTimeseriesEnvelope()),
-                      new File(model.getCDF()),
-                      model.getFlowStatistics_summary(),
-                      //Below are the result graph files for use by JHighCharts on eRAMS for duplicating the above graphs
-                      model.getTimeseriesOutput(),
-                      model.getBoxplotOutput(),
-                      model.getMonthlyTimeseriesOutput(),
-                      //model.getMonthlyBoxplotOutput(),
-                      //model.getTimeseriesEnvelopeOutput(),
-                      model.getHistogramOutput(),
-                      model.getCDFoutput());
-        }else{
-            putResult(new File(model.getGraph()),
-                      new File(model.getBoxplot()),
-                      new File(model.getHistogram()),
-                      new File(model.getMonthlyGraph()),
-                      //new File(model.getTimeseriesEnvelope()),
-                      new File(model.getCDF()),
-                      //Below are the result graph files for use by JHighCharts on eRAMS for duplicating the above graphs
-                      model.getTimeseriesOutput(),
-                      model.getBoxplotOutput(),
-                      model.getMonthlyTimeseriesOutput(),
-                      //model.getMonthlyBoxplotOutput(),
-                      //model.getTimeseriesEnvelopeOutput(),
-                      model.getHistogramOutput(),
-                      model.getCDFoutput());
-        }
-
+        putResult(new File(model.getGraph()),
+                  new File(model.getBoxplot()),
+                  new File(model.getHistogram()),
+                  new File(model.getMonthlyGraph()),
+                  new File(model.getCDF()),
+                  //Below are the result graph files for use by JHighCharts on eRAMS for duplicating the above graphs
+                  model.getBoxplotOutput(),
+                  model.getMonthlyTimeseriesOutput(),
+                  //model.getMonthlyBoxplotOutput(),
+                  model.getTimeseriesEnvelopeOutput(),
+                  model.getHistogramOutput(),
+                  model.getCDFoutput());
         // values
         putResult("len", model.getLen());
         putResult("start", model.getStart());
         putResult("end", model.getEnd());
         putResult("units", model.getUnits());
         putResult("data_source", model.getDataSource());
-        //Get CDPHE low flow results
-        putResult("cdphe_extremeValueDFLOW", model.getCDPHE_ExtremeValueDFLOW(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_all", model.getCDPHE_BiologicalDFLOW_all(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_jan", model.getCDPHE_BiologicalDFLOW_jan(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_feb", model.getCDPHE_BiologicalDFLOW_feb(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_mar", model.getCDPHE_BiologicalDFLOW_mar(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_apr", model.getCDPHE_BiologicalDFLOW_apr(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_may", model.getCDPHE_BiologicalDFLOW_may(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_jun", model.getCDPHE_BiologicalDFLOW_jun(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_jul", model.getCDPHE_BiologicalDFLOW_jul(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_aug", model.getCDPHE_BiologicalDFLOW_aug(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_sep", model.getCDPHE_BiologicalDFLOW_sep(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_oct", model.getCDPHE_BiologicalDFLOW_oct(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_nov", model.getCDPHE_BiologicalDFLOW_nov(), null, "cfs");
-        putResult("cdphe_biologicalDFLOW_dec", model.getCDPHE_BiologicalDFLOW_dec(), null, "cfs");
-        putResult("cdphe_humanHealthDFLOW", model.getCDPHE_HumanHealthDFLOW(), null, "cfs");
-        putResult("cdphe_reg31DFLOWsummary", model.getCDPHE_Reg31DFLOWsummary());
         //Get all data results
         putResult("max", model.getMax(), null, model.getUnits());
         putResult("min", model.getMin(), null, model.getUnits());
@@ -144,45 +106,6 @@
         putResult("skewness_seasonal", model.getSkewness_seasonal());
         putResult("coefficientOfVariation_seasonal", model.getCoefficientOfVariation_seasonal());
         putResult("kendalCorrelationCoefficient_seasonal", model.getKendallCorrelationCoefficient_seasonal());
-        //Get Period 1 results
-        putResult("len_period1", model.getLen_period1());
-        putResult("max_period1", model.getMax_period1(), null, model.getUnits());
-        putResult("min_period1", model.getMin_period1(), null, model.getUnits());
-        putResult("upperQuartile_period1", model.getUpperQuartile_period1(), null, model.getUnits());
-        putResult("lowerQuartile_period1", model.getLowerQuartile_period1(), null, model.getUnits());
-        putResult("median_period1", model.getMedian_period1(), null, model.getUnits());
-        putResult("mean_period1", model.getMean_period1(), null, model.getUnits());
-        putResult("standardDeviation_period1", model.getStandardDeviation_period1(), null, model.getUnits());
-        putResult("variance_period1", model.getVariance_period1());
-        putResult("skewness_period1", model.getSkewness_period1());
-        putResult("coefficientOfVariation_period1", model.getCoefficientOfVariation_period1());
-        putResult("kendalCorrelationCoefficient_period1", model.getKendallCorrelationCoefficient_period1());
-        //Get Period 2 results
-        putResult("len_period2", model.getLen_period2());
-        putResult("max_period2", model.getMax_period2(), null, model.getUnits());
-        putResult("min_period2", model.getMin_period2(), null, model.getUnits());
-        putResult("upperQuartile_period2", model.getUpperQuartile_period2(), null, model.getUnits());
-        putResult("lowerQuartile_period2", model.getLowerQuartile_period2(), null, model.getUnits());
-        putResult("median_period2", model.getMedian_period2(), null, model.getUnits());
-        putResult("mean_period2", model.getMean_period2(), null, model.getUnits());
-        putResult("standardDeviation_period2", model.getStandardDeviation_period2(), null, model.getUnits());
-        putResult("variance_period2", model.getVariance_period2());
-        putResult("skewness_period2", model.getSkewness_period2());
-        putResult("coefficientOfVariation_period2", model.getCoefficientOfVariation_period2());
-        putResult("kendalCorrelationCoefficient_period2", model.getKendallCorrelationCoefficient_period2());
-        //Get Period 3 results
-        putResult("len_period3", model.getLen_period3());
-        putResult("max_period3", model.getMax_period3(), null, model.getUnits());
-        putResult("min_period3", model.getMin_period3(), null, model.getUnits());
-        putResult("upperQuartile_period3", model.getUpperQuartile_period3(), null, model.getUnits());
-        putResult("lowerQuartile_period3", model.getLowerQuartile_period3(), null, model.getUnits());
-        putResult("median_period3", model.getMedian_period3(), null, model.getUnits());
-        putResult("mean_period3", model.getMean_period3(), null, model.getUnits());
-        putResult("standardDeviation_period3", model.getStandardDeviation_period3(), null, model.getUnits());
-        putResult("variance_period3", model.getVariance_period3());
-        putResult("skewness_period3", model.getSkewness_period3());
-        putResult("coefficientOfVariation_period3", model.getCoefficientOfVariation_period3());
-        putResult("kendalCorrelationCoefficient_period3", model.getKendallCorrelationCoefficient_period3());
         //Get other results
         putResult("flow_statistics_summary",model.getFlowStatistics_summary().getName());
         putResult("graph", model.getGraph());
@@ -190,16 +113,88 @@
         putResult("histogram", model.getHistogram());
         putResult("cdf_graph", model.getCDF());
         putResult("monthlyAverage_graph", model.getMonthlyGraph());
-        //putResult("timeseries_envelope_graph", model.getTimeseriesEnvelope());
-        
         //Get result files for JSHighCharts
         String graphDataFiles = model.getTimeseriesOutput().getName() + "|" +  
                       model.getBoxplotOutput().getName() + "|" + 
                       model.getMonthlyTimeseriesOutput().getName() + "|" + 
                       //model.getMonthlyBoxplotOutput().getName() + "|" +
-                      //model.getTimeseriesEnvelopeOutput().getName() + "|" +
                       model.getHistogramOutput().getName() + "|" +
                       model.getCDFoutput().getName();
+        
+        //Get Period 1 results
+        if(!getStringParam("period1_begin").equalsIgnoreCase("") && !getStringParam("period1_end").equalsIgnoreCase("")){
+            putResult("len_period1", model.getLen_period1());
+            putResult("max_period1", model.getMax_period1(), null, model.getUnits());
+            putResult("min_period1", model.getMin_period1(), null, model.getUnits());
+            putResult("upperQuartile_period1", model.getUpperQuartile_period1(), null, model.getUnits());
+            putResult("lowerQuartile_period1", model.getLowerQuartile_period1(), null, model.getUnits());
+            putResult("median_period1", model.getMedian_period1(), null, model.getUnits());
+            putResult("mean_period1", model.getMean_period1(), null, model.getUnits());
+            putResult("standardDeviation_period1", model.getStandardDeviation_period1(), null, model.getUnits());
+            putResult("variance_period1", model.getVariance_period1());
+            putResult("skewness_period1", model.getSkewness_period1());
+            putResult("coefficientOfVariation_period1", model.getCoefficientOfVariation_period1());
+            putResult("kendalCorrelationCoefficient_period1", model.getKendallCorrelationCoefficient_period1());
+        }
+        //Get Period 2 results
+        if(!getStringParam("period2_begin").equalsIgnoreCase("") && !getStringParam("period2_end").equalsIgnoreCase("")){
+            putResult("len_period2", model.getLen_period2());
+            putResult("max_period2", model.getMax_period2(), null, model.getUnits());
+            putResult("min_period2", model.getMin_period2(), null, model.getUnits());
+            putResult("upperQuartile_period2", model.getUpperQuartile_period2(), null, model.getUnits());
+            putResult("lowerQuartile_period2", model.getLowerQuartile_period2(), null, model.getUnits());
+            putResult("median_period2", model.getMedian_period2(), null, model.getUnits());
+            putResult("mean_period2", model.getMean_period2(), null, model.getUnits());
+            putResult("standardDeviation_period2", model.getStandardDeviation_period2(), null, model.getUnits());
+            putResult("variance_period2", model.getVariance_period2());
+            putResult("skewness_period2", model.getSkewness_period2());
+            putResult("coefficientOfVariation_period2", model.getCoefficientOfVariation_period2());
+            putResult("kendalCorrelationCoefficient_period2", model.getKendallCorrelationCoefficient_period2());
+        }
+        //Get Period 3 results
+        if(!getStringParam("period3_begin").equalsIgnoreCase("") && !getStringParam("period3_end").equalsIgnoreCase("")){
+            putResult("len_period3", model.getLen_period3());
+            putResult("max_period3", model.getMax_period3(), null, model.getUnits());
+            putResult("min_period3", model.getMin_period3(), null, model.getUnits());
+            putResult("upperQuartile_period3", model.getUpperQuartile_period3(), null, model.getUnits());
+            putResult("lowerQuartile_period3", model.getLowerQuartile_period3(), null, model.getUnits());
+            putResult("median_period3", model.getMedian_period3(), null, model.getUnits());
+            putResult("mean_period3", model.getMean_period3(), null, model.getUnits());
+            putResult("standardDeviation_period3", model.getStandardDeviation_period3(), null, model.getUnits());
+            putResult("variance_period3", model.getVariance_period3());
+            putResult("skewness_period3", model.getSkewness_period3());
+            putResult("coefficientOfVariation_period3", model.getCoefficientOfVariation_period3());
+            putResult("kendalCorrelationCoefficient_period3", model.getKendallCorrelationCoefficient_period3());
+        }
+        //Get flow stats file
+        if(getBooleanParam("calcFlowStatisticsFileTF") && getStringParam("wq_test").equalsIgnoreCase("flow")){
+            putResult(model.getFlowStatistics_summary());
+        }
+        //Get flow envelope graph
+        if(getStringParam("wq_test").equalsIgnoreCase("flow")){
+            putResult(new File(model.getTimeseriesEnvelope()), model.getTimeseriesOutput());
+            putResult("envelope_graph", model.getTimeseriesEnvelope());
+            graphDataFiles = graphDataFiles + "|" + model.getTimeseriesEnvelopeOutput().getName();
+        }
+        //Get CDPHE low flow results
+        if(getBooleanParam("calcCDPHElowflowTF")){
+            putResult("cdphe_extremeValueDFLOW", model.getCDPHE_ExtremeValueDFLOW(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_all", model.getCDPHE_BiologicalDFLOW_all(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_jan", model.getCDPHE_BiologicalDFLOW_jan(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_feb", model.getCDPHE_BiologicalDFLOW_feb(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_mar", model.getCDPHE_BiologicalDFLOW_mar(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_apr", model.getCDPHE_BiologicalDFLOW_apr(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_may", model.getCDPHE_BiologicalDFLOW_may(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_jun", model.getCDPHE_BiologicalDFLOW_jun(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_jul", model.getCDPHE_BiologicalDFLOW_jul(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_aug", model.getCDPHE_BiologicalDFLOW_aug(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_sep", model.getCDPHE_BiologicalDFLOW_sep(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_oct", model.getCDPHE_BiologicalDFLOW_oct(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_nov", model.getCDPHE_BiologicalDFLOW_nov(), null, "cfs");
+            putResult("cdphe_biologicalDFLOW_dec", model.getCDPHE_BiologicalDFLOW_dec(), null, "cfs");
+            putResult("cdphe_humanHealthDFLOW", model.getCDPHE_HumanHealthDFLOW(), null, "cfs");
+            putResult("cdphe_reg31DFLOWsummary", model.getCDPHE_Reg31DFLOWsummary());
+        }
         putResult("graph_data_files", graphDataFiles);
     }
 }