Skip to content
Snippets Groups Projects
Commit 44d2b876 authored by Powers, Peter M.'s avatar Powers, Peter M. Committed by GitHub
Browse files

Merge pull request #206 from pmpowers-usgs/deagg-gmm-bug-205

Fix for deagg failures
parents 632d8548 61a97efc
No related branches found
No related tags found
No related merge requests found
...@@ -157,15 +157,20 @@ final class Deaggregator { ...@@ -157,15 +157,20 @@ final class Deaggregator {
for (Entry<Gmm, DeaggDataset.Builder> entry : datasetBuilders.entrySet()) { for (Entry<Gmm, DeaggDataset.Builder> entry : datasetBuilders.entrySet()) {
/* /*
* Scale, skipping clusters that do not contribute as their attendant * Due to Gmm variations with distance, cluster curves for some GMMs may
* sources will also not contribute and 0/0 will yield NaNs. * not have been calculated. Skip non-participating clusters (curve will
* be absent). Scale to total cluster rate. Builder rate > 0.0 check
* assures no 0/0 --> NaN and is necessary for curves that are present
* but that end below the target deagg iml.
*/ */
Gmm gmm = entry.getKey(); Gmm gmm = entry.getKey();
DeaggDataset.Builder clusterBuilder = entry.getValue(); DeaggDataset.Builder clusterBuilder = entry.getValue();
XySequence clusterCurve = clusterCurves.get(gmm); if (clusterCurves.containsKey(gmm)) {
double clusterRate = Deaggregation.RATE_INTERPOLATER.findY(clusterCurve, iml); XySequence clusterCurve = clusterCurves.get(gmm);
if (clusterBuilder.rate() > 0.0) { double clusterRate = Deaggregation.RATE_INTERPOLATER.findY(clusterCurve, iml);
clusterBuilder.multiply(clusterRate / clusterBuilder.rate()); if (clusterBuilder.rate() > 0.0) {
clusterBuilder.multiply(clusterRate / clusterBuilder.rate());
}
} }
/* Swap parents. */ /* Swap parents. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment