Issue #1161 Fixed anomaly with RFCFFG and graph QPE times

Change-Id: I23212f3281290d86621e72c88478b00d37336494

Former-commit-id: 28912552fe [formerly 28912552fe [formerly 2088328c090d5a7d3f6218c42619fd3ab6d45dd9]]
Former-commit-id: 6818408d40
Former-commit-id: 655939bba7
This commit is contained in:
Dave Hladky 2012-09-11 08:56:51 -05:00
parent dfc3f135ef
commit 8f3447ff9b
3 changed files with 21 additions and 14 deletions

View file

@ -647,6 +647,13 @@ public class FFMPMonitor extends ResourceMonitor {
Date previousQueryTime = ffmpAvailableUriQueryDates.get(siteKey).get(
sourceName);
SourceXML source = getSourceConfig().getSource(sourceName);
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
// Always look back for guidance types because of long expiration times,
// prevents mosaic brittleness from occurring.
retrieveNew = true;
}
if (retrieveNew
|| ((time != null) && ((previousQueryTime == null) || (time
@ -2322,14 +2329,11 @@ public class FFMPMonitor extends ResourceMonitor {
final String fsiteKey;
final boolean fisProductLoad;
public FFMPLoadRecord(boolean isProductLoad, String siteKey,
FFMPRecord ffmpRec, String source, String huc) throws Exception {
this.fffmpRec = ffmpRec;
this.fsource = source;
this.fsiteKey = siteKey;
this.fisProductLoad = isProductLoad;
this.fhuc = huc;
}

View file

@ -3339,13 +3339,15 @@ public class FFMPResource extends
ArrayList<Double> qpeTimes = new ArrayList<Double>();
if (qpeBasin != null) {
for (Date date : qpeBasin.getValues().keySet()) {
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
fgd.setQpe(dtime, (double) qpeBasin.getAccumValue(date,
double currVal = qpeBasin.getAccumValue(date,
mostRecentRefTime, getQpeSourceExpiration(),
isRate()));
isRate());
fgd.setQpe(dtime, currVal);
qpeTimes.add(dtime);
}
}

View file

@ -161,11 +161,13 @@ public class FFMPBasin implements ISerializableObject, Cloneable {
ArrayList<Date> keys = new ArrayList<Date>();
for (Date date : values.descendingKeySet()) {
for (Date date : values.keySet()) {
if (date.before(beforeDate) && date.after(afterDate)) {
keys.add(date);
}
}
float factor = 0.0f;
for (Date key : keys) {
Date tdate = key;
@ -179,30 +181,29 @@ public class FFMPBasin implements ISerializableObject, Cloneable {
if (val > 0.0f) {
float factor = 0.0f;
if ((prevDate.getTime() - tdate.getTime()) > expirationTime) {
// handle the gap and accumulate the book ends
// of it
factor = (float) ((prevDate.getTime() - (prevDate
.getTime() - expirationTime)) / (1000.0 * 60.0 * 60.0));
factor = ((prevDate.getTime() - (prevDate
.getTime() - expirationTime)) / (1000.0f * 60.0f * 60.0f));
} else {
factor = (float) ((prevDate.getTime() - tdate
.getTime()) / (1000.0 * 60.0 * 60.0));
factor = ((prevDate.getTime() - tdate
.getTime()) / (1000.0f * 60.0f * 60.0f));
}
// do absolute values so it dosen't matter which way
// you traverse the list
val = val * Math.abs(factor);
}
}
dvalue += val;
prevDate = key;
}
}
}
return dvalue;
}