ASM #17357 Fixes for EDEX not ingesting some FFG data.
Change-Id: I0b91ce082a90884c6e4ece3734bf5246091c15f9 Former-commit-id: 3dca1c1ebae6e30ca4adf15371fbb2d93f258097
This commit is contained in:
parent
236f89aa25
commit
b4fa868b28
1 changed files with 7 additions and 2 deletions
|
@ -35,6 +35,8 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 08, 2011 mpduff Initial creation
|
||||
* Mar 28, 2014 2952 mpduff Changed to use UFStatus for logging.
|
||||
* Aug 14, 2015 17357 xwei 1) Added casting for percentValid calculation
|
||||
* 2) Set goodAvgValue to true at the beginning of computeAvgFfg() method
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -182,6 +184,7 @@ public class GAFFAreaProcessor {
|
|||
*/
|
||||
private void computeAvgFfg(String areaId, int numRows, int[] rows,
|
||||
int[] begCol, int[] endCol) {
|
||||
|
||||
/* compute average FFG value for basin and areal coverage */
|
||||
int missCnt = 0;
|
||||
int totalCnt = 0;
|
||||
|
@ -191,6 +194,8 @@ public class GAFFAreaProcessor {
|
|||
double sum = 0.0;
|
||||
double rawVal;
|
||||
|
||||
goodAvgValue = true;
|
||||
|
||||
for (int i = 0; i < numRows; i++) {
|
||||
totalCnt += endCol[i] - begCol[i];
|
||||
|
||||
|
@ -250,7 +255,7 @@ public class GAFFAreaProcessor {
|
|||
if (totalCnt <= 0) {
|
||||
percentValid = 0;
|
||||
} else {
|
||||
percentValid = valCnt / totalCnt;
|
||||
percentValid = (double) valCnt / (double) totalCnt;
|
||||
}
|
||||
|
||||
if (valCnt > 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue