Displaying differences for changeset
 
display as  

src/java/cfa/DoubleArray.java

@@ -327,7 +327,7 @@
     /**
      * Creates a double[] array of the elements in dataArray[all][column]
      * @param dataArray  the double[][] data array
-     * @param column  the desired column from data array
+     * @param column  the desired column from data array (zero based)
      * @return  a double[] array of the elements in dataArray[all][column]
      */
     public double[] getColumn(double[][] dataArray, int column){
@@ -342,7 +342,7 @@
     /**
      * Creates a double[] array of the elements in dataArray[rowIndexList][column]
      * @param dataArray  the double[][] data array
-     * @param column  the desired column from data array
+     * @param column  the desired column from data array (zero based)
      * @param rowIndexList  an ArrayList<Integer> containing the desired row indices from dataArray
      * @return  a double[] array of the elements in dataArray[rowIndexList][column]
      */

src/java/cfa/DoubleMath.java

@@ -173,8 +173,8 @@
      * Rounds the double[] array to the number of decimal places "n" where roundingValue = 10^n  
      * For example if the roundingValue is equal to 10, then the returned matrix would contain the original matrix with 1 decimal place 
      * @param originalColumn  the original double[] matrix to be rounded
-     * @param roundingValue  is equal to the 10^number of decimal places desired
-     * @return  a double[] array of the rounded values of the orignal data
+     * @param roundingValue  is equal to the 10^number of decimal places desired (aka 2 decimal places has a roundingValue = 10)
+     * @return  a double[] array of the rounded values of the original data
      */
     public double[] roundColumn(double[] originalColumn, double roundingValue){
         double[] roundedColumn = new double[originalColumn.length];

src/java/cfa/guiDC_Model.java

@@ -47,7 +47,7 @@
     }
 }
 /**
-* Last Updated: 10-July-2014
+* Last Updated: 30-July-2014
 * @author Tyler Wible
 * @since 12-June-2011
 */
@@ -78,14 +78,14 @@
     String wqUnits = "?";
     String start = "?";
     String end = "?";
+    String summaryParagraph = "?";
+    String summaryTable = "?";
     String dataSource = "?";
     String lowFlowErrorMessage = "";
     double mQnVal = -1;
     
+    
     //Gets
-    public File getDurationCurve_summary() {
-        return new File(mainFolder, "duration_curve_summary.txt");
-    }
     public File getDurationCurve_results() {
         return new File(mainFolder, "duration_curve_results.txt");
     }
@@ -109,21 +109,27 @@
     public String getWQUnits() {
         return wqUnits;
     }
-    public String getLowFlowErrorMessage(){
-        return lowFlowErrorMessage;
-    }
-    public double getMQNval(){
-        return mQnVal;
-    }
     public String getStart() {
         return start;
     }
     public String getEnd() {
         return end;
     }
+    public String getSummaryParagraph(){
+        return summaryParagraph;
+    }
+    public String getSummaryTable(){
+        return summaryTable;
+    }
     public String getDataSource(){
         return dataSource;
     }
+    public String getLowFlowErrorMessage(){
+        return lowFlowErrorMessage;
+    }
+    public double getMQNval(){
+        return mQnVal;
+    }
     
     //Sets
     public void setMainFolder(String mainFolder) {
@@ -188,7 +194,7 @@
      * @throws IOException
      * @throws InterruptedException
      */
-    private String[] createFDC() throws IOException, InterruptedException, ParseException, Exception{
+    private void createFDC() throws IOException, InterruptedException, ParseException, Exception{
         //Inputs
 //        String mainFolder = the file location where the resulting load duration curve graph will be saved and the dynamic paragraph text file will be saved
 //        String fileName = the name of the graph and text file to be saved (the graph created will be fileNamegraph.txt and the txt file will be fileNameparagraph.txt)
@@ -256,6 +262,7 @@
         graphFDC(sortedData_combined, sortedData_user, mQn, m, n, mQnHide);
         
         //Attach analysis summary to return object
+        this.summaryParagraph = dynamicParagraph("Flow Duration Curve Overview: ");
         DoubleMath doubleMath = new DoubleMath();
         if(!mQnHide){
             if(!MQNmessage.equalsIgnoreCase("")){//if the MQNmessage is not blank add it to the dynamic summary
@@ -266,11 +273,6 @@
                 this.mQnVal =  doubleMath.round(mQn, 2);
             }
         }
-
-        //Create Display Paragraph
-        String[] partial_Paragraph = dynamicParagraph("Flow Duration Curve Overview: ");
-
-        return partial_Paragraph;
     }
     /**
      * Main graphing function for FDC analysis, plots the provided xyRanks as x,y points on a graph 
@@ -294,6 +296,9 @@
         DoubleArray doubleArray = new DoubleArray();
         double[][] xyRanks = doubleArray.weibullPlottingPosition(sortedData_combined);
 
+        //Determine summary table from xyRanks for duration curve
+        calculatePercentileSummmary(xyRanks, "Flow", "cfs");
+        
         //Graph the complete flow duration curve for the time period
         XYSeries FDC_xy = new XYSeries("FDC");
         XYSeries mQn_xy = new XYSeries(String.valueOf(m) + "Q" + String.valueOf(n) + " low flow");
@@ -429,7 +434,7 @@
         String graphTitle = "Flow Duration Curve for " + database + " Station " + stationID + "; " + stationName;
         JFreeChart chart = new JFreeChart(graphTitle, graphing.titleFont, plot, showLegend);
 
-        //Write a results file containing the flow duration curve interval (non-exceedence values) and their corresponding discharge values
+        //Write a results file containing the flow duration curve interval (exceedence values) and their corresponding discharge values
         writeResults(xyRanks, mainFolder, "Discharge (cfs)");
 
         //Save resulting graph for proof it works
@@ -450,7 +455,7 @@
      * @throws IOException
      * @throws InterruptedException
      */
-    private String[] createLDC() throws IOException, InterruptedException, ParseException {
+    private void createLDC() throws IOException, InterruptedException, ParseException {
 //        String mainFolder  the file location where the resulting load duration curve graph will be saved and the dynamic paragraph text file will be saved
 //        String fileName  the name of the graph and text file to be saved (the graph created will be fileNamegraph.txt and the txt file will be fileNameparagraph.txt)
 //        String organizationName  the name of the supervising agency of the current station, used to determine if data should be extracted from USGS or STORET
@@ -556,14 +561,14 @@
         String[][] seasonalWQ_user = doubleArray.getSeasonalData(WQdata_user, seasonBegin, seasonEnd);
 
         //Graph resulting LDC data
-        String yaxisTitle = WQlabel + " [" + endUnits + "]";
-        Object[] returnArray = graphLDC(yaxisTitle,conversion, sortedData_combined, sortedData_user, WQdata_combined, WQdata_user, seasonalWQ_combined, seasonalWQ_user,  mQn, m, n);
+        Object[] returnArray = graphLDC(WQlabel, endUnits, conversion, sortedData_combined, sortedData_user, WQdata_combined, WQdata_user, seasonalWQ_combined, seasonalWQ_user,  mQn, m, n);
         String paragraphTitle = (String) returnArray[0];
         double totalCount = (Double) returnArray[1];
 
         //Attach analysis summary to begin of dynamic paragraph
         this.wqLen = String.valueOf(totalCount);
         this.wqUnits = endUnits;
+        this.summaryParagraph = dynamicParagraph(paragraphTitle);
         DoubleMath doubleMath = new DoubleMath();
         if(!mQnHide){
             if(!MQNmessage.equalsIgnoreCase("")){//if the MQNmessage is not blank add it to the dynamic summary
@@ -572,15 +577,11 @@
                 this.mQnVal =  doubleMath.round(mQn, 2);
             }
         }
-
-        //Create display paragraph based on the above summary (firstLine) and the provided paragraphTitle for the LDC
-        String[] displayParagraph = dynamicParagraph(paragraphTitle);
-
-        return displayParagraph;
     }
     /**
      * Sub-graphing function to create combined-range graph
-     * @param yaxis_title  the desired y-axis title.
+     * @param WQlabel  the title of the water quality test being graphed
+     * @param endUnits the final load units of the water quality test * cfs * conversion = load/day
      * @param conversion
      * @param sortedData_combined  the load duration curve XY line data of combined data
      * @param sortedData_user  the load duration curve XY line data of user data only
@@ -594,7 +595,8 @@
      * @return the name/title of the dynamic paragraph to be created to accompany the graph created during this function
      * @throws IOException 
      */
-    private Object[] graphLDC(String yaxis_title,
+    private Object[] graphLDC(String WQlabel,
+                              String endUnits,
                               double conversion,
                               String[][] sortedData_combined,
                               String[][] sortedData_user,
@@ -609,9 +611,18 @@
         //Note: this data is already converted to loads, see "guiDC_Model.createLDC"
         DoubleArray doubleArray = new DoubleArray();
         double[][] xyRanks = doubleArray.weibullPlottingPosition(sortedData_combined);
+        
+        //Determine summary table from xyRanks for duration curve
+        double[][] loadRanks = new double[xyRanks.length][2];
+        for(int i=0; i<xyRanks.length; i++){
+            loadRanks[i][0] = xyRanks[i][0];
+            loadRanks[i][1] = xyRanks[i][1] * conversion * wqTarget;
+        }
+        calculatePercentileSummmary(loadRanks, "Load", endUnits);
 
         //Break scattered WQ points data into the 5 flow sub classifications 0-10, 10-40, 40-60, 60-90, 90-100
         //which are High flows, Moist conditions, Mid-range flows, Dry conditions, and low flows respectively Assimilative
+        String yaxis_title = WQlabel + " [" + endUnits + "]";
         XYSeries LDC_xy = new XYSeries("LDC");
         XYSeries LDC_user = new XYSeries("LDC User Data");
         XYSeries WQ_pts = new XYSeries("Water Quality Obs.");
@@ -1041,7 +1052,7 @@
         LegendTitle legendTitle = chart.getLegend();
         legendTitle.setItemFont(graphing.masterFont);
 
-        //Write a results file containing the flow duration curve interval (non-exceedence values) and their corresponding discharge values
+        //Write a results file containing the flow duration curve interval (exceedence values) and their corresponding discharge values
         writeResults(xyRanks, mainFolder, yaxis_title);
         
         //Save resulting graph
@@ -1057,6 +1068,28 @@
         Object[] returnArray = {paragraphTitle, totalCount};
         return returnArray;
     }
+    private void calculatePercentileSummmary(double[][] xyRanks, String title, String units){
+        DoubleMath doubleMath = new DoubleMath();
+        DoubleArray doubleArray = new DoubleArray();
+
+        //Hard coded percentile summary table
+        double[] frqDisp = {99, 95, 90, 75, 50, 25, 10, 5, 1};
+        String[] frqDispString = {"99", "95", "90", "75", "50", "25", "10", "5", "1"};
+        
+        //Interpolate desired percentiles
+        double[] yFinal = doubleMath.linearInterpolation(doubleArray.getColumn(xyRanks,0), doubleArray.getColumn(xyRanks,1), frqDisp);
+
+        //Round results for summary table
+        yFinal = doubleMath.roundColumn(yFinal, 100);
+
+        //Create summary table in a single string
+        this.summaryTable = "Exceedence Percentile\t" + title;     //row 1
+        summaryTable = summaryTable + "\n(%)\t" + units;  //row 2
+
+        for(int i=0; i<frqDisp.length; i++){
+            summaryTable = summaryTable + "\n" + frqDispString[i] + "\t" + String.valueOf(yFinal[i]);
+        }
+    }
     /**
      * Writes out the non-zero results of the duration curve analysis which are the flow duration curve intervale and their corresponding flow/load values
      * @param results  double[][] array to be written as each line of the text file
@@ -1079,7 +1112,7 @@
         PrintWriter printLine = new PrintWriter(writer);
 
         //Add Headers to text file
-        printLine.printf("%s" + "%n", "Flow Duration Interval (Non-Excedence Probability based on Weibull Plotting Position Ranking)\t" + resultType);
+        printLine.printf("%s" + "%n", "Flow Duration Interval (Excedence Probability based on Weibull Plotting Position Ranking)\t" + resultType);
 
         //Output data to text file
         for(int i=0; i < finalResults.size(); i++) {
@@ -1094,8 +1127,8 @@
      * @param paragraphTitle  title of the desired paragraph  
      * @return  the dynamic paragraph to be displayed to the user
      */
-    public String[] dynamicParagraph(String paragraphTitle) {
-        String[] dynamic_paragraph = new String[9];
+    public String dynamicParagraph(String paragraphTitle) {
+        String dynamic_paragraph = paragraphTitle + "\n\n";
         
         //Get today's date for the source reference
         Date currentDate = new Date();
@@ -1109,66 +1142,42 @@
         }else if(database.equalsIgnoreCase("STORET")){
             sourceText = "Stream flow data and water quality test data courtesy of the U.S. Environmental Protection Agency, STORET. http://www.epa.gov/storet/index.html accessed: " + today;
         }else if(database.equalsIgnoreCase("CDWR")){
-            this.dataSource = "Stream flow data and water quality test data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today;
+            sourceText = "Stream flow data and water quality test data courtesy of the Colorado Division of Water Resources, CDWR. http://www.dwr.state.co.us accessed: " + today;
         }
         this.dataSource = sourceText;
         
         //Create the correct dynamic paragraph
         if(paragraphTitle.equals("Point Sources and Wastewater Sources: ")){
-            dynamic_paragraph[1] = "When the target load duration curve is exceeded primarily under Low Flow and Dry Conditions flow intervals; point sources and wastewater source pollution are the likely cause.  Note: in order to have wastewater pollution source there must be an upstream wastewater plant discharging into the watershed.  Solutions to this problem may include but are not limited to: point source controls, septic system inspection programs, and sanitary sewer overflow repair (Cleland 2003).  In urban areas solutions might involve detecting illicit connections from storm water programs (Cleland 2007).  In agricultural settings, solutions may include fencing livestock from riparian areas along waterways, or other similar basic management practices (Cleland 2007).";
-            dynamic_paragraph[2] = "The grey graphed lines are duration curves for each individual year within the analysis period.";
+            dynamic_paragraph = dynamic_paragraph + "When the target load duration curve is exceeded primarily under Low Flow and Dry Conditions flow intervals; point sources and wastewater source pollution are the likely cause.  Note: in order to have wastewater pollution source there must be an upstream wastewater plant discharging into the watershed.  Solutions to this problem may include but are not limited to: point source controls, septic system inspection programs, and sanitary sewer overflow repair (Cleland 2003).  In urban areas solutions might involve detecting illicit connections from storm water programs (Cleland 2007).  In agricultural settings, solutions may include fencing livestock from riparian areas along waterways, or other similar basic management practices (Cleland 2007).\n";
+            dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n";
         }else if(paragraphTitle.equals("Upper Flow Sources: ")){
-            dynamic_paragraph[1] = "Upper flow sources are likely when the target is met except under the High Flows, Moist Conditions, and the upper end of Mid-Range Flows.    The higher flows under these regions, primarily above 55 percent, are likely due to large amounts of storm runoff.  These flows and sources are similar to those of wet-weather, but are due to larger runoff events and higher flows.  The increased pollution may be due to combined sewer overflows, storm water runoff from both up river and nearby, and pasture runoff from agricultural areas (Cleland 2003).  Solutions to this pollutant problem may include but are not limited to: combined sewer overflow repair, pasture management, and up river and nearby storm runoff solutions such as riparian buffers (Cleland 2003). In agricultural areas remediation efforts aimed towards grassed waterways, conservation tillage, pasture management practices, and contour strips may help alleviate these pollutions issues (Cleland 2007).";
-            dynamic_paragraph[2] = "The grey graphed lines are duration curves for each individual year within the analysis period.";
+            dynamic_paragraph = dynamic_paragraph + "Upper flow sources are likely when the target is met except under the High Flows, Moist Conditions, and the upper end of Mid-Range Flows.    The higher flows under these regions, primarily above 55 percent, are likely due to large amounts of storm runoff.  These flows and sources are similar to those of wet-weather, but are due to larger runoff events and higher flows.  The increased pollution may be due to combined sewer overflows, storm water runoff from both up river and nearby, and pasture runoff from agricultural areas (Cleland 2003).  Solutions to this pollutant problem may include but are not limited to: combined sewer overflow repair, pasture management, and up river and nearby storm runoff solutions such as riparian buffers (Cleland 2003). In agricultural areas remediation efforts aimed towards grassed waterways, conservation tillage, pasture management practices, and contour strips may help alleviate these pollutions issues (Cleland 2007).\n";
+            dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n";
         }else if(paragraphTitle.equals("Wet-Weather Sources: ")){
-            dynamic_paragraph[1] = "When the target load duration curve for pollution concentration is satisfied under the Low Flow and Dry Conditions flow intervals but becomes exceeded during Mid-Range Flows and Moist Conditions primarily above 70 percent flow interval, wet-weather related pollution sources are likely.  These mid-size flow rates tend to be the result of light storm runoff with increased pollutant transportation through riparian areas and from impervious regions.  Some solutions to these problems may include but are not limited to: riparian buffer zones, agricultural conservation tillage, contour strips, and grassed waterways (Cleland 2007). Combined sewer overflow repair, pet waste ordinances, and hobby farm livestock education may also alleviate the pollution problems due to these wet-weather sources (Cleland 2003).";
-            dynamic_paragraph[2] = "The grey graphed lines are duration curves for each individual year within the analysis period.";
+            dynamic_paragraph = dynamic_paragraph + "When the target load duration curve for pollution concentration is satisfied under the Low Flow and Dry Conditions flow intervals but becomes exceeded during Mid-Range Flows and Moist Conditions primarily above 70 percent flow interval, wet-weather related pollution sources are likely.  These mid-size flow rates tend to be the result of light storm runoff with increased pollutant transportation through riparian areas and from impervious regions.  Some solutions to these problems may include but are not limited to: riparian buffer zones, agricultural conservation tillage, contour strips, and grassed waterways (Cleland 2007). Combined sewer overflow repair, pet waste ordinances, and hobby farm livestock education may also alleviate the pollution problems due to these wet-weather sources (Cleland 2003).\n";
+            dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n";
         }else if(paragraphTitle.equals("Erosion Sources: ")){
-            dynamic_paragraph[1] = "Erosion based pollutant sources are likely when the target is met under all the flow intervals except under the High Flows and upper end of the Moist Conditions. Due to the higher velocities of the water during these flows, bank erosion and channel scour are more likely to occur and release pollutants (particularly sediment) into the water.  Solutions to this pollutant problem may include but are not limited to: river bank stabilization efforts and channel protection policies (Cleland 2007). Pollutants related to sediment concentration will be those most affected by these efforts.";
-            dynamic_paragraph[2] = "The grey graphed lines are duration curves for each individual year within the analysis period.";
+            dynamic_paragraph = dynamic_paragraph + "Erosion based pollutant sources are likely when the target is met under all the flow intervals except under the High Flows and upper end of the Moist Conditions. Due to the higher velocities of the water during these flows, bank erosion and channel scour are more likely to occur and release pollutants (particularly sediment) into the water.  Solutions to this pollutant problem may include but are not limited to: river bank stabilization efforts and channel protection policies (Cleland 2007). Pollutants related to sediment concentration will be those most affected by these efforts.\n";
+            dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n";
         }else if(paragraphTitle.equals("Multiple Pollution Sources: ")){
-            dynamic_paragraph[1] = "Most of the flow intervals contain many points which exceed the target.  No single pollution source is likely. Please click 'Further Information' for more pollutant identification help.";
-            dynamic_paragraph[2] = "The grey graphed lines are duration curves for each individual year within the analysis period.";
+            dynamic_paragraph = dynamic_paragraph + "Most of the flow intervals contain many points which exceed the target.  No single pollution source is likely. Please click 'Further Information' for more pollutant identification help.\n";
+            dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n";
         }else if(paragraphTitle.equals("Flow Duration Curve Overview: ")){
-            dynamic_paragraph[1] = "A flow duration curve (FDC) is the ranked graphing of river flows on a scale of percent exceedence.  For example a flow value associated with the flow interval of 15% means that particular flow value is met or exceeded only 15% of the time.  This graph is meant to give a quick overview of the flow ranges, variability, and probability of flows of a river segment during the different flow periods of a river; which are High Flows from 0 to 10 percent flow interval, Moist Conditions 10-40, Mid-Range Flows 40-60, Dry Conditions 60-90, and Low Flows 90-100 (Cleland 2003).";
-            dynamic_paragraph[2] = "The grey graphed lines are duration curves for each individual year within the analysis period.";
-        }else if(paragraphTitle.equals("Time Series Graph Overview: ")){
-            dynamic_paragraph[1] = "A time series graph is a straight scale graphing of available flow data with the oldest date on the bottom left and the most recent date on the bottom right with flows on the y axis.  This can be useful to identify hydrographs from storm runoff for small time frames (ie. less than a couple days worth of data points)";
-            dynamic_paragraph[2] = "";
+            dynamic_paragraph = dynamic_paragraph + "A flow duration curve (FDC) is the ranked graphing of river flows on a scale of percent exceedence.  For example a flow value associated with the flow interval of 15% means that particular flow value is met or exceeded only 15% of the time.  This graph is meant to give a quick overview of the flow ranges, variability, and probability of flows of a river segment during the different flow periods of a river; which are High Flows from 0 to 10 percent flow interval, Moist Conditions 10-40, Mid-Range Flows 40-60, Dry Conditions 60-90, and Low Flows 90-100 (Cleland 2003).\n";
+            dynamic_paragraph = dynamic_paragraph + "The grey graphed lines are duration curves for each individual year within the analysis period.\n";
         }else{
-            dynamic_paragraph[1] = "Although some observed points may exceed the target curve's concentration there is no single apparent pollutant source.";
-            dynamic_paragraph[2] = "Please click 'Further Model Information' for more pollutant source identification help.";
+            dynamic_paragraph = dynamic_paragraph + "Although some observed points may exceed the target curve's concentration there is no single apparent pollutant source.\n";
+            dynamic_paragraph = dynamic_paragraph + "Please click 'Further Model Information' for more pollutant source identification help.\n";
         }
         //Create references for paragraph
-        dynamic_paragraph[0] = paragraphTitle;
-        dynamic_paragraph[3] = "";
-        dynamic_paragraph[4] = "References:";
-        dynamic_paragraph[5] =  sourceText;
-        dynamic_paragraph[6] = "Cleland, B. R. November 2003. TMDL Development from the 'Bottom Up' Part III: Duration Curves and Wet-Weather Assessments. National TMDL Science and Policy 2003."; 
-        dynamic_paragraph[7] = "Cleland, B. R. August 2007. An Approach for Using Load Duration Curves in the Development of TMDLs. National TMDL Science and Policy 2007.";
+        dynamic_paragraph = dynamic_paragraph + "References:\n";
+        dynamic_paragraph = dynamic_paragraph + sourceText + "\n";
+        dynamic_paragraph = dynamic_paragraph + "Cleland, B. R. November 2003. TMDL Development from the 'Bottom Up' Part III: Duration Curves and Wet-Weather Assessments. National TMDL Science and Policy 2003.\n"; 
+        dynamic_paragraph = dynamic_paragraph + "Cleland, B. R. August 2007. An Approach for Using Load Duration Curves in the Development of TMDLs. National TMDL Science and Policy 2007.";
 
         return dynamic_paragraph;
     }
     /**
-     * Writes out the dynamically created paragraph to be displayed to the user along with the LDC graph
-     * @param dynamicParagraph  string array to be written as each line of the text file
-     * @throws IOException
-     */
-    public void writeParagraph(String[] dynamicParagraph) throws IOException{
-        String path = mainFolder + File.separator + getDurationCurve_summary().getName();
-        FileWriter writer =  new FileWriter(path, false);
-        PrintWriter print_line = new PrintWriter(writer);
-
-        //Output data to text file
-        for(int i = 0; i < dynamicParagraph.length; i++) {
-            print_line.printf("%s" + "%n", dynamicParagraph[i]);
-            System.out.println(dynamicParagraph[i]);
-        }
-        System.out.println("Text File located at:\t" + path);
-        print_line.close();
-        writer.close();
-    }
-    /**
      * Writes out the error message, if any, for finding the file and then exits the program
      * @param error  string array to be written as each line of an error message
      * @throws IOException
@@ -1209,15 +1218,11 @@
         }    
         
     //Determine which Duration Curve method to run, FDC or LDC
-    String[] dynamicParagraph = new String[9];
     if(modelType.equalsIgnoreCase("FDC")){
-            dynamicParagraph = createFDC();
+            createFDC();
     }else if(modelType.equalsIgnoreCase("LDC")){
-            dynamicParagraph = createLDC();
+            createLDC();
     }
-        
-        //Write dynamic Paragraph to text file
-        writeParagraph(dynamicParagraph);
     }
     public static void main(String[] args) throws IOException, InterruptedException, Exception {
         //Define and run model

src/java/m/cfa/Download_V1_0Req.json

@@ -17,13 +17,8 @@
       "value": "06752000"
     },
     {
-      "name": "station_name",
-      "description": "Station name",
-      "value": "CACHE LA POUDRE RIV AT MO OF CN, NR FT COLLINS, CO"
-    },
-    {
       "name": "wq_test",
-      "description": "Water Quality Test. If a USGS station can be 'flow', 'flood flow', '15-min flow', 'all' which retrieves all water quality data, or the 5 digit USGS water quality code like '00600' for total nitrogen. If it is a STORET station it can be 'flow', 'flood flow' which retrieves normal flow data for a user to later calculate annual maximums from, or the title of a water quality test in the STORET database like 'nitrogen'.",
+      "description": "Water Quality Test. If a USGS station can be 'flow', 'flood flow', '15-min flow', 'all' which retrieves all water quality data, the 5 digit USGS water quality code like '00600' for total nitrogen, or 'stage-discharge' to attempt retriving available rating curve data. If it is a STORET station it can be 'flow', 'flood flow' which retrieves normal flow data for a user to later calculate annual maximums from, or the title of a water quality test in the STORET database like 'nitrogen'. If it is a CDWR station it can be 'flow', 'flood flow' which retrieves normal flow data for a user to later calculate annual maximums from, or 'stage-discharge' to attempt retriving available rating curve data.",
       "value": "flow"
     },
     {

src/java/m/cfa/DurationCurve_V1_0.java

@@ -65,17 +65,17 @@
 
     @Override
     protected JSONArray createResults() throws Exception {
-        String summary = FileUtils.readFileToString(model.getDurationCurve_summary());
         JSONArray result = new JSONArray();
         result.put(JSONUtils.data("flow_len", model.getFlowLen()));
         result.put(JSONUtils.data("wq_len", model.getWQLen()));
         result.put(JSONUtils.data("wq_units", model.getWQUnits()));
         result.put(JSONUtils.data("start", model.getStart()));
         result.put(JSONUtils.data("end", model.getEnd()));
+        result.put(JSONUtils.data("duration_curve_summary", model.getSummaryParagraph()));
+        result.put(JSONUtils.data("duration_curve_table", model.getSummaryTable()));
         result.put(JSONUtils.data("data_source", model.getDataSource()));
         result.put(JSONUtils.data("mqn_val", model.getMQNval()));
         result.put(JSONUtils.data("low_flow_error_message", model.getLowFlowErrorMessage()));
-        result.put(JSONUtils.data("duration_curve_summary", summary));
         result.put(JSONUtils.data("graph", model.getGraph()));
         result.put(JSONUtils.data("result_file", model.getDurationCurve_results().getName()));
         result.put(JSONUtils.data("flow_statistics_summary",model.getFlowStatistics_summary().getName()));