Issue #1161 Fixed anomaly with RFCFFG and graph QPE times
Change-Id: I23212f3281290d86621e72c88478b00d37336494 Former-commit-id:7ea2655805
[formerly33f222783d
] [formerly28912552fe
] [formerly6818408d40
[formerly28912552fe
[formerly 2088328c090d5a7d3f6218c42619fd3ab6d45dd9]]] Former-commit-id:6818408d40
Former-commit-id: 5f94e8ba51158c8fb39f7777f808e5c34c42b933 [formerly655939bba7
] Former-commit-id:02b00ddf47
This commit is contained in:
parent
6a6f27bd44
commit
566007c438
3 changed files with 21 additions and 14 deletions
|
@ -647,6 +647,13 @@ public class FFMPMonitor extends ResourceMonitor {
|
||||||
Date previousQueryTime = ffmpAvailableUriQueryDates.get(siteKey).get(
|
Date previousQueryTime = ffmpAvailableUriQueryDates.get(siteKey).get(
|
||||||
sourceName);
|
sourceName);
|
||||||
SourceXML source = getSourceConfig().getSource(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
|
if (retrieveNew
|
||||||
|| ((time != null) && ((previousQueryTime == null) || (time
|
|| ((time != null) && ((previousQueryTime == null) || (time
|
||||||
|
@ -2322,14 +2329,11 @@ public class FFMPMonitor extends ResourceMonitor {
|
||||||
|
|
||||||
final String fsiteKey;
|
final String fsiteKey;
|
||||||
|
|
||||||
final boolean fisProductLoad;
|
|
||||||
|
|
||||||
public FFMPLoadRecord(boolean isProductLoad, String siteKey,
|
public FFMPLoadRecord(boolean isProductLoad, String siteKey,
|
||||||
FFMPRecord ffmpRec, String source, String huc) throws Exception {
|
FFMPRecord ffmpRec, String source, String huc) throws Exception {
|
||||||
this.fffmpRec = ffmpRec;
|
this.fffmpRec = ffmpRec;
|
||||||
this.fsource = source;
|
this.fsource = source;
|
||||||
this.fsiteKey = siteKey;
|
this.fsiteKey = siteKey;
|
||||||
this.fisProductLoad = isProductLoad;
|
|
||||||
this.fhuc = huc;
|
this.fhuc = huc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3339,13 +3339,15 @@ public class FFMPResource extends
|
||||||
ArrayList<Double> qpeTimes = new ArrayList<Double>();
|
ArrayList<Double> qpeTimes = new ArrayList<Double>();
|
||||||
|
|
||||||
if (qpeBasin != null) {
|
if (qpeBasin != null) {
|
||||||
|
|
||||||
for (Date date : qpeBasin.getValues().keySet()) {
|
for (Date date : qpeBasin.getValues().keySet()) {
|
||||||
|
|
||||||
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
|
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
|
||||||
date);
|
date);
|
||||||
fgd.setQpe(dtime, (double) qpeBasin.getAccumValue(date,
|
double currVal = qpeBasin.getAccumValue(date,
|
||||||
mostRecentRefTime, getQpeSourceExpiration(),
|
mostRecentRefTime, getQpeSourceExpiration(),
|
||||||
isRate()));
|
isRate());
|
||||||
|
fgd.setQpe(dtime, currVal);
|
||||||
qpeTimes.add(dtime);
|
qpeTimes.add(dtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,11 +161,13 @@ public class FFMPBasin implements ISerializableObject, Cloneable {
|
||||||
|
|
||||||
ArrayList<Date> keys = new ArrayList<Date>();
|
ArrayList<Date> keys = new ArrayList<Date>();
|
||||||
|
|
||||||
for (Date date : values.descendingKeySet()) {
|
for (Date date : values.keySet()) {
|
||||||
if (date.before(beforeDate) && date.after(afterDate)) {
|
if (date.before(beforeDate) && date.after(afterDate)) {
|
||||||
keys.add(date);
|
keys.add(date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float factor = 0.0f;
|
||||||
|
|
||||||
for (Date key : keys) {
|
for (Date key : keys) {
|
||||||
Date tdate = key;
|
Date tdate = key;
|
||||||
|
@ -179,30 +181,29 @@ public class FFMPBasin implements ISerializableObject, Cloneable {
|
||||||
|
|
||||||
if (val > 0.0f) {
|
if (val > 0.0f) {
|
||||||
|
|
||||||
float factor = 0.0f;
|
|
||||||
|
|
||||||
if ((prevDate.getTime() - tdate.getTime()) > expirationTime) {
|
if ((prevDate.getTime() - tdate.getTime()) > expirationTime) {
|
||||||
// handle the gap and accumulate the book ends
|
// handle the gap and accumulate the book ends
|
||||||
// of it
|
// of it
|
||||||
factor = (float) ((prevDate.getTime() - (prevDate
|
factor = ((prevDate.getTime() - (prevDate
|
||||||
.getTime() - expirationTime)) / (1000.0 * 60.0 * 60.0));
|
.getTime() - expirationTime)) / (1000.0f * 60.0f * 60.0f));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
factor = (float) ((prevDate.getTime() - tdate
|
factor = ((prevDate.getTime() - tdate
|
||||||
.getTime()) / (1000.0 * 60.0 * 60.0));
|
.getTime()) / (1000.0f * 60.0f * 60.0f));
|
||||||
}
|
}
|
||||||
// do absolute values so it dosen't matter which way
|
// do absolute values so it dosen't matter which way
|
||||||
// you traverse the list
|
// you traverse the list
|
||||||
val = val * Math.abs(factor);
|
val = val * Math.abs(factor);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dvalue += val;
|
dvalue += val;
|
||||||
prevDate = key;
|
prevDate = key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dvalue;
|
return dvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue