Displaying differences for changeset
 
display as  

src/java/m/cfa/flood/V1_0.java

@@ -101,6 +101,8 @@
         } else if ( analysisType.equalsIgnoreCase( "c17" ) ) {
             resultPayload.put( "17c_station_output", model.stationResult.toJSON() );
             resultPayload.put( "17c_weighted_output", model.weightedResult.toJSON() );
+            resultPayload.put( "weighted_generalized_skew", model.getWeightedGenSkew() );
+            resultPayload.put( "station_skew", model.getStationSkew() );
         }
     }
 }

src/java/m/cfa/flood/guiFlood_Model.java

@@ -366,7 +366,7 @@
         }
     }
 
-    public Bulletin17CResults readC17outputFile( String path ) throws FileNotFoundException {
+    public Bulletin17CResults readC17outputFile( String path , String skewResultType) throws FileNotFoundException {
         Bulletin17CResults finalResult = new Bulletin17CResults();
 
         boolean foundFreqValues = false;
@@ -381,6 +381,16 @@
                 } else if ( line.isEmpty() ) {
                     foundFreqValues = false;
                     foundWYValues = false;
+                } else if ( line.startsWith( "Moments," ) ) {
+                    String[] tokens = line.split( "," );
+                    //double mean = Double.parseDouble( tokens[ 3 ] );
+                    //double variance = Double.parseDouble( tokens[ 3 ] );
+                    double resultSkewness = Double.parseDouble( tokens[ 3 ] );
+                    if (skewResultType.equalsIgnoreCase("station")) {
+                        stationSkew = resultSkewness;
+                    }else if (skewResultType.equalsIgnoreCase("weighted")) {
+                        weightedGenSkew = resultSkewness;
+                    }
                 } else if ( foundFreqValues ) {
                     String[] tokens = line.split( "," );
                     Bulletin17CFreqResult res = new Bulletin17CFreqResult();
@@ -411,10 +421,10 @@
 
     public void readC17outputFiles() throws FileNotFoundException, IOException {
         String path = directory + File.separator + "c17Station.csv";
-        this.stationResult = readC17outputFile( path );
+        this.stationResult = readC17outputFile( path , "station");
 
         path = directory + File.separator + "c17Weighted.csv";
-        this.weightedResult = readC17outputFile( path );
+        this.weightedResult = readC17outputFile( path , "weighted");
     }
 
     public void run() throws IOException, Exception {