Skip to content

Commit 7d7a64e

Browse files
committed
Add misfits plot for summary and gen data
1 parent 5e05c3a commit 7d7a64e

File tree

20 files changed

+613
-20
lines changed

20 files changed

+613
-20
lines changed
399 Bytes
Loading
379 Bytes
Loading
375 Bytes
Loading
357 Bytes
Loading
619 Bytes
Loading
378 Bytes
Loading
401 Bytes
Loading

src/ert/gui/tools/plot/plot_widget.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
from typing_extensions import override
2727

28-
from .plot_api import EnsembleObject
28+
from .plot_api import EnsembleObject, PlotApiKeyDefinition
2929

3030
if TYPE_CHECKING:
3131
from .plottery import PlotContext
@@ -34,6 +34,7 @@
3434
from .plottery.plots.ensemble import EnsemblePlot
3535
from .plottery.plots.gaussian_kde import GaussianKDEPlot
3636
from .plottery.plots.histogram import HistogramPlot
37+
from .plottery.plots.misfits import MisfitsPlot
3738
from .plottery.plots.statistics import StatisticsPlot
3839
from .plottery.plots.std_dev import StdDevPlot
3940

@@ -122,6 +123,7 @@ def __init__(
122123
"DistributionPlot",
123124
"CrossEnsembleStatisticsPlot",
124125
"StdDevPlot",
126+
"MisfitsPlot",
125127
],
126128
parent: QWidget | None = None,
127129
) -> None:
@@ -192,6 +194,7 @@ def updatePlot(
192194
ensemble_to_data_map: dict[EnsembleObject, pd.DataFrame],
193195
observations: pd.DataFrame,
194196
std_dev_images: dict[str, npt.NDArray[np.float32]],
197+
key_def: PlotApiKeyDefinition | None = None,
195198
) -> None:
196199
self.resetPlot()
197200
try:
@@ -204,6 +207,7 @@ def updatePlot(
204207
ensemble_to_data_map,
205208
observations,
206209
std_dev_images,
210+
key_def,
207211
)
208212
self._canvas.draw()
209213
self._sync_log_checkbox()

src/ert/gui/tools/plot/plot_window.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
EnsemblePlot,
4141
GaussianKDEPlot,
4242
HistogramPlot,
43+
MisfitsPlot,
4344
StatisticsPlot,
4445
StdDevPlot,
4546
)
@@ -51,10 +52,11 @@
5152
HISTOGRAM = "Histogram"
5253
STATISTICS = "Statistics"
5354
STD_DEV = "Std Dev"
55+
MISFITS = "Misfits"
5456

5557
RESPONSE_DEFAULT = 0
56-
GEN_KW_DEFAULT = 2
57-
STD_DEV_DEFAULT = 6
58+
GEN_KW_DEFAULT = 3
59+
STD_DEV_DEFAULT = 7
5860

5961

6062
logger = logging.getLogger(__name__)
@@ -189,6 +191,7 @@ def __init__(
189191

190192
self.addPlotWidget(ENSEMBLE, EnsemblePlot())
191193
self.addPlotWidget(STATISTICS, StatisticsPlot())
194+
self.addPlotWidget(MISFITS, MisfitsPlot())
192195
self.addPlotWidget(HISTOGRAM, HistogramPlot())
193196
self.addPlotWidget(GAUSSIAN_KDE, GaussianKDEPlot())
194197
self.addPlotWidget(DISTRIBUTION, DistributionPlot())
@@ -358,7 +361,11 @@ def updatePlot(self, layer: int | None = None) -> None:
358361
self._updateCustomizer(plot_widget, self._preferred_ensemble_x_axis_format)
359362

360363
plot_widget.updatePlot(
361-
plot_context, ensemble_to_data_map, observations, std_dev_images
364+
plot_context,
365+
ensemble_to_data_map,
366+
observations,
367+
std_dev_images,
368+
key_def,
362369
)
363370

364371
def _updateCustomizer(
@@ -387,15 +394,14 @@ def getSelectedKey(self) -> PlotApiKeyDefinition | None:
387394
def addPlotWidget(
388395
self,
389396
name: str,
390-
plotter: (
391-
EnsemblePlot
392-
| StatisticsPlot
393-
| HistogramPlot
394-
| GaussianKDEPlot
395-
| DistributionPlot
396-
| CrossEnsembleStatisticsPlot
397-
| StdDevPlot
398-
),
397+
plotter: EnsemblePlot
398+
| StatisticsPlot
399+
| HistogramPlot
400+
| GaussianKDEPlot
401+
| DistributionPlot
402+
| CrossEnsembleStatisticsPlot
403+
| StdDevPlot
404+
| MisfitsPlot,
399405
enabled: bool = True,
400406
) -> None:
401407
plot_widget = PlotWidget(name, plotter)
@@ -434,6 +440,7 @@ def keySelected(self) -> None:
434440
widget
435441
for widget in self._plot_widgets
436442
if widget._plotter.dimensionality == key_def.dimensionality
443+
and (key_def.observations or not widget._plotter.requires_observations)
437444
]
438445

439446
# Enabling/disabling tab triggers the

src/ert/gui/tools/plot/plottery/plots/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from .ensemble import EnsemblePlot
44
from .gaussian_kde import GaussianKDEPlot
55
from .histogram import HistogramPlot
6+
from .misfits import MisfitsPlot
67
from .statistics import StatisticsPlot
78
from .std_dev import StdDevPlot
89

@@ -12,6 +13,7 @@
1213
"EnsemblePlot",
1314
"GaussianKDEPlot",
1415
"HistogramPlot",
16+
"MisfitsPlot",
1517
"StatisticsPlot",
1618
"StdDevPlot",
1719
]

0 commit comments

Comments
 (0)