From b931aba92be994f3fd7202e90f5e878a622ec33c Mon Sep 17 00:00:00 2001 From: Hans Kallekleiv <16436291+HansKallekleiv@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:30:23 +0200 Subject: [PATCH] StatisticalSurface fix: Use wildcard when no realizationfilter is active --- .../StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts b/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts index 4f5cbe8f2..15c21e845 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts +++ b/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts @@ -90,11 +90,10 @@ export class StatisticalSurfaceLayer .getRealizationFilterSet() .getRealizationFilterForEnsembleIdent(ensembleIdent) .getFilteredRealizations(); + const currentEnsemble = workbenchSession.getEnsembleSet().findEnsemble(ensembleIdent); // If sensitivity is set, filter realizations further to only include the realizations that are in the sensitivity if (sensitivityNameCasePair) { - const currentEnsemble = workbenchSession.getEnsembleSet().findEnsemble(ensembleIdent); - const sensitivity = currentEnsemble ?.getSensitivities() ?.getCaseByName(sensitivityNameCasePair.sensitivityName, sensitivityNameCasePair.sensitivityCase); @@ -105,7 +104,12 @@ export class StatisticalSurfaceLayer sensitivityRealizations.includes(realization) ); } - addrBuilder.withStatisticRealizations(filteredRealizations.map((realization) => realization)); + + // If realizations are filtered, update the address + let allRealizations = currentEnsemble?.getRealizations() ?? []; + if (!isEqual([...allRealizations], [...filteredRealizations])) { + addrBuilder.withStatisticRealizations([...filteredRealizations]); + } if (timeOrInterval !== SurfaceTimeType_api.NO_TIME) { addrBuilder.withTimeOrInterval(timeOrInterval);