Skip to content
Snippets Groups Projects
Commit e9d12eb3 authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

Merge branch 'lib-updates' into 'main'

Fixed disagg source weight application

See merge request !236
parents e016bee6 b21aa2e4
No related branches found
No related tags found
1 merge request!236Fixed disagg source weight application
Pipeline #110513 passed
......@@ -342,7 +342,7 @@ public final class Disaggregation {
double ruptureSetRate = RATE_INTERPOLATER.findY(ruptureSetCurve, config.iml);
if (Double.isNaN(ruptureSetRate) || ruptureSetRate == 0.0) {
// Consider logging statement below
// System.out.println("Skipping: " + curveSet.ruptureSet.name());
System.err.println("Skipping: " + curveSet.ruptures.name());
continue;
}
Map<Gmm, DisaggDataset> ruptureSetDatasets = Disaggregator.disaggregate(
......
......@@ -209,6 +209,7 @@ final class Disaggregator {
* are [rate, residual, rScaled, mScaled, εScaled].
*/
Map<Gmm, double[]> gmmData = createDataMap(gmmKeys);
double srcWeight = ruptures.weight();
/* Add rupture data to builders */
for (int i = 0; i < inputs.size(); i++) {
......@@ -233,11 +234,7 @@ final class Disaggregator {
double ε = Maths.epsilon(μ, σ, iml);
double probAtIml = probModel.exceedance(μ, σ, trunc, imt, iml);
// TODO need ruptures.weight
// double rate = probAtIml * in.rate * sources.weight() * gmmWeight *
// branch.weight();
double rate = probAtIml * in.rate * 1.0 * gmmWeight * branch.weight();
double rate = probAtIml * in.rate * srcWeight * gmmWeight * branch.weight();
double rScaled = rRup * rate;
double mScaled = Mw * rate;
......@@ -314,6 +311,7 @@ final class Disaggregator {
/* Safe covariant cast assuming switch handles variants. */
SystemRuptureSet systemRuptures = (SystemRuptureSet) ruptures;
double srcWeight = ruptures.weight();
Map<Gmm, DisaggDataset.Builder> builders = createBuilders(gmmSet.gmms(), model);
for (DisaggDataset.Builder builder : builders.values()) {
......@@ -411,10 +409,7 @@ final class Disaggregator {
double ε = Maths.epsilon(μ, σ, iml);
double probAtIml = probModel.exceedance(μ, σ, trunc, imt, iml);
// TODO need ruptures.weight
// double rate = probAtIml * in.rate * sources.weight() *
// gmmWeight * branch.weight();
double rate = probAtIml * in.rate * 1.0 * gmmWeight * branch.weight();
double rate = probAtIml * in.rate * srcWeight * gmmWeight * branch.weight();
SystemContributor.Builder contributor = contributors.get(gmm);
......
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