Displaying differences for changeset
 
display as  

src/java/cfa/AutoRegression.java

@@ -28,7 +28,7 @@
     }
 }
 /**
-* Last Updated: 10-January-2013
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 23-July-2012
 */
@@ -528,7 +528,7 @@
         
         //Project forward the data to perform drought statistics on
         Random generator = new Random();
-        double mean = doubleMath.Average(errors);
+        double mean = doubleMath.meanArithmetic(errors);
         double stDev = doubleMath.StandardDeviationSample(errors);
         double[][] predictedData = new double[projectionCount + p][2];
         for(int i=0; i<predictedData.length; i++){
@@ -893,7 +893,7 @@
         
         //Project forward the data to perform drought statistics on
         Random generator = new Random();
-        double mean = doubleMath.Average(errors);
+        double mean = doubleMath.meanArithmetic(errors);
         double stDev = doubleMath.StandardDeviationSample(errors);
         double[][] predictedData = new double[projectionCount + p][2];
         for(int i=0; i<predictedData.length; i++){

src/java/cfa/CDWR_Data.java

@@ -14,15 +14,15 @@
 import javax.xml.soap.SOAPPart;
 
 /**
- * Last Updated: 11-July-2014
+ * Last Updated: 16-December-2014
  * @author Tyler Wible
  * @since 7-July-2014
  * For more information on all of CDWR's water services, go to:
  * http://www.dwr.state.co.us/SurfaceWater/ColoradoWaterSMS.pdf
  */
 public class CDWR_Data {
-    public static final String serverURI = "http://www.dwr.state.co.us/";
-    public static final String waterSMSURI = "http://www.dwr.state.co.us/SMS_WebService/ColoradoWaterSMS.asmx";
+    public final String serverURI = "http://www.dwr.state.co.us/";
+    public final String waterSMSURI = "http://www.dwr.state.co.us/SMS_WebService/ColoradoWaterSMS.asmx";
     /**
      * Finds discharge data for the specified station and start/end dates out of the Colorado Division of Water Resource Database
      * @param stationID  the abbreviation of the name for the CDWR station
@@ -130,7 +130,7 @@
      * @return the response SOAP message from CDWR
      * @throws Exception 
      */
-    public static SOAPMessage GetSMSProvisionalData(String station, String variable, String beginDate, String endDate, String aggregation) throws Exception {
+    public SOAPMessage GetSMSProvisionalData(String station, String variable, String beginDate, String endDate, String aggregation) throws Exception {
         MessageFactory messageFactory = MessageFactory.newInstance();
         SOAPMessage soapMessage = messageFactory.createMessage();
         SOAPPart soapPart = soapMessage.getSOAPPart();

src/java/cfa/DoubleArray.java

@@ -49,7 +49,7 @@
     }
 }
 /**
-* Last Updated: 15-September-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 21-June-2012
 */
@@ -1072,7 +1072,7 @@
                 if(method.equalsIgnoreCase("max")){
                         newData[ctr][1] = String.valueOf(doubleMath.max(currentMonthData));
                 }else if(method.equalsIgnoreCase("average")){
-                        newData[ctr][1] = String.valueOf(doubleMath.Average(currentMonthData));
+                        newData[ctr][1] = String.valueOf(doubleMath.meanArithmetic(currentMonthData));
                 }else if(method.equalsIgnoreCase("min")){
                         newData[ctr][1] = String.valueOf(doubleMath.min(currentMonthData));
                 }else if(method.equalsIgnoreCase("total")){
@@ -1091,7 +1091,7 @@
                 if(method.equalsIgnoreCase("max")){
                     newData[ctr][1] = String.valueOf(doubleMath.max(currentMonthData));
                 }else if(method.equalsIgnoreCase("average")){
-                    newData[ctr][1] = String.valueOf(doubleMath.Average(currentMonthData));
+                    newData[ctr][1] = String.valueOf(doubleMath.meanArithmetic(currentMonthData));
                 }else if(method.equalsIgnoreCase("min")){
                     newData[ctr][1] = String.valueOf(doubleMath.min(currentMonthData));
                 }else if(method.equalsIgnoreCase("total")){

src/java/cfa/DoubleMath.java

@@ -10,7 +10,7 @@
 import org.apache.commons.math.analysis.polynomials.PolynomialSplineFunction;
 
 /**
-* Last Updated: 23-June-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 21-June-2012
 */
@@ -186,11 +186,11 @@
         return roundedColumn;
     }
     /**
-     * Calculates the average of the provided double[] array
+     * Calculates the arithmetic mean of the provided double[] array
      * @param data  the double[] array of which the average is desired
      * @return  the double value of the average of the data array
      */
-    public double Average(double[] data){
+    public double meanArithmetic(double[] data){
         //Calculates the average of a double array
         double sum = sum(data);
         double count = data.length;
@@ -202,11 +202,11 @@
         return average;
     }
     /**
-     * Calculates the average of the provided ArrayList<Double>
+     * Calculates the arithmetic mean of the provided ArrayList<Double>
      * @param data  the ArrayList<Double> of which the average is desired
      * @return  the double value of the average of the data array
      */
-    public double Average(ArrayList<Double> data){
+    public double meanArithmetic(ArrayList<Double> data){
         //Calculates the average of a double array
         double sum = sum(data);
         double count = data.size();
@@ -489,46 +489,6 @@
         return median;
     }
     /**
-    * Sub-function to find minimum or maximum of a dataset
-    * @param dataList  dataset of which the minimum or maximum is desired.
-    * @param maxTrue  if true the maximum value is calculated, otherwise the minimum is calculated.
-    * @return the minimum or maximum value
-    */
-    public double Min_Max(double[] dataList, boolean maxTrue){
-        double minMax = 0;
-        //sort array
-        Arrays.sort(dataList);
-        if(dataList.length ==0){
-            //If no data return zero
-            minMax = 0;
-        }else if(maxTrue){
-            //If maximum, return last value
-            minMax = dataList[dataList.length-1];
-        }else{
-            //Otherwise return return first value, minimum
-            minMax = dataList[0];
-        }
-        return minMax;
-    }
-    /**
-    * Sub-function to find minimum or maximum of a dataset
-    * @param input  dataset of which the minimum or maximum is desired.
-    * @param maxTrue  if true the maximum value is calculated, otherwise the minimum is calculated.
-    * @return the minimum or maximum value
-    */
-    public double Min_Max(List<Double> input, boolean maxTrue){
-        //Create a double[] list of data from the input ArrayList
-        Iterator<Double> iterate = input.iterator();
-        double[] dataList = new double[input.size()];
-        int ctr = 0;
-        while(iterate.hasNext()){
-            dataList[ctr] = (Double) iterate.next();
-            ctr++;
-        }
-        double minMax = Min_Max(dataList, maxTrue);
-        return minMax;
-    }
-    /**
     * Sub-function to calculate the standard deviation of the population
     * @param dataList  input list data for standard deviation
     * @return the population standard deviation of the dataList.
@@ -556,7 +516,7 @@
     * @return variance of the data array
     */
     public double VariancePopulation(double[] dataList){
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         //Calculate sum of differences
         double sum = 0;
         for(int i=0; i<dataList.length; i++){
@@ -577,7 +537,7 @@
     * @return variance of the data array
     */
     public double VariancePopulation(ArrayList<Double> dataList){
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         //Calculate sum of differences
         double sum = 0;
         for(int i=0; i<dataList.size(); i++){
@@ -598,7 +558,7 @@
     * @return variance of the data array
     */
     public double VarianceSample(double[] dataList){
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         //Calculate sum of differences
         double sum = 0;
         for(int i=0; i<dataList.length; i++){
@@ -625,7 +585,7 @@
     * @return variance of the data array
     */
     public double VarianceSample(ArrayList<Double> dataList){
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         //Calculate sum of differences
         double sum = 0;
         for(int i=0; i<dataList.size(); i++){
@@ -649,7 +609,7 @@
     */
     public double CoefficientOfVariation(double[] dataList){
         //Calculate the average and standard deviation for the coefficient of varience
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         double stDev = StandardDeviationSample(dataList);
         double coefVar = stDev/average;
 
@@ -662,7 +622,7 @@
     */
     public double CoefficientOfVariation(ArrayList<Double> dataList){
         //Calculate the average and standard deviation for the coefficient of varience
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         double stDev = StandardDeviationSample(dataList);
         double coefVar = stDev/average;
 
@@ -684,8 +644,8 @@
         double N = xData.length;
 
         //Calculate the average of the two datasets
-        double xBar = Average(xData);
-        double yBar = Average(yData);
+        double xBar = meanArithmetic(xData);
+        double yBar = meanArithmetic(yData);
 
         //Sum (Xi - Xbar) * (Yi - Ybar)
         double sum = 0;
@@ -712,8 +672,8 @@
         double N = xData.size();
 
         //Calculate the average of the two datasets
-        double xBar = Average(xData);
-        double yBar = Average(yData);
+        double xBar = meanArithmetic(xData);
+        double yBar = meanArithmetic(yData);
 
         //Sum (Xi - Xbar) * (Yi - Ybar)
         double sum = 0;
@@ -731,7 +691,7 @@
     */
     public double SkewnessPopulation(double[] dataList){
         //Get the average and standard deviation for use in the skewness formula
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         double stDev = StandardDeviationSample(dataList);
 
         //Create list of values to compute the expected value (average) of in order to get the skewness
@@ -739,7 +699,7 @@
         for(int i=0; i<dataList.length; i++){
             list[i] = Math.pow(((dataList[i] - average)/stDev), 3);
         }
-        double skewness = Average(list);
+        double skewness = meanArithmetic(list);
 
         return skewness;
     }
@@ -750,7 +710,7 @@
     */
     public double SkewnessPopulation(ArrayList<Double> dataList){
         //Get the average and standard deviation for use in the skewness formula
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         double stDev = StandardDeviationSample(dataList);
 
         //Create list of values to compute the expected value (average) of in order to get the skewness
@@ -758,7 +718,7 @@
         for(int i=0; i<dataList.size(); i++){
             list[i] = Math.pow(((dataList.get(i) - average)/stDev), 3);
         }
-        double skewness = Average(list);
+        double skewness = meanArithmetic(list);
 
         return skewness;
     }
@@ -770,7 +730,7 @@
     */
     public double SkewnessSample(double[] dataList){
         //Get the average and standard deviation for use in the skewness formula
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         double variance = VarianceSample(dataList);
         double count = dataList.length;
         if(count == 0){//fix divide by zero errors
@@ -795,7 +755,7 @@
     */
     public double SkewnessSample(ArrayList<Double> dataList){
         //Get the average and standard deviation for use in the skewness formula
-        double average = Average(dataList);
+        double average = meanArithmetic(dataList);
         double variance = VarianceSample(dataList);
         double count = dataList.size();
         if(count == 0){//fix divide by zero errors
@@ -818,7 +778,7 @@
     * @return Sxx of the dataset.
     */
     public double Sxx(double[] xData){
-        double xBar = Average(xData);
+        double xBar = meanArithmetic(xData);
         double sxx = 0;
 
         for(int i=0; i<xData.length; i++){
@@ -833,7 +793,7 @@
     * @return Sxx of the dataset.
     */
     public double Sxx(ArrayList<Double> xData){
-        double xBar = Average(xData);
+        double xBar = meanArithmetic(xData);
         double sxx = 0;
 
         for(int i=0; i<xData.size(); i++){
@@ -855,8 +815,8 @@
                     xData.length + "\tY data size:\t" + yData.length));
         }
 
-        double xBar = Average(xData);
-        double yBar = Average(yData);
+        double xBar = meanArithmetic(xData);
+        double yBar = meanArithmetic(yData);
         double sxy = 0;
 
         for(int i=0; i<xData.length; i++){
@@ -878,8 +838,8 @@
                     xData.size() + "\tY data size:\t" + yData.size()));
         }
 
-        double xBar = Average(xData);
-        double yBar = Average(yData);
+        double xBar = meanArithmetic(xData);
+        double yBar = meanArithmetic(yData);
         double sxy = 0;
 
         for(int i=0; i<xData.size(); i++){
@@ -1087,7 +1047,7 @@
                     observed.length + "\tModeled data size:\t" + modeled.length));
         }
         
-        double observed_ave = Average(observed);
+        double observed_ave = meanArithmetic(observed);
         double numerator = 0;
         double denominator = 0;
         for(int i=0; i<observed.length; i++){
@@ -1112,7 +1072,7 @@
                     observed.size() + "\tModeled data size:\t" + modeled.size()));
         }
         
-        double observed_ave = Average(observed);
+        double observed_ave = meanArithmetic(observed);
         double numerator = 0;
         double denominator = 0;
         for(int i=0; i<observed.size(); i++){

src/java/cfa/FlowStatistics.java

@@ -13,7 +13,7 @@
 import java.util.GregorianCalendar;
 
 /**
-* Last Updated: 15-September-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 29-June-2011
 */
@@ -251,16 +251,11 @@
             statsSummaryTable[163][0] = "December (Variance)";
             statsSummaryTable[164][0] = "December (Skewness)";
             statsSummaryTable[165][0] = "December (Coefficient of Variation)";
-            statsSummaryTable[166][0] = "Flow Statistics based on Indicators of Hydrologic Alteration from:";
-            statsSummaryTable[167][0] = "B.D. Richter; J.V. Baumgartner; J. Powell; D.P. Braun. 1996. 'A Method For Assessing Hydrologic Aleration Within Ecosystems.' Conservation Biology 10(4): 1163-1174.\t";
-            statsSummaryTable[168][0] = "B.D. Richter; J.V. Baumgartner; R. Wigington; D.P Braun. 1997. 'How Much Water Does A River Need?' Freshwater Biology. 37: 231-249.\t";
-            statsSummaryTable[169][0] = "B.D. Richter; J.V. Baumgartner; D.P. Braun; J. Powell. 1998. 'A Spatial Assessment Of Hydrologic Alteration Within A River Network.' Regul. Rivers: Res. Mgmt. 14: 329-340.";
-        }else{
-            statsSummaryTable[46][0] = "Flow Statistics based on Indicators of Hydrologic Alteration from:";
-            statsSummaryTable[47][0] = "B.D. Richter; J.V. Baumgartner; J. Powell; D.P. Braun. 1996. 'A Method For Assessing Hydrologic Aleration Within Ecosystems.' Conservation Biology 10(4): 1163-1174.\t";
-            statsSummaryTable[48][0] = "B.D. Richter; J.V. Baumgartner; R. Wigington; D.P Braun. 1997. 'How Much Water Does A River Need?' Freshwater Biology. 37: 231-249.\t";
-            statsSummaryTable[49][0] = "B.D. Richter; J.V. Baumgartner; D.P. Braun; J. Powell. 1998. 'A Spatial Assessment Of Hydrologic Alteration Within A River Network.' Regul. Rivers: Res. Mgmt. 14: 329-340.";
         }
+        statsSummaryTable[statsSummaryTable.length - 4][0] = "Flow Statistics based on Indicators of Hydrologic Alteration from:";
+        statsSummaryTable[statsSummaryTable.length - 3][0] = "B.D. Richter; J.V. Baumgartner; J. Powell; D.P. Braun. 1996. 'A Method For Assessing Hydrologic Aleration Within Ecosystems.' Conservation Biology 10(4): 1163-1174.\t";
+        statsSummaryTable[statsSummaryTable.length - 2][0] = "B.D. Richter; J.V. Baumgartner; R. Wigington; D.P Braun. 1997. 'How Much Water Does A River Need?' Freshwater Biology. 37: 231-249.\t";
+        statsSummaryTable[statsSummaryTable.length - 1][0] = "B.D. Richter; J.V. Baumgartner; D.P. Braun; J. Powell. 1998. 'A Spatial Assessment Of Hydrologic Alteration Within A River Network.' Regul. Rivers: Res. Mgmt. 14: 329-340.";
         
         //Calculate all data statistics
         //These are not annual statistics because the data can include more than 1 year
@@ -597,7 +592,7 @@
             oldValue = value;
             date1 = date2;
         }
-        double mean_all = doubleMath.Average(average_1Day);
+        double mean_all = doubleMath.meanArithmetic(average_1Day);
         double centroid = centroidSum / sum;
         
         //Calculate 3-day statistics
@@ -749,12 +744,12 @@
         additionalSummary[26] = String.valueOf(ctr_falls);//Number of Flow Falls
         additionalSummary[27] = String.valueOf(ctr_highPulse);//Number of High Pulses
         additionalSummary[28] = String.valueOf(doubleMath.round(highLimit,1));//Threshold for High Pulses
-        additionalSummary[29] = String.valueOf(doubleMath.round(doubleMath.Average(highPulses), 3));//Average Duration of High Pulses
+        additionalSummary[29] = String.valueOf(doubleMath.round(doubleMath.meanArithmetic(highPulses), 3));//Average Duration of High Pulses
         additionalSummary[30] = String.valueOf(ctr_lowPulse);//Number of Low Pulses
         additionalSummary[31] = String.valueOf(doubleMath.round(lowLimit,1));//Threshold for Low Pulses
-        additionalSummary[32] = String.valueOf(doubleMath.round(doubleMath.Average(lowPulses), 3));//Average Duration of Low Pulses
-        additionalSummary[33] = String.valueOf(doubleMath.round(doubleMath.Average(diffPositive),3));//Average Positive Difference Between Consecutive Days
-        additionalSummary[34] = String.valueOf(doubleMath.round(doubleMath.Average(diffNegative),3));//Average Negative Difference Between Consecutive Days
+        additionalSummary[32] = String.valueOf(doubleMath.round(doubleMath.meanArithmetic(lowPulses), 3));//Average Duration of Low Pulses
+        additionalSummary[33] = String.valueOf(doubleMath.round(doubleMath.meanArithmetic(diffPositive),3));//Average Positive Difference Between Consecutive Days
+        additionalSummary[34] = String.valueOf(doubleMath.round(doubleMath.meanArithmetic(diffNegative),3));//Average Negative Difference Between Consecutive Days
         additionalSummary[35] = String.valueOf(doubleMath.round(centroid,2));//Temporal centroid of annual discharge (Julian day, not water-year day)
         
         //Add seasonal stats summary
@@ -847,7 +842,7 @@
         statsSummaryTable[index + 2] = String.valueOf(doubleMath.round(doubleMath.Percentile_function(data, 0.75), 3));//Upper Quartile
         statsSummaryTable[index + 3] = String.valueOf(doubleMath.round(doubleMath.Percentile_function(data,0.25), 3));//Lower Quartile
         statsSummaryTable[index + 4] = String.valueOf(doubleMath.round(doubleMath.Median(data), 3));//Median
-        statsSummaryTable[index + 5] = String.valueOf(doubleMath.round(doubleMath.Average(data), 3));//Average
+        statsSummaryTable[index + 5] = String.valueOf(doubleMath.round(doubleMath.meanArithmetic(data), 3));//Average
         statsSummaryTable[index + 6] = String.valueOf(doubleMath.round(doubleMath.StandardDeviationSample(data), 3));//Standard Deviation
         statsSummaryTable[index + 7] = String.valueOf(doubleMath.round(doubleMath.VarianceSample(data), 3));//Variance
         statsSummaryTable[index + 8] = String.valueOf(doubleMath.round(doubleMath.SkewnessSample(data), 3));//Skewness
@@ -902,7 +897,7 @@
                     String startDate = mDayDate.get(0);
                     String endDate = mDayDate.get(numDays - 1);
                     allDate.add(startDate + " to " + endDate);
-                    allData.add(doubleMath.Average(mDayData));
+                    allData.add(doubleMath.meanArithmetic(mDayData));
                 }
             }
         }catch(ArrayIndexOutOfBoundsException e){
@@ -915,6 +910,13 @@
         Object[] returnArray = {allDate, allData};
         return returnArray;
     }
+    /**
+     * Loop through the provided data array and gets the corresponding index to 'value' and returns that index from the dates array
+     * @param dates  a list of dates
+     * @param data  a list of values corresponding to the dates in the above list
+     * @param value  a value
+     * @return the date corresponding to the provided value
+     */
     private String getDateOfValue(ArrayList<String> dates, ArrayList<Double> data, double value){
         String dateOfValue = "null";
         for(int i=0; i<dates.size(); i++){
@@ -925,6 +927,12 @@
         }
         return dateOfValue;
     }
+    /**
+     * Writes the provided array to a CSV result file
+     * @param mainFolder  the folder location for the result file
+     * @param statsSummary  the desired contents of the file
+     * @throws IOException 
+     */
     public void writeStatsSummaryFile(String mainFolder, String[][] statsSummary) throws IOException{
         //Open a file writer for the summary of the flow statistcs per year
         String path = mainFolder + File.separator + getFlowStatistics_summary();

src/java/cfa/Graphing.java

@@ -29,7 +29,7 @@
 import org.jfree.ui.TextAnchor;
 
 /**
-* Last Updated: 18-June-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 3-February-2014
 */
@@ -129,11 +129,11 @@
         double IQR = upperQuartile - lowerQuartile;
         double lowerLimit = lowerQuartile - 1.5*IQR;
         double upperLimit = upperQuartile + 1.5*IQR;
-        if(lowerLimit < doubleMath.Min_Max(data,false)){
-            lowerLimit = doubleMath.Min_Max(data,false);
+        if(lowerLimit < doubleMath.min(data)){
+            lowerLimit = doubleMath.min(data);
         }
-        if(upperLimit > doubleMath.Min_Max(data,true)){
-            upperLimit = doubleMath.Min_Max(data,true);
+        if(upperLimit > doubleMath.max(data)){
+            upperLimit = doubleMath.max(data);
         }
         XYSeries lineSeries = new XYSeries("Line");
         lineSeries.add(x_coord, lowerLimit);

src/java/cfa/STORET_Data.java

@@ -30,7 +30,7 @@
 import java.util.zip.ZipFile;
 
 /**
-* Last Updated: 5-February-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 22-June-2012
 */
@@ -643,7 +643,6 @@
         ArrayList<String> textData = new ArrayList<String>();
         String currentLine = "";
         int ctr = 0;
-        double temp = 0;
         while((currentLine = textReader.readLine()) !=null){
             String f[] = currentLine.split("\t");
 
@@ -663,7 +662,12 @@
                 if(Characteristic.equals("Flow")){
                     //Correct units of flow values
                     if(f[18].equalsIgnoreCase("Flow") && (f[24].equalsIgnoreCase("cm3/sec") || f[24].equalsIgnoreCase("m3/sec")) ){//convert from cm3/sec to cfs
-                        temp = Double.parseDouble(f[23])*(1/0.0283168466);
+                        double temp = Double.parseDouble(f[23])*(1/0.0283168466);
+                        f[24] = "cfs";
+                        f[23] = String.valueOf(temp);
+                    }
+                    if(f[18].equalsIgnoreCase("Flow") && f[24].equalsIgnoreCase("mgd") ){//convert from million gallons per day to cfs
+                        double temp = Double.parseDouble(f[23])*(1.54722865/1);
                         f[24] = "cfs";
                         f[23] = String.valueOf(temp);
                     }
@@ -688,15 +692,15 @@
                 }else{
                     //Correct units of WQ tests
                     if(f[24].equalsIgnoreCase("ug/l")){
-                        temp = Double.parseDouble(f[23])*(1/1000);
+                        double temp = Double.parseDouble(f[23])*(1/1000);
                         f[23] = String.valueOf(temp);
                         f[24] = "mg/l";
                     }else if(f[24].equalsIgnoreCase("g/l")){
-                        temp = Double.parseDouble(f[23])*(1000/1);
+                        double temp = Double.parseDouble(f[23])*(1000/1);
                         f[23] = String.valueOf(temp);
                         f[24] = "mg/l";
                     }
-                    if(f[18].equalsIgnoreCase(Characteristic) && f[24].equalsIgnoreCase("mg/l")){
+                    if(f[18].equalsIgnoreCase(Characteristic) && f[24].equalsIgnoreCase("mg/l") && !f[23].equalsIgnoreCase("Not Detected")){
                         //Pull out only the data needed to pass between sub-functions
 
                         //f[1] = Station name

src/java/cfa/gui15minTimeseries_Model.java

@@ -24,7 +24,7 @@
 import org.jfree.data.time.TimeSeries;
 
 /**
-* Last Updated: 15-September-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 23-June-2014
 */
@@ -201,7 +201,7 @@
         double maxVal = doubleMath.max(dataList);
         double minVal = doubleMath.min(dataList);
         double rangeVal = maxVal - minVal;
-        double aveVal = doubleMath.Average(dataList);
+        double aveVal = doubleMath.meanArithmetic(dataList);
         double stDev = doubleMath.StandardDeviationSample(dataList);
         
         //Append current results to summary

src/java/cfa/guiBaseflow_Model.java

@@ -29,7 +29,7 @@
 
 
 /**
- * Last Updated: 15-September-2014
+ * Last Updated: 16-December-2014
  * @author Tyler Wible
  * @since 15-June-2012
  */
@@ -500,22 +500,22 @@
         this.bflowStream_max = doubleMath.round(doubleMath.max(getColumn(graphData,1)),3);
         this.bflowStream_min = doubleMath.round(doubleMath.min(getColumn(graphData,1)),3);
         this.bflowStream_median = doubleMath.round(doubleMath.Median(getColumn(graphData,1)),3);
-        this.bflowStream_mean = doubleMath.round(doubleMath.Average(getColumn(graphData,1)),3);
+        this.bflowStream_mean = doubleMath.round(doubleMath.meanArithmetic(getColumn(graphData,1)),3);
         
         this.bflow1_max = doubleMath.round(doubleMath.max(getColumn(graphData,2)),3);
         this.bflow1_min = doubleMath.round(doubleMath.min(getColumn(graphData,2)),3);
         this.bflow1_median = doubleMath.round(doubleMath.Median(getColumn(graphData,2)),3);
-        this.bflow1_mean = doubleMath.round(doubleMath.Average(getColumn(graphData,2)),3);
+        this.bflow1_mean = doubleMath.round(doubleMath.meanArithmetic(getColumn(graphData,2)),3);
         
         this.bflow2_max = doubleMath.round(doubleMath.max(getColumn(graphData,3)),3);
         this.bflow2_min = doubleMath.round(doubleMath.min(getColumn(graphData,3)),3);
         this.bflow2_median = doubleMath.round(doubleMath.Median(getColumn(graphData,3)),3);
-        this.bflow2_mean = doubleMath.round(doubleMath.Average(getColumn(graphData,3)),3);
+        this.bflow2_mean = doubleMath.round(doubleMath.meanArithmetic(getColumn(graphData,3)),3);
         
         this.bflow3_max = doubleMath.round(doubleMath.max(getColumn(graphData,4)),3);
         this.bflow3_min = doubleMath.round(doubleMath.min(getColumn(graphData,4)),3);
         this.bflow3_median = doubleMath.round(doubleMath.Median(getColumn(graphData,4)),3);
-        this.bflow3_mean = doubleMath.round(doubleMath.Average(getColumn(graphData,4)),3);
+        this.bflow3_mean = doubleMath.round(doubleMath.meanArithmetic(getColumn(graphData,4)),3);
     }
     /**
      * Creates a double[] array of the elements in dataArray[all][column]

src/java/cfa/guiDC_Model.java

@@ -26,7 +26,7 @@
 import org.jfree.data.xy.XYSeriesCollection;
 
 /**
-* Last Updated: 24-November-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 12-June-2011
 */
@@ -1308,7 +1308,7 @@
         //Calculate statistics
         DoubleMath doubleMath = new DoubleMath();
         this.flowMedian = doubleMath.round(doubleMath.Median(dataList),3);//Call Median function
-        this.flowMean = doubleMath.round(doubleMath.Average(dataList),3);//Call Mean function
+        this.flowMean = doubleMath.round(doubleMath.meanArithmetic(dataList),3);//Call Mean function
     }
     /**
      * Calculates a summary table of standardized percentiles based on the data

src/java/cfa/guiDrought_Model.java

@@ -44,7 +44,7 @@
 import org.jfree.ui.TextAnchor;
 
 /**
-* Last Updated: 15-September-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 10-July-2012
 */
@@ -213,15 +213,12 @@
             //Calculate total annual flows
             double[][] annualData = sumAnnualFlows(sortedData);
 
-
             //Get the flow values and calculate the long-term (total) average of them
-            droughtLimit = doubleMath.Average(doubleArray.getColumn(annualData, 1));
-
+            droughtLimit = doubleMath.meanArithmetic(doubleArray.getColumn(annualData, 1));
 
             //Call built in function to perform the drough analysis and graph the resulting data
             String[] droughtInfo = generalDroughtAnalysis(sortedData, droughtLimit);
 
-
             return droughtInfo;
     }
     /**
@@ -253,7 +250,7 @@
 
 
         //Convert the data to only the stoicastic portion to modeled using AR(1) or ARMA(1,1)
-        double average = doubleMath.Average(doubleArray.getColumn(annualData, 1));
+        double average = doubleMath.meanArithmetic(doubleArray.getColumn(annualData, 1));
         double stDev = doubleMath.StandardDeviationSample(doubleArray.getColumn(annualData, 1));
         double[][] stocaisticData = autoRegression.StoicasticConversion(annualData, average, stDev, true);
 
@@ -419,7 +416,7 @@
                             //There were observed droughts larger than this one, calculate the average recurrence interval
                             if(recurrence.size() != 0){
                                     droughtLambda.add(lambda[i]);//lambda value
-                                    droughtRecurrence.add(doubleMath.Average(recurrence));//average recurrence = return period
+                                    droughtRecurrence.add(doubleMath.meanArithmetic(recurrence));//average recurrence = return period
                                     droughtLength.add((double) j);//length of drought
                             }
                     }

src/java/cfa/guiLOADEST_Model.java

@@ -17,7 +17,7 @@
 
 
 /**
-* Last Updated: 15-September-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible & Tyler Dell
 * @since 27-March-2013
 */
@@ -632,12 +632,12 @@
         
         //Calculate statistics
         DoubleMath doubleMath = new DoubleMath();
-        double temp1 = doubleMath.round(doubleMath.Min_Max(dataList, true),3);//Call Max function
-        double temp2 = doubleMath.round(doubleMath.Min_Max(dataList, false),3);//Call Min function
+        double temp1 = doubleMath.round(doubleMath.max(dataList),3);//Call Max function
+        double temp2 = doubleMath.round(doubleMath.min(dataList),3);//Call Min function
         double temp3 = doubleMath.round(doubleMath.Percentile_function(dataList,0.75),3);//Call Upper Quartile function
         double temp4 = doubleMath.round(doubleMath.Percentile_function(dataList,0.25),3);//Call Lower Quartile function
         double temp5 = doubleMath.round(doubleMath.Median(dataList),3);//Call Median function
-        double temp6 = doubleMath.round(doubleMath.Average(dataList),3);//Call Mean function
+        double temp6 = doubleMath.round(doubleMath.meanArithmetic(dataList),3);//Call Mean function
         double temp7 = doubleMath.round(doubleMath.StandardDeviationSample(dataList),3);//Call standard deviation
         
         if(timeStep.equalsIgnoreCase("daily")){

src/java/cfa/guiTimeseries_Model.java

@@ -40,7 +40,7 @@
 import org.jfree.data.xy.XYSeriesCollection;
 
 /**
-* Last Updated: 24-November-2014
+* Last Updated: 16-December-2014
 * @author Tyler Wible
 * @since 24-June-2011
 */
@@ -436,12 +436,12 @@
         
         //Calculate statistics
         DoubleMath doubleMath = new DoubleMath();
-        double temp1 = doubleMath.round(doubleMath.Min_Max(dataList, true),3);//Call Max function
-        double temp2 = doubleMath.round(doubleMath.Min_Max(dataList, false),3);//Call Min function
+        double temp1 = doubleMath.round(doubleMath.max(dataList),3);//Call Max function
+        double temp2 = doubleMath.round(doubleMath.min(dataList),3);//Call Min function
         double temp3 = doubleMath.round(doubleMath.Percentile_function(dataList,0.75),3);//Call Upper Quartile function
         double temp4 = doubleMath.round(doubleMath.Percentile_function(dataList,0.25),3);//Call Lower Quartile function
         double temp5 = doubleMath.round(doubleMath.Median(dataList),3);//Call Median function
-        double temp6 = doubleMath.round(doubleMath.Average(dataList),3);//Call Mean function
+        double temp6 = doubleMath.round(doubleMath.meanArithmetic(dataList),3);//Call Mean function
         double temp7 = doubleMath.round(doubleMath.StandardDeviationSample(dataList),3);//Call standard deviation function
         double temp8 = doubleMath.round(doubleMath.VarianceSample(dataList),3);//Call variance function
         double temp9 = doubleMath.round(doubleMath.SkewnessSample(dataList),8);//Call skewness function
@@ -1132,7 +1132,7 @@
             if(medianTF){
                 dayValue = doubleMath.Median(dateData);
             }else{
-                dayValue = doubleMath.Average(dateData);
+                dayValue = doubleMath.meanArithmetic(dateData);
             }
             
             //Save the results for this day of the year