Displaying differences for changeset
 
display as  

src/java/cfa/CDPHE_lowFlowStats.java

@@ -30,6 +30,9 @@
         DoubleArray doubleArray =  new DoubleArray();
         DoubleMath doubleMath = new DoubleMath();
         
+        if(flowData.length == 0){
+            return -1;
+        }
         int currentYear = Integer.parseInt(flowData[0][0].substring(0,4));
         int finalYear = Integer.parseInt(flowData[flowData.length - 1][0].substring(0,4));
 //        //Start by pulling the first complete water year (determine if this is necessary

src/java/cfa/Data.java

@@ -3,7 +3,7 @@
 import java.util.ArrayList;
 
 /**
-* Last Updated: 16-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible
 * @since 25-January-2014
 */
@@ -16,7 +16,11 @@
      * @param stationID  the station ID for which flow data is desired
      * @param beginDate  the begin date of desired flow data (yyyy-MM-dd)
      * @param endDate  the end date of desired flow data (yyyy-MM-dd)
-     * @param userData  a concatenated string of User Data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
+     * @param userData  a concatenated string of User data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
+     * @param useSTORETretrieval  a flag that if true uses this tool's built in STORET data retrieval 
+     * (which is slow). If false, it uses the data provided for the STORET station in "STORETdata" 
+     * (which is filled up by eRAMS's python call to STORET which is much faster)
+     * @param STORETdata  a concatenated string of STOERT data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
      * @return  a String[][] of all the flow data available for the specified period (column1 = date yyyy-MM-dd format, column2 = value)
      * @throws Exception 
      */
@@ -26,7 +30,9 @@
                                       String stationID,
                                       String beginDate,
                                       String endDate,
-                                      String userData) throws Exception{
+                                      String userData,
+                                      boolean useSTORETretrieval,
+                                      String STORETdata) throws Exception{
         //Depending on the provided inputs, search for and return flow data
         String[][] flowData = new String[0][2];
         if(database.equalsIgnoreCase("USGS")){
@@ -54,15 +60,23 @@
         }else if(database.equalsIgnoreCase("UserData")){
             //Find the user uploaded data file and uses this for a timeseries graph
             User_Data user_Data = new User_Data();
-            flowData = user_Data.readUserFile(userData, "flow", beginDate, endDate);
+            flowData = user_Data.readUserFile(database, userData, "flow", beginDate, endDate);
 
         }else if(database.equalsIgnoreCase("STORET")){
-            //Search for STORET peak flow data
-            STORET_Data storet_Data = new STORET_Data();
-            String zip_location = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "flow", beginDate, endDate);
+            //Search for STORET flow data
+            if(useSTORETretrieval){
+                //Search the STORET database using the built in functions (slow)
+                System.out.println("Calling STORET download...");
+                STORET_Data storet_Data = new STORET_Data();
+                String zip_location = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "flow", beginDate, endDate);
 
-            //Unzip results file and extract all flow data
-            flowData = storet_Data.Unzip_STORETDownloadFiles(zip_location, "flow", true);
+                //Unzip results file and extract all flow data
+                flowData = storet_Data.Unzip_STORETDownloadFiles(zip_location, "flow", true);
+            }else{
+                //Parse the data provided (much quicker)
+                User_Data user_Data = new User_Data();
+                flowData = user_Data.readUserFile(database, STORETdata, "flow", beginDate, endDate);
+            }
             
         }else if(database.equalsIgnoreCase("CDWR")){
             //Search for CDWR flow data
@@ -84,8 +98,12 @@
      * @param stationID  the station ID for which water quality data is desired
      * @param beginDate  the begin date of desired water quality data (yyyy-MM-dd)
      * @param endDate  the end date of desired water quality data (yyyy-MM-dd)
-     * @param userData  a concatenated string of User Data (tab-delimited) to extract water quality data from (column1 = date, column2 = value)
      * @param wqTest  the water quality test desired "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L" (format: "5-digit test-name -- units") or "flow"
+     * @param userData  a concatenated string of User data (tab-delimited) to extract water quality data from (column1 = date, column2 = value)
+     * @param useSTORETretrieval  a flag that if true uses this tool's built in STORET data retrieval 
+     * (which is slow). If false, it uses the data provided for the STORET station in "STORETdata" 
+     * (which is filled up by eRAMS's python call to STORET which is much faster)
+     * @param STORETdata  a concatenated string of User Data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
      * @return  a String[][] of all the specified water quality data available for the specified period (column1 = date yyyy-MM-dd format, column2 = value)
      * @throws IOException 
      * @throws InterruptedException 
@@ -96,13 +114,15 @@
                                   String stationID,
                                   String beginDate,
                                   String endDate,
+                                  String wqTest,
                                   String userData,
-                                  String wqTest) throws IOException, InterruptedException{
+                                  boolean useSTORETretrieval,
+                                  String STORETdata) throws IOException, InterruptedException{
         String[][] wqData = new String[0][2];
-        String wqCode = "??", wqLabel = "??", wqUnits = "??";
+        String wqLabel = "??", wqUnits = "??";
         if(database.equalsIgnoreCase("USGS")){
             String[] resultArray = getWQtestDataInfo(wqTest, database);
-            wqCode = resultArray[0];
+            String wqCode = resultArray[0];
             wqLabel = resultArray[1];
             wqUnits = resultArray[2];
             //double loadConversion = Double.parseDouble(resultArray[3]);
@@ -129,7 +149,7 @@
             
             //Find the user uploaded data file and uses this for a timeseries graph
             User_Data user_Data = new User_Data();
-            wqData = user_Data.readUserFile(userData, wqTest, beginDate, endDate);
+            wqData = user_Data.readUserFile(database, userData, wqTest, beginDate, endDate);
             
         }else if(database.equalsIgnoreCase("STORET")){
             String[] resultArray = getWQtestDataInfo(wqTest, database);
@@ -138,13 +158,21 @@
             wqUnits = resultArray[2];
             //double loadConversion = Double.parseDouble(resultArray[3]);
             //String endLoadUnits = resultArray[4];
-
-            //Search for STORET flow data
-            STORET_Data storet_Data = new STORET_Data();
-            String zipLocation = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "flow", beginDate, endDate);
             
-            //Unzip results file and extract all flow and WQ results
-            wqData = storet_Data.Unzip_STORETDownloadFiles(zipLocation, wqLabel, true);
+            //Search for STORET water quality data
+            if(useSTORETretrieval){
+                //Search the STORET database using the built in functions (slow)
+                System.out.println("Calling STORET download...");
+                STORET_Data storet_Data = new STORET_Data();
+                String zipLocation = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "flow", beginDate, endDate);
+                
+                //Unzip results file and extract all flow and WQ results
+                wqData = storet_Data.Unzip_STORETDownloadFiles(zipLocation, wqLabel, true);
+            }else{
+                //Parse the data provided (much quicker)
+                User_Data user_Data = new User_Data();
+                wqData = user_Data.readUserFile(database, STORETdata, wqTest, beginDate, endDate);
+            }
             
         }else if(database.equalsIgnoreCase("CDWR")){
             ArrayList<String> errorMessage = new ArrayList<String>();
@@ -163,9 +191,14 @@
      * @param stationID  the station ID for which flow and water quality data is desired
      * @param beginDate  the begin date of desired flow and water quality data (yyyy-MM-dd)
      * @param endDate  the end date of desired flow and water quality data (yyyy-MM-dd)
+     * @param wqTest  the water quality test desired "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L" (format: "5-digit test-name -- units")
      * @param userData  a concatenated string of User Data (tab-delimited) to extract flow (column1 = date, column2 = value) 
      * and water quality data (column1 = date, column2 = value) with a "$$" delimiter between the two types of data
-     * @param wqTest  the water quality test desired "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L" (format: "5-digit test-name -- units")
+     * @param useSTORETretrieval  a flag that if true uses this tool's built in STORET data retrieval 
+     * (which is slow). If false, it uses the data provided for the STORET station in "STORETdata" 
+     * (which is filled up by eRAMS's python call to STORET which is much faster)
+     * @param STORETdata  a concatenated string of STORET (tab-delimited) to extract flow (column1 = date, column2 = value) 
+     * and water quality data (column1 = date, column2 = value) with a "$$" delimiter between the two types of data
      * @return  a String[][] of all the specified water quality data available for the specified period (column1 = date yyyy-MM-dd format, column2 = value)
      * @throws IOException 
      * @throws InterruptedException 
@@ -176,8 +209,10 @@
                                            String stationID,
                                            String beginDate,
                                            String endDate,
+                                           String wqTest,
                                            String userData,
-                                           String wqTest) throws IOException, InterruptedException{
+                                           boolean useSTORETretrieval,
+                                           String STORETdata) throws IOException, InterruptedException{
         String[][] flowData = new String[0][2];
         String[][] wqData = new String[0][2];
         if(database.equalsIgnoreCase("USGS")){
@@ -212,25 +247,36 @@
         }else if(database.equalsIgnoreCase("UserData")){
             //Find the user uploaded data file and uses this for a timeseries graph
             User_Data user_Data = new User_Data();
-            Object[] returnArray = user_Data.readUserFileLDC(userData, wqTest, beginDate, endDate);
+            Object[] returnArray = user_Data.readUserFileLDC(database, userData, wqTest, beginDate, endDate);
             flowData = (String[][]) returnArray[0];
             wqData = (String[][]) returnArray[1];
             
         }else if(database.equalsIgnoreCase("STORET")){
-            String[] resultArray = getWQtestDataInfo(wqTest, database);
-            //String wqCode = resultArray[0];
-            String wqLabel = resultArray[1];
-            //String wqUnits = resultArray[2];
-            //double loadConversion = Double.parseDouble(resultArray[3]);
-            //String endLoadUnits = resultArray[4];
+            //Search for STORET flow and water quality data
+            if(useSTORETretrieval){
+                //Search the STORET database using the built in functions (slow)
+                System.out.println("Calling STORET download...");
+                STORET_Data storet_Data = new STORET_Data();
+                String zipLocation = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "all", beginDate, endDate);
+                
+                //Get result code to search for
+                String[] resultArray = getWQtestDataInfo(wqTest, database);
+                //String wqCode = resultArray[0];
+                String wqLabel = resultArray[1];
+                //String wqUnits = resultArray[2];
+                //double loadConversion = Double.parseDouble(resultArray[3]);
+                //String endLoadUnits = resultArray[4];
             
-            //Search for STORET flow data
-            STORET_Data storet_Data = new STORET_Data();
-            String zipLocation = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "all", beginDate, endDate);
-
-            //Unzip results file and extract all flow and WQ results
-            flowData = storet_Data.Unzip_STORETDownloadFiles(zipLocation, "flow", false);
-            wqData = storet_Data.Unzip_STORETDownloadFiles(zipLocation, wqLabel, true);
+                //Unzip results file and extract all flow and WQ results
+                flowData = storet_Data.Unzip_STORETDownloadFiles(zipLocation, "flow", false);
+                wqData = storet_Data.Unzip_STORETDownloadFiles(zipLocation, wqLabel, true);
+            }else{
+                //Parse the data provided (much quicker)
+                User_Data user_Data = new User_Data();
+                Object[] returnArray = user_Data.readUserFileLDC(database, STORETdata, wqTest, beginDate, endDate);
+                flowData = (String[][]) returnArray[0];
+                wqData = (String[][]) returnArray[1];
+            }
             
         }else if(database.equalsIgnoreCase("UserData")){
             ArrayList<String> errorMessage = new ArrayList<String>();
@@ -249,7 +295,11 @@
      * @param stationID  the station ID for which flow data is desired
      * @param beginDate  the begin date of desired flow data (yyyy-MM-dd)
      * @param endDate  the end date of desired flow data (yyyy-MM-dd)
-     * @param userData  a concatenated string of User Data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
+     * @param userData  a concatenated string of User data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
+     * @param useSTORETretrieval  a flag that if true uses this tool's built in STORET data retrieval 
+     * (which is slow). If false, it uses the data provided for the STORET station in "STORETdata" 
+     * (which is filled up by eRAMS's python call to STORET which is much faster)
+     * @param STORETdata  a concatenated string of STORET data (tab-delimited) to extract flow data from (column1 = date, column2 = value)
      * @return  a String[][] of all the flow data available for the specified period (column1 = date yyyy-MM-dd format, column2 = value)
      * @throws Exception 
      */
@@ -259,7 +309,9 @@
                                        String stationID,
                                        String beginDate,
                                        String endDate,
-                                       String userData) throws IOException, Exception{
+                                       String userData,
+                                       boolean useSTORETretrieval,
+                                       String STORETdata) throws IOException, Exception{
         DoubleArray doubleArray = new DoubleArray();
         
         double[][] peakFlowData = new double[0][0];
@@ -275,7 +327,7 @@
         }else if(database.equalsIgnoreCase("UserData")){
             //Find the user uploaded data file and uses this for a timeseries graph
             User_Data user_Data = new User_Data();
-            String[][] flowData = user_Data.readUserFile(userData, "flow", beginDate, endDate);
+            String[][] flowData = user_Data.readUserFile(database, userData, "flow", beginDate, endDate);
 
             //Removed duplicate dates
             flowData = doubleArray.removeDuplicateDates(flowData);
@@ -285,12 +337,20 @@
 
         }else if(database.equalsIgnoreCase("STORET")){
             //Search for STORET peak flow data
-            System.out.println("calling downloadSTORET");
-            STORET_Data storet_Data = new STORET_Data();
-            String zip_location = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "flow", beginDate, endDate);
+            String[][] flowData = new String[0][0];
+            if(useSTORETretrieval){
+                //Search the STORET database using the built in functions (slow)
+                System.out.println("Calling STORET download...");
+                STORET_Data storet_Data = new STORET_Data();
+                String zip_location = storet_Data.downloadSTORET(mainFolder, organizationName, stationID, "flow", beginDate, endDate);
 
-            //Unzip results file and extract all flow data
-            String[][] flowData = storet_Data.Unzip_STORETDownloadFiles(zip_location, "flow", true);
+                //Unzip results file and extract all flow data
+                flowData = storet_Data.Unzip_STORETDownloadFiles(zip_location, "flow", true);
+            }else{
+                //Parse the data provided (much quicker)
+                User_Data user_Data = new User_Data();
+                flowData = user_Data.readUserFile(database, STORETdata, "flow", beginDate, endDate);
+            }
             
             //Removed duplicate dates
             flowData = doubleArray.removeDuplicateDates(flowData);

src/java/cfa/User_Data.java

@@ -6,7 +6,7 @@
 import java.util.Date;
 
 /**
-* Last Updated: 16-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible
 * @since 12-July-2012
 */
@@ -72,6 +72,7 @@
     }
     /**
      * Opens and reads out the contents of the specified file to be used as flow and water quality data.
+     * @param database  the database from which to extract daily flow data (UserData or STORET)
      * @param userData_string  The tab-delimited contents of the user data file 
      * with header  The expected format of the string is a tab-delimited text 
      * file (\n separating lines) with dates in the first column and daily 
@@ -96,20 +97,21 @@
      * mg/L)
      * @throws IOException
      */
-    public Object[] readUserFileLDC(String userData_string, String wqTest, String beginDate, String endDate) throws IOException{
+    public Object[] readUserFileLDC(String database, String userData_string, String wqTest, String beginDate, String endDate) throws IOException{
         
         String[] userData_types = userData_string.split("\\$\\$");
         String userData_flow = userData_types[0];
         String userData_wq = userData_types[1];
         
-        String[][] flowData = readUserFile(userData_flow, "flow", beginDate, endDate);
-        String[][] wqData = readUserFile(userData_wq, wqTest, beginDate, endDate);
+        String[][] flowData = readUserFile(database, userData_flow, "flow", beginDate, endDate);
+        String[][] wqData = readUserFile(database, userData_wq, wqTest, beginDate, endDate);
         
         Object[] returnArray = {flowData, wqData};
         return returnArray;
     }
     /**
      * Opens and reads out the contents of the specified file to be used as flow data.
+     * @param database  the database from which to extract daily flow data (UserData or STORET)
      * @param userData_string  The tab-delimited contents of the user data file 
      * with header  The expected format of the string is a tab-delimited text 
      * file (\n separating lines) with dates in the first column and daily 
@@ -132,7 +134,7 @@
      * if there is not a value for column2 (blank, null, not a number, etc.) then no data will be kept for that date
      * @throws IOException
      */
-    public String[][] readUserFile(String userData_string, String wqTest, String beginDate, String endDate) throws IOException{
+    public String[][] readUserFile(String database, String userData_string, String wqTest, String beginDate, String endDate) throws IOException{
         //Get the wqCode out of wqTest
         Data data = new Data();
         String[] resultArray = data.getWQtestDataInfo(wqTest, "UserData");
@@ -153,7 +155,7 @@
         
         //Check for lack of data
         if(headerIndex == -1){
-            String errorContents = "There is no available uploaded data for " + wqTest;
+            String errorContents = "There is no available uploaded " + database + " data for " + wqTest;
             throw new IOException("Error encountered. Please see the following message for details: \n" + errorContents);
         }
         

src/java/cfa/guiBaseflow_Model.java

@@ -28,7 +28,7 @@
 import org.jfree.data.time.TimeSeries;
 
 /**
- * Last Updated: 21-January-2015
+ * Last Updated: 23-January-2015
  * @author Tyler Wible
  * @since 15-June-2012
  */
@@ -45,9 +45,11 @@
     String endDate = "";//"2002-09-01";
     int ndmin = 10;
     int ndmax = 10;
-    String userData =  "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";
+    boolean useSTORETretrieval = false;//true;// 
+    String STORETdata = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
     boolean mergeDatasets = false;//true;//
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
+    String userData =  "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";
     
     //Outputs
     String len = "-1";
@@ -183,8 +185,11 @@
     public void setNDMAX(int ndmax) {
         this.ndmax = ndmax;
     }
-    public void setUserData(String userData) {
-        this.userData = userData;
+    public void setUseSTORETretrieval(boolean useSTORETretrieval) {
+        this.useSTORETretrieval = useSTORETretrieval;
+    }
+    public void setSTORETdata(String STORETdata) {
+        this.STORETdata = STORETdata;
     }
     public void setMergeDatasets(boolean mergeDatasets) {
         this.mergeDatasets = mergeDatasets;
@@ -192,6 +197,9 @@
     public void setMergeMethod(String mergeMethod) {
         this.mergeMethod = mergeMethod;
     }
+    public void setUserData(String userData) {
+        this.userData = userData;
+    }
     /**
      * Takes the input String[][] and reformats it to the desired input for
      * BFLOW (a two column tab delimited file) which is: the first column of
@@ -995,13 +1003,13 @@
         
         //Check if any flow data exists
         Data data = new Data();
-        String[][] sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData);
+        String[][] sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, useSTORETretrieval, STORETdata);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
             User_Data user_Data = new User_Data();
-            sortableData_user = user_Data.readUserFile(userData, "flow", beginDate, endDate);
+            sortableData_user = user_Data.readUserFile("UserData", userData, "flow", beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries

src/java/cfa/guiDC_Model.java

@@ -26,7 +26,7 @@
 import org.jfree.data.xy.XYSeriesCollection;
 
 /**
-* Last Updated: 21-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible
 * @since 12-June-2011
 */
@@ -54,9 +54,11 @@
     double lowPercentile = 0.25;
     boolean showMonthlyStatsTF = false;
     String mQnPeriod = "false";//"7Q10";//
-    String userData = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1$$Date\t00600\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
+    boolean useSTORETretrieval = false;//true;// 
+    String STORETdata = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1$$Date\t00600\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
     boolean mergeDatasets = false;//true;//
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
+    String userData = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1$$Date\t00600\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
     
     //Outputs
     String flowLen = "-1";
@@ -204,8 +206,11 @@
     public void setMQNperiod(String mQnPeriod) {
         this.mQnPeriod = mQnPeriod;
     }
-    public void setUserData(String userData) {
-        this.userData = userData;
+    public void setUseSTORETretrieval(boolean useSTORETretrieval) {
+        this.useSTORETretrieval = useSTORETretrieval;
+    }
+    public void setSTORETdata(String STORETdata) {
+        this.STORETdata = STORETdata;
     }
     public void setMergeDatasets(boolean mergeDatasets) {
         this.mergeDatasets = mergeDatasets;
@@ -213,6 +218,9 @@
     public void setMergeMethod(String mergeMethod) {
         this.mergeMethod = mergeMethod;
     }
+    public void setUserData(String userData) {
+        this.userData = userData;
+    }
     /**
      * Main Flow Duration Curve (FDC) function
      * Creates a graph and dynamic summary for the graph, returns an image and text file in 
@@ -237,13 +245,13 @@
 
         //Check if any flow data exists
         Data data = new Data();
-        String[][] sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData);
+        String[][] sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, useSTORETretrieval, STORETdata);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
             User_Data user_Data = new User_Data();
-            sortableData_user = user_Data.readUserFile(userData, "flow", beginDate, endDate);
+            sortableData_user = user_Data.readUserFile("UserData", userData, "flow", beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries
@@ -588,7 +596,7 @@
 
         //Check if any flow and water quality data exists
         Data data = new Data();
-        Object[] returnArray1 = data.extractFlow_and_WQdata(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, wqTest);
+        Object[] returnArray1 = data.extractFlow_and_WQdata(mainFolder, database, organizationName, stationID, beginDate, endDate, wqTest, userData, useSTORETretrieval, STORETdata);
         String[][] sortableData = (String[][]) returnArray1[0];
         String[][] WQdata = (String[][]) returnArray1[1];
         
@@ -597,7 +605,7 @@
         String[][] WQdata_user = new String[0][0];
         if(mergeDatasets){
             User_Data user_Data = new User_Data();
-            Object[] returnArray2 = user_Data.readUserFileLDC(userData, wqTest, beginDate, endDate);
+            Object[] returnArray2 = user_Data.readUserFileLDC("UserData", userData, wqTest, beginDate, endDate);
             sortableData_user = (String[][]) returnArray2[0];
             WQdata_user = (String[][]) returnArray2[1];
         }

src/java/cfa/guiDrought_Model.java

@@ -44,7 +44,7 @@
 import org.jfree.ui.TextAnchor;
 
 /**
-* Last Updated: 21-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible
 * @since 10-July-2012
 */
@@ -62,9 +62,11 @@
     String phiValues    = "1";
     String thetaValues    = "";
     double droughtLimit    = -1;
-    String userData = "";//"Date\tFlow\n1997-04-29\t8.3\n1998-05-09\t60.2\n1999-05-29\t20.1";
+    boolean useSTORETretrieval = false;//true;// 
+    String STORETdata = "";//"Date\tFlow\n1997-04-29\t8.3\n1998-05-09\t60.2\n1999-05-29\t20.1";
     boolean mergeDatasets = false;//true;//
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
+    String userData = "";//"Date\tFlow\n1997-04-29\t8.3\n1998-05-09\t60.2\n1999-05-29\t20.1";
     
     //Outputs
     String len = "-1";
@@ -187,8 +189,11 @@
     public void setDroughtLimit(double droughtLimit) {
         this.droughtLimit = droughtLimit;
     }
-    public void setUserData(String userData) {
-        this.userData = userData;
+    public void setUseSTORETretrieval(boolean useSTORETretrieval) {
+        this.useSTORETretrieval = useSTORETretrieval;
+    }
+    public void setSTORETdata(String STORETdata) {
+        this.STORETdata = STORETdata;
     }
     public void setMergeDatasets(boolean mergeDatasets) {
         this.mergeDatasets = mergeDatasets;
@@ -196,6 +201,9 @@
     public void setMergeMethod(String mergeMethod) {
         this.mergeMethod = mergeMethod;
     }
+    public void setUserData(String userData) {
+        this.userData = userData;
+    }
     /**
      * Performs a drought analysis on the provided sortedData (daily average stream flow value) and calculates the long-term 
      * average water supply to be taken as the drought threshold.  First it calculates total annual river flows based on the 
@@ -1254,13 +1262,13 @@
 
         //Check if any flow data exists
         Data data = new Data();
-        String[][] sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData);
+        String[][] sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, useSTORETretrieval, STORETdata);
         
         //If the user wants the datasets (public and user) merged then retrieve the second dataset (user)
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
             User_Data user_Data = new User_Data();
-            sortableData_user = user_Data.readUserFile(userData, "flow", beginDate, endDate);
+            sortableData_user = user_Data.readUserFile("UserData", userData, "flow", beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries

src/java/cfa/guiFlood_Model.java

@@ -11,7 +11,7 @@
 import org.apache.commons.math.ArgumentOutsideDomainException;
 
 /**
-* Last Updated: 21-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible
 * @since 13-June-2012
 */
@@ -29,9 +29,11 @@
     boolean showLargeFloods = false;
     boolean plotref = true;
     boolean plottype = true;
-    String userData  = "";//"Date\tFlow\n2012-04-29\t80000.3\n2013-05-09\t60.2\n2014-05-29\t20.1";
+    boolean useSTORETretrieval = false;//true;// 
+    String STORETdata = "";//"Date\tFlow\n2012-04-29\t80000.3\n2013-05-09\t60.2\n2014-05-29\t20.1";
     boolean mergeDatasets = false;//true;//
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
+    String userData  = "";//"Date\tFlow\n2012-04-29\t80000.3\n2013-05-09\t60.2\n2014-05-29\t20.1";
     
     //Outputs
     String len = "-1";
@@ -100,8 +102,11 @@
     public void setPlotReference(boolean plotref) {
         this.plotref = plotref;
     }
-    public void setUserData(String userData) {
-        this.userData = userData;
+    public void setUseSTORETretrieval(boolean useSTORETretrieval) {
+        this.useSTORETretrieval = useSTORETretrieval;
+    }
+    public void setSTORETdata(String STORETdata) {
+        this.STORETdata = STORETdata;
     }
     public void setMergeDatasets(boolean mergeDatasets) {
         this.mergeDatasets = mergeDatasets;
@@ -109,6 +114,9 @@
     public void setMergeMethod(String mergeMethod) {
         this.mergeMethod = mergeMethod;
     }
+    public void setUserData(String userData) {
+        this.userData = userData;
+    }
     /**
      * Writes out the dynamically created summary table to be displayed to the user along with the flood graph.  
      * This function exits when completed
@@ -166,12 +174,12 @@
         if(analysisType.equalsIgnoreCase("B17")){
             //Check if any flow data exists
             Data data = new Data();
-            double[][] peakFlowData = data.extractFloodData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData);
+            double[][] peakFlowData = data.extractFloodData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, useSTORETretrieval, STORETdata);
             
             //Check if merging the datasets is desired, if so get the user data
             double[][] peakFlowData_user = new double[0][0];
             if(mergeDatasets){
-                peakFlowData_user = data.extractFloodData(mainFolder, "UserData", "", "", beginDate, endDate, userData);
+                peakFlowData_user = data.extractFloodData(mainFolder, "UserData", "", "", beginDate, endDate, userData, useSTORETretrieval, STORETdata);
             }
             
             //Merge the two datasets (if user data is empty nothing will be merged)

src/java/cfa/guiLOADEST_Model.java

@@ -17,7 +17,7 @@
 
 
 /**
-* Last Updated: 21-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible & Tyler Dell
 * @since 27-March-2013
 */
@@ -28,7 +28,7 @@
     String organizationName = "USGS";//"Co. Division of Water Resources";//"Colorado Dept. of Public Health & Environment";//
     String stationID = "06741510";//"CLAGRECO";//"000028";//
     String stationName = "BIG THOMPSON RIVER AT LOVELAND, CO.";//"Cache La Poudre Near Greeley";//"BIG THOMPSON R NEAR MOUTH";//
-    String wqTest = "00600        Total nitrogen, water, unfiltered, milligrams per liter, mg/L";
+    String wqTest = "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L";//"00625 Ammonia-nitrogen as N -- mg/L";//
     int PTOPT = 1; // estimated values print option (0,1)
     int SEOPT = 2; // standard error option (1-3)
     int LDOPT = 0; // load option (0-3), if load option is 1 or 3 then need the number of user-defined seasons
@@ -39,10 +39,13 @@
     int ULFLAG = 4; // the desired output units (1-4)
     String beginDate = "";
     String endDate = "";
-    String userData = "";//"Date\tFlow\n1994-01-01\t37\n1994-01-02\t39\n1994-01-03\t40\n1994-01-04\t40\n1994-01-05\t40\n1994-01-06\t38\n1994-01-07\t44\n1994-01-08\t37\n1994-01-09\t37\n1994-01-10\t37\n1994-01-11\t35\n1994-01-12\t31\n1994-01-13\t31\n1994-01-14\t27\n1994-01-15\t27\n1994-01-16\t32\n1994-01-17\t25\n1994-01-18\t25\n1994-01-19\t29\n1994-01-20\t32\n1994-01-21\t31\n1994-01-22\t24\n1994-01-23\t29\n1994-01-24\t26\n1994-01-25\t31\n1994-01-26\t30\n1994-01-27\t30\n1994-01-28\t30\n1994-01-29\t24\n1994-01-30\t25\n1994-01-31\t24\n1994-02-01\t28\n1994-02-02\t26\n1994-02-03\t25\n1994-02-04\t26\n1994-02-05\t27\n1994-02-06\t26\n1994-02-07\t25\n1994-02-08\t27\n1994-02-09\t23\n1994-02-10\t22\n1994-02-11\t26\n1994-02-12\t29\n1994-02-13\t26\n1994-02-14\t26\n1994-02-15\t38\n1994-02-16\t40\n1994-02-17\t42\n1994-02-18\t41\n1994-02-19\t44\n1994-02-20\t44\n1994-02-21\t41\n1994-02-22\t34\n1994-02-23\t30\n1994-02-24\t34\n1994-02-25\t34\n1994-02-26\t36\n1994-02-27\t39\n1994-02-28\t54\n1994-03-01\t50\n1994-03-02\t49\n1994-03-03\t51\n1994-03-04\t51\n1994-03-05\t52\n1994-03-06\t54\n1994-03-07\t56\n1994-03-08\t51\n1994-03-09\t43\n1994-03-10\t54\n1994-03-11\t50\n1994-03-12\t46\n1994-03-13\t49\n1994-03-14\t51\n1994-03-15\t50\n1994-03-16\t48\n1994-03-17\t32\n1994-03-18\t56\n1994-03-19\t55\n1994-03-20\t59\n1994-03-21\t55\n1994-03-22\t43\n1994-03-23\t48\n1994-03-24\t46\n1994-03-25\t42\n1994-03-26\t43\n1994-03-27\t35\n1994-03-28\t28\n1994-03-29\t42\n1994-03-30\t38\n1994-03-31\t40\n1994-04-01\t41\n1994-04-02\t41\n1994-04-03\t39\n1994-04-04\t39\n1994-04-05\t41\n1994-04-06\t38\n1994-04-07\t36\n1994-04-08\t35\n1994-04-09\t37\n1994-04-10\t43\n1994-04-11\t41\n1994-04-12\t56\n1994-04-13\t56\n1994-04-14\t52\n1994-04-15\t56\n1994-04-16\t53\n1994-04-17\t56\n1994-04-18\t64\n1994-04-19\t69\n1994-04-20\t76\n1994-04-21\t87\n1994-04-22\t102\n1994-04-23\t130\n1994-04-24\t171\n1994-04-25\t244\n1994-04-26\t223\n1994-04-27\t176\n1994-04-28\t163\n1994-04-29\t158\n1994-04-30\t137\n1994-05-01\t138\n1994-05-02\t138\n1994-05-03\t136\n1994-05-04\t149\n1994-05-05\t149\n1994-05-06\t147\n1994-05-07\t188\n1994-05-08\t291\n1994-05-09\t401\n1994-05-10\t528\n1994-05-11\t476\n1994-05-12\t598\n1994-05-13\t752\n1994-05-14\t874\n1994-05-15\t1030\n1994-05-16\t1050\n1994-05-17\t1310\n1994-05-18\t1180\n1994-05-19\t1130\n1994-05-20\t1270\n1994-05-21\t1100\n1994-05-22\t1110\n1994-05-23\t1200\n1994-05-24\t1090\n1994-05-25\t1090\n1994-05-26\t1180\n1994-05-27\t1160\n1994-05-28\t1270\n1994-05-29\t1350\n1994-05-30\t1390\n1994-05-31\t1490\n1994-06-01\t1590\n1994-06-02\t1380\n1994-06-03\t1220\n1994-06-04\t1210\n1994-06-05\t1250\n1994-06-06\t1270\n1994-06-07\t1190\n1994-06-08\t1010\n1994-06-09\t1040\n1994-06-10\t953\n1994-06-11\t960\n1994-06-12\t916\n1994-06-13\t757\n1994-06-14\t692\n1994-06-15\t702\n1994-06-16\t722\n1994-06-17\t714\n1994-06-18\t700\n1994-06-19\t703\n1994-06-20\t767\n1994-06-21\t819\n1994-06-22\t764\n1994-06-23\t764\n1994-06-24\t686\n1994-06-25\t585\n1994-06-26\t499\n1994-06-27\t420\n1994-06-28\t385\n1994-06-29\t335\n1994-06-30\t278\n1994-07-01\t246\n1994-07-02\t274\n1994-07-03\t291\n1994-07-04\t312\n1994-07-05\t254\n1994-07-06\t175\n1994-07-07\t226\n1994-07-08\t297\n1994-07-09\t233\n1994-07-10\t155\n1994-07-11\t219\n1994-07-12\t254\n1994-07-13\t261\n1994-07-14\t268\n1994-07-15\t229\n1994-07-16\t185\n1994-07-17\t185\n1994-07-18\t267\n1994-07-19\t305\n1994-07-20\t303\n1994-07-21\t300\n1994-07-22\t276\n1994-07-23\t269\n1994-07-24\t327\n1994-07-25\t308\n1994-07-26\t296\n1994-07-27\t268\n1994-07-28\t248\n1994-07-29\t224\n1994-07-30\t215\n1994-07-31\t203\n1994-08-01\t237\n1994-08-02\t302\n1994-08-03\t350\n1994-08-04\t345\n1994-08-05\t346\n1994-08-06\t336\n1994-08-07\t315\n1994-08-08\t293\n1994-08-09\t289\n1994-08-10\t296\n1994-08-11\t319\n1994-08-12\t316\n1994-08-13\t305\n1994-08-14\t306\n1994-08-15\t291\n1994-08-16\t189\n1994-08-17\t160\n1994-08-18\t144\n1994-08-19\t154\n1994-08-20\t251\n1994-08-21\t264\n1994-08-22\t255\n1994-08-23\t245\n1994-08-24\t243\n1994-08-25\t227\n1994-08-26\t207\n1994-08-27\t147\n1994-08-28\t132\n1994-08-29\t122\n1994-08-30\t70\n1994-08-31\t68\n1994-09-01\t57\n1994-09-02\t61\n1994-09-03\t82\n1994-09-04\t102\n1994-09-05\t119\n1994-09-06\t119\n1994-09-07\t123\n1994-09-08\t108\n1994-09-09\t76\n1994-09-10\t48\n1994-09-11\t47\n1994-09-12\t45\n1994-09-13\t43\n1994-09-14\t47\n1994-09-15\t53\n1994-09-16\t46\n1994-09-17\t35\n1994-09-18\t35\n1994-09-19\t34\n1994-09-20\t35\n1994-09-21\t40\n1994-09-22\t72\n1994-09-23\t83\n1994-09-24\t65\n1994-09-25\t46\n1994-09-26\t39\n1994-09-27\t33\n1994-09-28\t26\n1994-09-29\t23\n1994-09-30\t22\n1994-10-01\t20\n1994-10-02\t27\n1994-10-03\t28\n1994-10-04\t33\n1994-10-05\t27\n1994-10-06\t23\n1994-10-07\t31\n1994-10-08\t28\n1994-10-09\t24\n1994-10-10\t21\n1994-10-11\t21\n1994-10-12\t21\n1994-10-13\t21\n1994-10-14\t18\n1994-10-15\t18\n1994-10-16\t18\n1994-10-17\t26\n1994-10-18\t27\n1994-10-19\t19\n1994-10-20\t12\n1994-10-21\t15\n1994-10-22\t13\n1994-10-23\t17\n1994-10-24\t21\n1994-10-25\t17\n1994-10-26\t18\n1994-10-27\t17\n1994-10-28\t18\n1994-10-29\t22\n1994-10-30\t24\n1994-10-31\t28\n1994-11-01\t21\n1994-11-02\t17\n1994-11-03\t22\n1994-11-04\t23\n1994-11-05\t13\n1994-11-06\t25\n1994-11-07\t30\n1994-11-08\t32\n1994-11-09\t25\n1994-11-10\t15\n1994-11-11\t18\n1994-11-12\t22\n1994-11-13\t28\n1994-11-14\t21\n1994-11-15\t6.8\n1994-11-16\t6.0\n1994-11-17\t15\n1994-11-18\t18\n1994-11-19\t23\n1994-11-20\t28\n1994-11-21\t34\n1994-11-22\t36\n1994-11-23\t21\n1994-11-24\t13\n1994-11-25\t23\n1994-11-26\t37\n1994-11-27\t29\n1994-11-28\t10\n1994-11-29\t11\n1994-11-30\t15\n1994-12-01\t28\n1994-12-02\t60\n1994-12-03\t62\n1994-12-04\t36\n1994-12-05\t22\n1994-12-06\t31\n1994-12-07\t23\n1994-12-08\t25\n1994-12-09\t12\n1994-12-10\t15\n1994-12-11\t24\n1994-12-12\t24\n1994-12-13\t31\n1994-12-14\t35\n1994-12-15\t34\n1994-12-16\t37\n1994-12-17\t32\n1994-12-18\t21\n1994-12-19\t21\n1994-12-20\t22\n1994-12-21\t22\n1994-12-22\t22\n1994-12-23\t19\n1994-12-24\t21\n1994-12-25\t22\n1994-12-26\t22\n1994-12-27\t23\n1994-12-28\t23\n1994-12-29\t22\n1994-12-30\t26\n1994-12-31\t22\n1995-01-01\t22"
+    boolean useSTORETretrieval = false;//true;// 
+    String STORETdata = "";//"Date\tFlow\n1994-01-01\t37\n1994-01-02\t39\n1994-01-03\t40\n1994-01-04\t40\n1994-01-05\t40\n1994-01-06\t38\n1994-01-07\t44\n1994-01-08\t37\n1994-01-09\t37\n1994-01-10\t37\n1994-01-11\t35\n1994-01-12\t31\n1994-01-13\t31\n1994-01-14\t27\n1994-01-15\t27\n1994-01-16\t32\n1994-01-17\t25\n1994-01-18\t25\n1994-01-19\t29\n1994-01-20\t32\n1994-01-21\t31\n1994-01-22\t24\n1994-01-23\t29\n1994-01-24\t26\n1994-01-25\t31\n1994-01-26\t30\n1994-01-27\t30\n1994-01-28\t30\n1994-01-29\t24\n1994-01-30\t25\n1994-01-31\t24\n1994-02-01\t28\n1994-02-02\t26\n1994-02-03\t25\n1994-02-04\t26\n1994-02-05\t27\n1994-02-06\t26\n1994-02-07\t25\n1994-02-08\t27\n1994-02-09\t23\n1994-02-10\t22\n1994-02-11\t26\n1994-02-12\t29\n1994-02-13\t26\n1994-02-14\t26\n1994-02-15\t38\n1994-02-16\t40\n1994-02-17\t42\n1994-02-18\t41\n1994-02-19\t44\n1994-02-20\t44\n1994-02-21\t41\n1994-02-22\t34\n1994-02-23\t30\n1994-02-24\t34\n1994-02-25\t34\n1994-02-26\t36\n1994-02-27\t39\n1994-02-28\t54\n1994-03-01\t50\n1994-03-02\t49\n1994-03-03\t51\n1994-03-04\t51\n1994-03-05\t52\n1994-03-06\t54\n1994-03-07\t56\n1994-03-08\t51\n1994-03-09\t43\n1994-03-10\t54\n1994-03-11\t50\n1994-03-12\t46\n1994-03-13\t49\n1994-03-14\t51\n1994-03-15\t50\n1994-03-16\t48\n1994-03-17\t32\n1994-03-18\t56\n1994-03-19\t55\n1994-03-20\t59\n1994-03-21\t55\n1994-03-22\t43\n1994-03-23\t48\n1994-03-24\t46\n1994-03-25\t42\n1994-03-26\t43\n1994-03-27\t35\n1994-03-28\t28\n1994-03-29\t42\n1994-03-30\t38\n1994-03-31\t40\n1994-04-01\t41\n1994-04-02\t41\n1994-04-03\t39\n1994-04-04\t39\n1994-04-05\t41\n1994-04-06\t38\n1994-04-07\t36\n1994-04-08\t35\n1994-04-09\t37\n1994-04-10\t43\n1994-04-11\t41\n1994-04-12\t56\n1994-04-13\t56\n1994-04-14\t52\n1994-04-15\t56\n1994-04-16\t53\n1994-04-17\t56\n1994-04-18\t64\n1994-04-19\t69\n1994-04-20\t76\n1994-04-21\t87\n1994-04-22\t102\n1994-04-23\t130\n1994-04-24\t171\n1994-04-25\t244\n1994-04-26\t223\n1994-04-27\t176\n1994-04-28\t163\n1994-04-29\t158\n1994-04-30\t137\n1994-05-01\t138\n1994-05-02\t138\n1994-05-03\t136\n1994-05-04\t149\n1994-05-05\t149\n1994-05-06\t147\n1994-05-07\t188\n1994-05-08\t291\n1994-05-09\t401\n1994-05-10\t528\n1994-05-11\t476\n1994-05-12\t598\n1994-05-13\t752\n1994-05-14\t874\n1994-05-15\t1030\n1994-05-16\t1050\n1994-05-17\t1310\n1994-05-18\t1180\n1994-05-19\t1130\n1994-05-20\t1270\n1994-05-21\t1100\n1994-05-22\t1110\n1994-05-23\t1200\n1994-05-24\t1090\n1994-05-25\t1090\n1994-05-26\t1180\n1994-05-27\t1160\n1994-05-28\t1270\n1994-05-29\t1350\n1994-05-30\t1390\n1994-05-31\t1490\n1994-06-01\t1590\n1994-06-02\t1380\n1994-06-03\t1220\n1994-06-04\t1210\n1994-06-05\t1250\n1994-06-06\t1270\n1994-06-07\t1190\n1994-06-08\t1010\n1994-06-09\t1040\n1994-06-10\t953\n1994-06-11\t960\n1994-06-12\t916\n1994-06-13\t757\n1994-06-14\t692\n1994-06-15\t702\n1994-06-16\t722\n1994-06-17\t714\n1994-06-18\t700\n1994-06-19\t703\n1994-06-20\t767\n1994-06-21\t819\n1994-06-22\t764\n1994-06-23\t764\n1994-06-24\t686\n1994-06-25\t585\n1994-06-26\t499\n1994-06-27\t420\n1994-06-28\t385\n1994-06-29\t335\n1994-06-30\t278\n1994-07-01\t246\n1994-07-02\t274\n1994-07-03\t291\n1994-07-04\t312\n1994-07-05\t254\n1994-07-06\t175\n1994-07-07\t226\n1994-07-08\t297\n1994-07-09\t233\n1994-07-10\t155\n1994-07-11\t219\n1994-07-12\t254\n1994-07-13\t261\n1994-07-14\t268\n1994-07-15\t229\n1994-07-16\t185\n1994-07-17\t185\n1994-07-18\t267\n1994-07-19\t305\n1994-07-20\t303\n1994-07-21\t300\n1994-07-22\t276\n1994-07-23\t269\n1994-07-24\t327\n1994-07-25\t308\n1994-07-26\t296\n1994-07-27\t268\n1994-07-28\t248\n1994-07-29\t224\n1994-07-30\t215\n1994-07-31\t203\n1994-08-01\t237\n1994-08-02\t302\n1994-08-03\t350\n1994-08-04\t345\n1994-08-05\t346\n1994-08-06\t336\n1994-08-07\t315\n1994-08-08\t293\n1994-08-09\t289\n1994-08-10\t296\n1994-08-11\t319\n1994-08-12\t316\n1994-08-13\t305\n1994-08-14\t306\n1994-08-15\t291\n1994-08-16\t189\n1994-08-17\t160\n1994-08-18\t144\n1994-08-19\t154\n1994-08-20\t251\n1994-08-21\t264\n1994-08-22\t255\n1994-08-23\t245\n1994-08-24\t243\n1994-08-25\t227\n1994-08-26\t207\n1994-08-27\t147\n1994-08-28\t132\n1994-08-29\t122\n1994-08-30\t70\n1994-08-31\t68\n1994-09-01\t57\n1994-09-02\t61\n1994-09-03\t82\n1994-09-04\t102\n1994-09-05\t119\n1994-09-06\t119\n1994-09-07\t123\n1994-09-08\t108\n1994-09-09\t76\n1994-09-10\t48\n1994-09-11\t47\n1994-09-12\t45\n1994-09-13\t43\n1994-09-14\t47\n1994-09-15\t53\n1994-09-16\t46\n1994-09-17\t35\n1994-09-18\t35\n1994-09-19\t34\n1994-09-20\t35\n1994-09-21\t40\n1994-09-22\t72\n1994-09-23\t83\n1994-09-24\t65\n1994-09-25\t46\n1994-09-26\t39\n1994-09-27\t33\n1994-09-28\t26\n1994-09-29\t23\n1994-09-30\t22\n1994-10-01\t20\n1994-10-02\t27\n1994-10-03\t28\n1994-10-04\t33\n1994-10-05\t27\n1994-10-06\t23\n1994-10-07\t31\n1994-10-08\t28\n1994-10-09\t24\n1994-10-10\t21\n1994-10-11\t21\n1994-10-12\t21\n1994-10-13\t21\n1994-10-14\t18\n1994-10-15\t18\n1994-10-16\t18\n1994-10-17\t26\n1994-10-18\t27\n1994-10-19\t19\n1994-10-20\t12\n1994-10-21\t15\n1994-10-22\t13\n1994-10-23\t17\n1994-10-24\t21\n1994-10-25\t17\n1994-10-26\t18\n1994-10-27\t17\n1994-10-28\t18\n1994-10-29\t22\n1994-10-30\t24\n1994-10-31\t28\n1994-11-01\t21\n1994-11-02\t17\n1994-11-03\t22\n1994-11-04\t23\n1994-11-05\t13\n1994-11-06\t25\n1994-11-07\t30\n1994-11-08\t32\n1994-11-09\t25\n1994-11-10\t15\n1994-11-11\t18\n1994-11-12\t22\n1994-11-13\t28\n1994-11-14\t21\n1994-11-15\t6.8\n1994-11-16\t6.0\n1994-11-17\t15\n1994-11-18\t18\n1994-11-19\t23\n1994-11-20\t28\n1994-11-21\t34\n1994-11-22\t36\n1994-11-23\t21\n1994-11-24\t13\n1994-11-25\t23\n1994-11-26\t37\n1994-11-27\t29\n1994-11-28\t10\n1994-11-29\t11\n1994-11-30\t15\n1994-12-01\t28\n1994-12-02\t60\n1994-12-03\t62\n1994-12-04\t36\n1994-12-05\t22\n1994-12-06\t31\n1994-12-07\t23\n1994-12-08\t25\n1994-12-09\t12\n1994-12-10\t15\n1994-12-11\t24\n1994-12-12\t24\n1994-12-13\t31\n1994-12-14\t35\n1994-12-15\t34\n1994-12-16\t37\n1994-12-17\t32\n1994-12-18\t21\n1994-12-19\t21\n1994-12-20\t22\n1994-12-21\t22\n1994-12-22\t22\n1994-12-23\t19\n1994-12-24\t21\n1994-12-25\t22\n1994-12-26\t22\n1994-12-27\t23\n1994-12-28\t23\n1994-12-29\t22\n1994-12-30\t26\n1994-12-31\t22\n1995-01-01\t22"
             //+ "$$Date\t00600\n1994-01-03\tnodata\n1994-01-13\t0.28\n1994-02-16\t0.29\n1994-03-07\t0.25\n1994-04-20\t0.25\n1994-05-03\t0.25\n1994-06-07\t0.25\n1994-06-14\t0.25\n1994-07-06\t0.25\n1994-08-04\t0.25\n1994-09-02\t0.28\n1994-10-11\t0.25\n1994-11-22\t0.33\n1994-12-13\t0.59";
     boolean mergeDatasets = false;//true;// 
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
+    String userData = "";//"Date\tFlow\n1994-01-01\t37\n1994-01-02\t39\n1994-01-03\t40\n1994-01-04\t40\n1994-01-05\t40\n1994-01-06\t38\n1994-01-07\t44\n1994-01-08\t37\n1994-01-09\t37\n1994-01-10\t37\n1994-01-11\t35\n1994-01-12\t31\n1994-01-13\t31\n1994-01-14\t27\n1994-01-15\t27\n1994-01-16\t32\n1994-01-17\t25\n1994-01-18\t25\n1994-01-19\t29\n1994-01-20\t32\n1994-01-21\t31\n1994-01-22\t24\n1994-01-23\t29\n1994-01-24\t26\n1994-01-25\t31\n1994-01-26\t30\n1994-01-27\t30\n1994-01-28\t30\n1994-01-29\t24\n1994-01-30\t25\n1994-01-31\t24\n1994-02-01\t28\n1994-02-02\t26\n1994-02-03\t25\n1994-02-04\t26\n1994-02-05\t27\n1994-02-06\t26\n1994-02-07\t25\n1994-02-08\t27\n1994-02-09\t23\n1994-02-10\t22\n1994-02-11\t26\n1994-02-12\t29\n1994-02-13\t26\n1994-02-14\t26\n1994-02-15\t38\n1994-02-16\t40\n1994-02-17\t42\n1994-02-18\t41\n1994-02-19\t44\n1994-02-20\t44\n1994-02-21\t41\n1994-02-22\t34\n1994-02-23\t30\n1994-02-24\t34\n1994-02-25\t34\n1994-02-26\t36\n1994-02-27\t39\n1994-02-28\t54\n1994-03-01\t50\n1994-03-02\t49\n1994-03-03\t51\n1994-03-04\t51\n1994-03-05\t52\n1994-03-06\t54\n1994-03-07\t56\n1994-03-08\t51\n1994-03-09\t43\n1994-03-10\t54\n1994-03-11\t50\n1994-03-12\t46\n1994-03-13\t49\n1994-03-14\t51\n1994-03-15\t50\n1994-03-16\t48\n1994-03-17\t32\n1994-03-18\t56\n1994-03-19\t55\n1994-03-20\t59\n1994-03-21\t55\n1994-03-22\t43\n1994-03-23\t48\n1994-03-24\t46\n1994-03-25\t42\n1994-03-26\t43\n1994-03-27\t35\n1994-03-28\t28\n1994-03-29\t42\n1994-03-30\t38\n1994-03-31\t40\n1994-04-01\t41\n1994-04-02\t41\n1994-04-03\t39\n1994-04-04\t39\n1994-04-05\t41\n1994-04-06\t38\n1994-04-07\t36\n1994-04-08\t35\n1994-04-09\t37\n1994-04-10\t43\n1994-04-11\t41\n1994-04-12\t56\n1994-04-13\t56\n1994-04-14\t52\n1994-04-15\t56\n1994-04-16\t53\n1994-04-17\t56\n1994-04-18\t64\n1994-04-19\t69\n1994-04-20\t76\n1994-04-21\t87\n1994-04-22\t102\n1994-04-23\t130\n1994-04-24\t171\n1994-04-25\t244\n1994-04-26\t223\n1994-04-27\t176\n1994-04-28\t163\n1994-04-29\t158\n1994-04-30\t137\n1994-05-01\t138\n1994-05-02\t138\n1994-05-03\t136\n1994-05-04\t149\n1994-05-05\t149\n1994-05-06\t147\n1994-05-07\t188\n1994-05-08\t291\n1994-05-09\t401\n1994-05-10\t528\n1994-05-11\t476\n1994-05-12\t598\n1994-05-13\t752\n1994-05-14\t874\n1994-05-15\t1030\n1994-05-16\t1050\n1994-05-17\t1310\n1994-05-18\t1180\n1994-05-19\t1130\n1994-05-20\t1270\n1994-05-21\t1100\n1994-05-22\t1110\n1994-05-23\t1200\n1994-05-24\t1090\n1994-05-25\t1090\n1994-05-26\t1180\n1994-05-27\t1160\n1994-05-28\t1270\n1994-05-29\t1350\n1994-05-30\t1390\n1994-05-31\t1490\n1994-06-01\t1590\n1994-06-02\t1380\n1994-06-03\t1220\n1994-06-04\t1210\n1994-06-05\t1250\n1994-06-06\t1270\n1994-06-07\t1190\n1994-06-08\t1010\n1994-06-09\t1040\n1994-06-10\t953\n1994-06-11\t960\n1994-06-12\t916\n1994-06-13\t757\n1994-06-14\t692\n1994-06-15\t702\n1994-06-16\t722\n1994-06-17\t714\n1994-06-18\t700\n1994-06-19\t703\n1994-06-20\t767\n1994-06-21\t819\n1994-06-22\t764\n1994-06-23\t764\n1994-06-24\t686\n1994-06-25\t585\n1994-06-26\t499\n1994-06-27\t420\n1994-06-28\t385\n1994-06-29\t335\n1994-06-30\t278\n1994-07-01\t246\n1994-07-02\t274\n1994-07-03\t291\n1994-07-04\t312\n1994-07-05\t254\n1994-07-06\t175\n1994-07-07\t226\n1994-07-08\t297\n1994-07-09\t233\n1994-07-10\t155\n1994-07-11\t219\n1994-07-12\t254\n1994-07-13\t261\n1994-07-14\t268\n1994-07-15\t229\n1994-07-16\t185\n1994-07-17\t185\n1994-07-18\t267\n1994-07-19\t305\n1994-07-20\t303\n1994-07-21\t300\n1994-07-22\t276\n1994-07-23\t269\n1994-07-24\t327\n1994-07-25\t308\n1994-07-26\t296\n1994-07-27\t268\n1994-07-28\t248\n1994-07-29\t224\n1994-07-30\t215\n1994-07-31\t203\n1994-08-01\t237\n1994-08-02\t302\n1994-08-03\t350\n1994-08-04\t345\n1994-08-05\t346\n1994-08-06\t336\n1994-08-07\t315\n1994-08-08\t293\n1994-08-09\t289\n1994-08-10\t296\n1994-08-11\t319\n1994-08-12\t316\n1994-08-13\t305\n1994-08-14\t306\n1994-08-15\t291\n1994-08-16\t189\n1994-08-17\t160\n1994-08-18\t144\n1994-08-19\t154\n1994-08-20\t251\n1994-08-21\t264\n1994-08-22\t255\n1994-08-23\t245\n1994-08-24\t243\n1994-08-25\t227\n1994-08-26\t207\n1994-08-27\t147\n1994-08-28\t132\n1994-08-29\t122\n1994-08-30\t70\n1994-08-31\t68\n1994-09-01\t57\n1994-09-02\t61\n1994-09-03\t82\n1994-09-04\t102\n1994-09-05\t119\n1994-09-06\t119\n1994-09-07\t123\n1994-09-08\t108\n1994-09-09\t76\n1994-09-10\t48\n1994-09-11\t47\n1994-09-12\t45\n1994-09-13\t43\n1994-09-14\t47\n1994-09-15\t53\n1994-09-16\t46\n1994-09-17\t35\n1994-09-18\t35\n1994-09-19\t34\n1994-09-20\t35\n1994-09-21\t40\n1994-09-22\t72\n1994-09-23\t83\n1994-09-24\t65\n1994-09-25\t46\n1994-09-26\t39\n1994-09-27\t33\n1994-09-28\t26\n1994-09-29\t23\n1994-09-30\t22\n1994-10-01\t20\n1994-10-02\t27\n1994-10-03\t28\n1994-10-04\t33\n1994-10-05\t27\n1994-10-06\t23\n1994-10-07\t31\n1994-10-08\t28\n1994-10-09\t24\n1994-10-10\t21\n1994-10-11\t21\n1994-10-12\t21\n1994-10-13\t21\n1994-10-14\t18\n1994-10-15\t18\n1994-10-16\t18\n1994-10-17\t26\n1994-10-18\t27\n1994-10-19\t19\n1994-10-20\t12\n1994-10-21\t15\n1994-10-22\t13\n1994-10-23\t17\n1994-10-24\t21\n1994-10-25\t17\n1994-10-26\t18\n1994-10-27\t17\n1994-10-28\t18\n1994-10-29\t22\n1994-10-30\t24\n1994-10-31\t28\n1994-11-01\t21\n1994-11-02\t17\n1994-11-03\t22\n1994-11-04\t23\n1994-11-05\t13\n1994-11-06\t25\n1994-11-07\t30\n1994-11-08\t32\n1994-11-09\t25\n1994-11-10\t15\n1994-11-11\t18\n1994-11-12\t22\n1994-11-13\t28\n1994-11-14\t21\n1994-11-15\t6.8\n1994-11-16\t6.0\n1994-11-17\t15\n1994-11-18\t18\n1994-11-19\t23\n1994-11-20\t28\n1994-11-21\t34\n1994-11-22\t36\n1994-11-23\t21\n1994-11-24\t13\n1994-11-25\t23\n1994-11-26\t37\n1994-11-27\t29\n1994-11-28\t10\n1994-11-29\t11\n1994-11-30\t15\n1994-12-01\t28\n1994-12-02\t60\n1994-12-03\t62\n1994-12-04\t36\n1994-12-05\t22\n1994-12-06\t31\n1994-12-07\t23\n1994-12-08\t25\n1994-12-09\t12\n1994-12-10\t15\n1994-12-11\t24\n1994-12-12\t24\n1994-12-13\t31\n1994-12-14\t35\n1994-12-15\t34\n1994-12-16\t37\n1994-12-17\t32\n1994-12-18\t21\n1994-12-19\t21\n1994-12-20\t22\n1994-12-21\t22\n1994-12-22\t22\n1994-12-23\t19\n1994-12-24\t21\n1994-12-25\t22\n1994-12-26\t22\n1994-12-27\t23\n1994-12-28\t23\n1994-12-29\t22\n1994-12-30\t26\n1994-12-31\t22\n1995-01-01\t22"
+            //+ "$$Date\t00600\n1994-01-03\tnodata\n1994-01-13\t0.28\n1994-02-16\t0.29\n1994-03-07\t0.25\n1994-04-20\t0.25\n1994-05-03\t0.25\n1994-06-07\t0.25\n1994-06-14\t0.25\n1994-07-06\t0.25\n1994-08-04\t0.25\n1994-09-02\t0.28\n1994-10-11\t0.25\n1994-11-22\t0.33\n1994-12-13\t0.59";
     
     
     //Global variable but not an input
@@ -239,8 +242,11 @@
     public void setEndDate(String endDate) {
         this.endDate = endDate;
     }
-    public void setUserData(String userData) {
-        this.userData = userData;
+    public void setUseSTORETretrieval(boolean useSTORETretrieval) {
+        this.useSTORETretrieval = useSTORETretrieval;
+    }
+    public void setSTORETdata(String STORETdata) {
+        this.STORETdata = STORETdata;
     }
     public void setMergeDatasets(boolean mergeDatasets) {
         this.mergeDatasets = mergeDatasets;
@@ -248,6 +254,9 @@
     public void setMergeMethod(String mergeMethod) {
         this.mergeMethod = mergeMethod;
     }
+    public void setUserData(String userData) {
+        this.userData = userData;
+    }
     /**
      * Control File Writer:
      * This function will write the control file which is what LOADEST will look for to find the 
@@ -708,7 +717,7 @@
         //String endLoadUnits = resultArray[4];
         
         //Check if any flow and water quality data exists
-        Object[] returnArray1 = data.extractFlow_and_WQdata(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, wqTest);
+        Object[] returnArray1 = data.extractFlow_and_WQdata(mainFolder, database, organizationName, stationID, beginDate, endDate, wqTest, userData, useSTORETretrieval, STORETdata);
         String[][] sortableData = (String[][]) returnArray1[0];
         String[][] WQdata = (String[][]) returnArray1[1];
         
@@ -717,7 +726,7 @@
         String[][] WQdata_user = new String[0][0];
         if(mergeDatasets){
             User_Data user_Data = new User_Data();
-            Object[] returnArray = user_Data.readUserFileLDC(userData, wqTest, beginDate, endDate);
+            Object[] returnArray = user_Data.readUserFileLDC("UserData", userData, wqTest, beginDate, endDate);
             sortableData_user = (String[][]) returnArray[0];
             WQdata_user = (String[][]) returnArray[1];
         }

src/java/cfa/guiTimeseries_Model.java

@@ -40,7 +40,7 @@
 import org.jfree.data.xy.XYSeriesCollection;
 
 /**
-* Last Updated: 21-January-2015
+* Last Updated: 23-January-2015
 * @author Tyler Wible
 * @since 24-June-2011
 */
@@ -78,9 +78,11 @@
     String CDPHE_waterYearBegin = "04-01";//"MM-dd"          //only used if CDPHE_lowFlowType == "all" or "extreme-value"
     int CDPHE_clusterLength = 120;                           //only used if CDPHE_lowFlowType == "all" or "biological"
     int CDPHE_clusterCountMax = 5;                           //only used if CDPHE_lowFlowType == "all" or "biological"
-    String userData = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
+    boolean useSTORETretrieval = false;//true;// 
+    String STORETdata = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
     boolean mergeDatasets = false;//true;// 
     String mergeMethod = "user";//"public";//"max";//"average";//"min";//
+    String userData = "";//"Date\tFlow\n1999-04-29\t8.3\n1999-05-09\t60.2\n1999-05-29\t20.1";//
     
     //Outputs
     String len = "-1";
@@ -512,8 +514,11 @@
     public void setCDPHE_clusterCountMax(int CDPHE_clusterCountMax) {
         this.CDPHE_clusterCountMax = CDPHE_clusterCountMax;
     }
-    public void setUserData(String userData) {
-        this.userData = userData;
+    public void setUseSTORETretrieval(boolean useSTORETretrieval) {
+        this.useSTORETretrieval = useSTORETretrieval;
+    }
+    public void setSTORETdata(String STORETdata) {
+        this.STORETdata = STORETdata;
     }
     public void setMergeDatasets(boolean mergeDatasets) {
         this.mergeDatasets = mergeDatasets;
@@ -521,6 +526,9 @@
     public void setMergeMethod(String mergeMethod) {
         this.mergeMethod = mergeMethod;
     }
+    public void setUserData(String userData) {
+        this.userData = userData;
+    }
     /**
      * Main statistics function calls other functions to calculate each statistic value then stores the results as global variables
      * @param dataList  data on which statistical values are desired
@@ -1874,7 +1882,7 @@
         String[][] sortableData = new String[0][2];
         if(wqTest.equalsIgnoreCase("flow")){
             //Check if any flow data exists
-            sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData);
+            sortableData = data.extractFlowData(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, useSTORETretrieval, STORETdata);
 
             //Define other graph information
             graphUnits = "cfs";
@@ -1889,7 +1897,7 @@
             showLine = true;
         }else{
             //Search for WQ data
-            Object[] returnArray = data.extractWQdata(mainFolder, database, organizationName, stationID, beginDate, endDate, userData, wqTest);
+            Object[] returnArray = data.extractWQdata(mainFolder, database, organizationName, stationID, beginDate, endDate, wqTest, userData, useSTORETretrieval, STORETdata);
             sortableData = (String[][]) returnArray[0];
             graphUnits = (String) returnArray[1];
             WQlabel = (String) returnArray[2];
@@ -1910,7 +1918,7 @@
         String[][] sortableData_user = new String[0][0];
         if(mergeDatasets){
             User_Data user_Data = new User_Data();
-            sortableData_user = user_Data.readUserFile(userData, wqTest, beginDate, endDate);
+            sortableData_user = user_Data.readUserFile("UserData", userData, wqTest, beginDate, endDate);
         }
         
         //Sort the Data by date to remove duplicate date entries

src/java/m/cfa/Baseflow_V1_0.java

@@ -40,9 +40,11 @@
                 model.setEndDate(m.get("end_date").getString(VALUE));
                 model.setNDMIN(m.get("ndmin").getInt(VALUE));
                 model.setNDMAX(m.get("ndmax").getInt(VALUE));
-                model.setUserData(m.get("user_data").getString(VALUE));
+                model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
+                model.setSTORETdata(m.get("STORETdata").getString(VALUE));
                 model.setMergeDatasets(m.get("merge_datasets").getBoolean(VALUE));
                 model.setMergeMethod(m.get("merge_method").getString(VALUE));
+                model.setUserData(m.get("user_data").getString(VALUE));
                 
                 model.run();
                 return EXEC_OK;

src/java/m/cfa/Baseflow_V1_0Req.json

@@ -53,8 +53,13 @@
       "value": "BFLOW"
     },
     {
-      "name": "user_data",
-      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "name": "useSTORETretrieval",
+      "description": "If true, a flag that if true uses this tool's built in STORET data retrieval. If false, it uses the data provided for the STORET station in 'STORETdata' which is intended for use by eRAMS only.",
+      "value": true
+    },
+    {
+      "name": "STORETdata",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if useSTORETretrieval == 'false' and database == 'STORET'.",
       "value": ""
     },
     {
@@ -66,6 +71,11 @@
       "name": "merge_method",
       "description": "Method of merging the datasets, user data first, public data first, max, ave., min (user | public | max | average | min)",
       "value": "user"
+    },
+    {
+      "name": "user_data",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "value": ""
     }
   ]
 }
\ No newline at end of file

src/java/m/cfa/Drought_V1_0.java

@@ -41,9 +41,11 @@
                 model.setPhiValues(m.get("phi_values").getString(VALUE));
                 model.setThetaValues(m.get("theta_values").getString(VALUE));
                 model.setDroughtLimit(m.get("drought_limit").getDouble(VALUE));
-                model.setUserData(m.get("user_data").getString(VALUE));
+                model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
+                model.setSTORETdata(m.get("STORETdata").getString(VALUE));
                 model.setMergeDatasets(m.get("merge_datasets").getBoolean(VALUE));
                 model.setMergeMethod(m.get("merge_method").getString(VALUE));
+                model.setUserData(m.get("user_data").getString(VALUE));
 
                 model.run();
                 return EXEC_OK;

src/java/m/cfa/Drought_V1_0Req.json

@@ -58,8 +58,13 @@
       "value": -1
     },
     {
-      "name": "user_data",
-      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "name": "useSTORETretrieval",
+      "description": "If true, a flag that if true uses this tool's built in STORET data retrieval. If false, it uses the data provided for the STORET station in 'STORETdata' which is intended for use by eRAMS only.",
+      "value": true
+    },
+    {
+      "name": "STORETdata",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if useSTORETretrieval == 'false' and database == 'STORET'.",
       "value": ""
     },
     {
@@ -71,6 +76,11 @@
       "name": "merge_method",
       "description": "Method of merging the datasets, user data first, public data first, max, ave., min (user | public | max | average | min)",
       "value": "user"
+    },
+    {
+      "name": "user_data",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "value": ""
     }
   ]
 }
\ No newline at end of file

src/java/m/cfa/DurationCurve_V1_0.java

@@ -50,9 +50,11 @@
                 model.setLowPercentile(m.get("lowPercentile").getDouble(VALUE));
                 model.setShowMonthlyStatsTF(m.get("showMonthlyStatsTF").getBoolean(VALUE));
                 model.setMQNperiod(m.get("mqn_period").getString(VALUE));
-                model.setUserData(m.get("user_data").getString(VALUE));
+                model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
+                model.setSTORETdata(m.get("STORETdata").getString(VALUE));
                 model.setMergeDatasets(m.get("merge_datasets").getBoolean(VALUE));
                 model.setMergeMethod(m.get("merge_method").getString(VALUE));
+                model.setUserData(m.get("user_data").getString(VALUE));
                 
                 model.run();
                 return EXEC_OK;

src/java/m/cfa/DurationCurve_V1_0Req.json

@@ -110,8 +110,13 @@
       "value": "false"
     },
     {
-      "name": "user_data",
-      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column flow values in a tab-delimited format. If analysis type == 'ldc' then this must be followed by a '$$' delimiter then the water quality data with one line header, first column dates (yyyy-mm-dd format), second column water quality test values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "name": "useSTORETretrieval",
+      "description": "If true, a flag that if true uses this tool's built in STORET data retrieval. If false, it uses the data provided for the STORET station in 'STORETdata' which is intended for use by eRAMS only.",
+      "value": true
+    },
+    {
+      "name": "STORETdata",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column flow values in a tab-delimited format if wq_test = 'flow', otherwise it needs to contain this as well as a '$$' delimiter followed by one line header (date,00600 which needs to match the 5-digit USGS water quality code provided in wq_test), first column dates (yyyy-mm-dd format), second column water quality test values in a tab-delimited format. Only used if useSTORETretrieval == 'false' and database == 'STORET'.",
       "value": ""
     },
     {
@@ -123,6 +128,11 @@
       "name": "merge_method",
       "description": "Method of merging the datasets, user data first, public data first, max, ave., min (user | public | max | average | min)",
       "value": "user"
+    },
+    {
+      "name": "user_data",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column flow values in a tab-delimited format if wq_test = 'flow', otherwise it needs to contain this as well as a '$$' delimiter followed by one line header (date,00600 which needs to match the 5-digit USGS water quality code provided in wq_test), first column dates (yyyy-mm-dd format), second column water quality test values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "value": ""
     }
   ]
 }
\ No newline at end of file

src/java/m/cfa/Flood_V1_0.java

@@ -42,9 +42,11 @@
                 model.setShowLargeFloods(m.get("show_large_floods").getBoolean(VALUE));
                 model.setPlotType(m.get("plot_type").getBoolean(VALUE));
                 model.setPlotReference(m.get("plot_ref").getBoolean(VALUE));
-                model.setUserData(m.get("user_data").getString(VALUE));
+                model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
+                model.setSTORETdata(m.get("STORETdata").getString(VALUE));
                 model.setMergeDatasets(m.get("merge_datasets").getBoolean(VALUE));
                 model.setMergeMethod(m.get("merge_method").getString(VALUE));
+                model.setUserData(m.get("user_data").getString(VALUE));
 
                 model.run();
                 return EXEC_OK;

src/java/m/cfa/Flood_V1_0Req.json

@@ -64,8 +64,13 @@
       "value": true
     },
     {
-      "name": "user_data",
-      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "name": "useSTORETretrieval",
+      "description": "If true, a flag that if true uses this tool's built in STORET data retrieval. If false, it uses the data provided for the STORET station in 'STORETdata' which is intended for use by eRAMS only.",
+      "value": true
+    },
+    {
+      "name": "STORETdata",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if useSTORETretrieval == 'false' and database == 'STORET'.",
       "value": ""
     },
     {
@@ -77,6 +82,11 @@
       "name": "merge_method",
       "description": "Method of merging the datasets, user data first, public data first, max, ave., min (user | public | max | average | min)",
       "value": "user"
+    },
+    {
+      "name": "user_data",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "value": ""
     }
   ]
 }
\ No newline at end of file

src/java/m/cfa/LOADEST_V1_0.java

@@ -43,9 +43,11 @@
                 model.setULFLAG(m.get("ulflag").getInt(VALUE));
                 model.setBeginDate(m.get("begin_date").getString(VALUE));
                 model.setEndDate(m.get("end_date").getString(VALUE));
-                model.setUserData(m.get("user_data").getString(VALUE));
+                model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
+                model.setSTORETdata(m.get("STORETdata").getString(VALUE));
                 model.setMergeDatasets(m.get("merge_datasets").getBoolean(VALUE));
                 model.setMergeMethod(m.get("merge_method").getString(VALUE));
+                model.setUserData(m.get("user_data").getString(VALUE));
                 model.run();
                 return EXEC_OK;
             }

src/java/m/cfa/LOADEST_V1_0Req.json

@@ -72,8 +72,13 @@
       "value": ""
     },
     {
-      "name": "user_data",
-      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column flow values in a tab-delimited format followed by a '$$' delimiter then the water quality data with one line header, first column dates (yyyy-mm-dd format), second column water quality test values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "name": "useSTORETretrieval",
+      "description": "If true, a flag that if true uses this tool's built in STORET data retrieval. If false, it uses the data provided for the STORET station in 'STORETdata' which is intended for use by eRAMS only.",
+      "value": true
+    },
+    {
+      "name": "STORETdata",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column flow values in a tab-delimited format followed by a '$$' delimiter followed by one line header (date,00600 which needs to match the 5-digit USGS water quality code provided in wq_test), first column dates (yyyy-mm-dd format), second column water quality test values in a tab-delimited format. Only used if useSTORETretrieval == 'false' and database == 'STORET'.",
       "value": ""
     },
     {
@@ -85,6 +90,11 @@
       "name": "merge_method",
       "description": "Method of merging the datasets, user data first, public data first, max, ave., min (user | public | max | average | min)",
       "value": "user"
+    },
+    {
+      "name": "user_data",
+      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column flow values in a tab-delimited format followed by a '$$' delimiter followed by one line header (date,00600 which needs to match the 5-digit USGS water quality code provided in wq_test), first column dates (yyyy-mm-dd format), second column water quality test values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "value": ""
     }
   ]
 }
\ No newline at end of file

src/java/m/cfa/Timeseries_V1_0.java

@@ -60,9 +60,11 @@
                 model.setCDPHE_waterYearBegin(m.get("CDPHE_waterYearBegin").getString(VALUE));
                 model.setCDPHE_clusterLength(m.get("CDPHE_clusterLength").getInt(VALUE));
                 model.setCDPHE_clusterCountMax(m.get("CDPHE_clusterCountMax").getInt(VALUE));
-                model.setUserData(m.get("user_data").getString(VALUE));
+                model.setUseSTORETretrieval(m.get("useSTORETretrieval").getBoolean(VALUE));
+                model.setSTORETdata(m.get("STORETdata").getString(VALUE));
                 model.setMergeDatasets(m.get("merge_datasets").getBoolean(VALUE));
                 model.setMergeMethod(m.get("merge_method").getString(VALUE));
+                model.setUserData(m.get("user_data").getString(VALUE));
                 
                 model.run();
                 return EXEC_OK;

src/java/m/cfa/Timeseries_V1_0Req.json

@@ -163,8 +163,13 @@
       "value": 5
     },
     {
-      "name": "user_data",
-      "description": "String containing user uploaded data with one line header, first column dates (yyyy-mm-dd format), second column values in a tab-delimited format. Only used if merge_datasets is True or database == UserData.",
+      "name": "useSTORETretrieval",
+      "description": "If true, a flag that if true uses this tool's built in STORET data retrieval. If false, it uses the data provided for the STORET station in 'STORETdata' which is intended for use by eRAMS only.",
+      "value": true
+    },
+    {
+      "name": "STORETdata",
+      "description": "String containing user uploaded data with one line header (date,flow if wq_test = 'flow' otherwise: date,00600 which needs to match the 5-digit USGS water quality code provided in wq_test), first column dates (yyyy-mm-dd format), second column flow or water quality test values in a tab-delimited format. Only used if useSTORETretrieval == 'false' and database == 'STORET'.",
       "value": ""
     },
     {
@@ -176,6 +181,11 @@
       "name": "merge_method",
       "description": "Method of merging the datasets, user data first, public data first, max, ave., min (user | public | max | average | min)",
       "value": "user"
+    },
+    {
+      "name": "user_data",
+      "description": "String containing user uploaded data with one line header (date,flow if wq_test = 'flow' otherwise: date,00600 which needs to match the 5-digit USGS water quality code provided in wq_test), first column dates (yyyy-mm-dd format), second column flow or water quality test values in a tab-delimited format. Only used if merge_datasets == 'true' or database == 'UserData'.",
+      "value": ""
     }
   ]
 }
\ No newline at end of file