Displaying differences for changeset
 
display as  

nbproject/ant-deploy.xml

@@ -1,4 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+
+Contributor(s):
+-->
 <project default="-deploy-ant" basedir=".">
     <target name="-init" if="deploy.ant.enabled">
         <property file="${deploy.ant.properties.file}"/>
@@ -16,7 +55,7 @@
                     <isset property="tomcat.password"/>
                 </not>
             </condition>
-        </fail>    
+        </fail>
     </target>
     <target name="-deploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials">
         <echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/>

nbproject/build-impl.xml

@@ -1009,9 +1009,9 @@
         <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${reference.csip-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.commons-math-2.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.Jama-1.0.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.jcommon-1.0.16.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.jfreechart-1.0.13.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.Jama-1.0.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <mkdir dir="${build.web.dir}/META-INF"/>
         <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
     </target>
@@ -1019,9 +1019,9 @@
         <copyfiles files="${libs.CSIP-Jersey-2.16.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${reference.csip-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.commons-math-2.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.Jama-1.0.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.jcommon-1.0.16.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.jfreechart-1.0.13.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.Jama-1.0.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
     </target>
     <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
         <delete dir="${build.web.dir}/WEB-INF/lib"/>

nbproject/project.properties

@@ -1,3 +1,5 @@
+file.reference.Jama-1.0.2.jar=lib/Jama-1.0.2.jar
+j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.4.2.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar
 #Fri May 06 09:05:19 MDT 2016
 javadoc.splitindex=true
 lib.dir=${web.docbase.dir}/WEB-INF/lib
@@ -11,7 +13,6 @@
 build.web.excludes=${build.classes.excludes}
 war.ear.name=${war.name}
 j2ee.compile.on.save=true
-j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar\:${j2ee.server.home}/lib/catalina-ant.jar\:${j2ee.server.home}/lib/catalina-ha.jar\:${j2ee.server.home}/lib/catalina-storeconfig.jar\:${j2ee.server.home}/lib/catalina-tribes.jar\:${j2ee.server.home}/lib/catalina.jar\:${j2ee.server.home}/lib/ecj-4.4.2.jar\:${j2ee.server.home}/lib/el-api.jar\:${j2ee.server.home}/lib/jasper-el.jar\:${j2ee.server.home}/lib/jasper.jar\:${j2ee.server.home}/lib/jsp-api.jar\:${j2ee.server.home}/lib/servlet-api.jar\:${j2ee.server.home}/lib/tomcat-api.jar\:${j2ee.server.home}/lib/tomcat-coyote.jar\:${j2ee.server.home}/lib/tomcat-dbcp.jar\:${j2ee.server.home}/lib/tomcat-i18n-es.jar\:${j2ee.server.home}/lib/tomcat-i18n-fr.jar\:${j2ee.server.home}/lib/tomcat-i18n-ja.jar\:${j2ee.server.home}/lib/tomcat-jdbc.jar\:${j2ee.server.home}/lib/tomcat-jni.jar\:${j2ee.server.home}/lib/tomcat-util-scan.jar\:${j2ee.server.home}/lib/tomcat-util.jar\:${j2ee.server.home}/lib/tomcat-websocket.jar\:${j2ee.server.home}/lib/websocket-api.jar
 debug.test.classpath=${run.test.classpath}
 build.dir=build
 javac.deprecation=false
@@ -30,7 +31,9 @@
 javac.source=1.8
 javac.debug=true
 javac.test.processorpath=${javac.test.classpath}
-run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir}
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
 build.generated.sources.dir=${build.dir}/generated-sources
 javadoc.notree=false
 runmain.jvmargs=
@@ -41,10 +44,15 @@
 annotation.processing.enabled=true
 war.content.additional=
 dist.javadoc.dir=${dist.dir}/javadoc
-file.reference.Jama-1.0.2.jar=lib/Jama-1.0.2.jar
 client.urlPart=
 javadoc.additionalparam=
-javac.classpath=${libs.CSIP-Jersey-2.16.classpath}\:${reference.csip-core.jar}\:${file.reference.commons-math-2.0.jar}\:${file.reference.Jama-1.0.2.jar}\:${file.reference.jcommon-1.0.16.jar}\:${file.reference.jfreechart-1.0.13.jar}
+javac.classpath=\
+    ${libs.CSIP-Jersey-2.16.classpath}:\
+    ${reference.csip-core.jar}:\
+    ${file.reference.commons-math-2.0.jar}:\
+    ${file.reference.jcommon-1.0.16.jar}:\
+    ${file.reference.jfreechart-1.0.13.jar}:\
+    ${file.reference.Jama-1.0.2.jar}
 javadoc.noindex=false
 webinf.dir=web/WEB-INF
 annotation.processing.enabled.in.editor=true
@@ -63,10 +71,12 @@
 annotation.processing.run.all.processors=true
 compile.jsps=false
 excludes=
-javac.processorpath=${javac.classpath}
+javac.processorpath=\
+    ${javac.classpath}
 build.test.results.dir=${build.dir}/test/results
 display.browser=false
-endorsed.classpath=${libs.javaee-endorsed-api-6.0.classpath}
+endorsed.classpath=\
+    ${libs.javaee-endorsed-api-6.0.classpath}
 javadoc.use=true
 build.web.dir=${build.dir}/web
 javadoc.nonavbar=false

nbproject/project.xml

@@ -24,10 +24,6 @@
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.Jama-1.0.2.jar}</file>
-                    <path-in-war>WEB-INF/lib</path-in-war>
-                </library>
-                <library dirs="200">
                     <file>${file.reference.jcommon-1.0.16.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
@@ -35,6 +31,10 @@
                     <file>${file.reference.jfreechart-1.0.13.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
+                <library dirs="200">
+                    <file>${file.reference.Jama-1.0.2.jar}</file>
+                    <path-in-war>WEB-INF/lib</path-in-war>
+                </library>
             </web-module-libraries>
             <web-module-additional-libraries/>
             <source-roots>

src/java/m/cfa/timeseries/CDPHE_lowFlowStats.java

@@ -127,10 +127,10 @@
      * @throws ParseException 
      */
     public double[] CDPHE_Biological(String[][] flowData,
-                                   int m,
-                                   int R,
-                                   int clusterLength,
-                                   int clusterCountMax) throws IOException, ParseException{
+                                     int m,
+                                     int R,
+                                     int clusterLength,
+                                     int clusterCountMax) throws IOException, ParseException{
         //Calculate annual design low flow
         double DFLOW_annual = CDPHE_Biological_calcs(flowData, m, R, clusterLength, clusterCountMax);
         
@@ -202,10 +202,10 @@
      * @throws ParseException 
      */
     private double CDPHE_Biological_calcs(String[][] flowData,
-                                   int m,
-                                   int R,
-                                   int clusterLength,
-                                   int clusterCountMax) throws IOException, ParseException{
+                                          int m,
+                                          int R,
+                                          int clusterLength,
+                                          int clusterCountMax) throws IOException, ParseException{
         //Calculate m-day statistics
         Object[] resultArray = DoubleArray.getMdayData(flowData, m, "harmonic");
         ArrayList<String> average_Mday_date = (ArrayList<String>) resultArray[0];
@@ -213,6 +213,10 @@
         
         //Get extreme-value based design flow (as a trial design flow to start searching for the biologically based one, note this still uses an arithmetic mean)
         double trialDFLOW = CDPHE_ExtremeValue(flowData, m, R, "04-01");
+        if(trialDFLOW == 0){
+            //Catch zero-flow guess to avoid ending the convergence loop early and reporting a zero when it shouldn't be zero
+            trialDFLOW = DoubleMath.meanHarmonic(average_Mday);
+        }
         double trialDFLOW_excursions = countExcursions(average_Mday_date, average_Mday, m, trialDFLOW, clusterLength, clusterCountMax);
         
         //Get allowed number of excursions
@@ -253,10 +257,6 @@
             }
             ctr++;
         }
-        
-        //Call file writer for outputs fo flow statistics
-        designFlow = DoubleMath.round(designFlow, 3);
-        
         return designFlow;
     }
     /**
@@ -527,7 +527,7 @@
         median_R_yearFlow = DoubleMath.round(median_R_yearFlow, 2);
         
         //Format the results into a summary table
-        String summaryTable = "Month\t1E3 Acute Monthly Low Flows\t7E3 Chronic Monthly Low Flows\t30E3 Chronic Monthly Low Flows";
+        String summaryTable = "Month\t1E3 Acute Monthly Low Flows [cfs]\t7E3 Chronic Monthly Low Flows [cfs]\t30E3 Chronic Monthly Low Flows [cfs]";
         String[] months = {"Entire Record", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "Lowest Monthly Flow"};
         for(int i=0; i<13; i++){
             summaryTable = summaryTable + "\r\n" + months[i] + "\t" + monthlyBiological_1day[i] + "\t" + monthlyBiological_7day[i] + "\t" + monthlyBiological_30day[i];