Skip to content
Snippets Groups Projects
Commit f9ce4697 authored by v.gramlich1's avatar v.gramlich1
Browse files

remove logging from postprocessing_plotting.py, minor_tail_loss=MSE

parent 4a662aa5
No related branches found
No related tags found
1 merge request!302Draft: Resolve "Class-based Oversampling technique"
Pipeline #75860 passed with warnings
......@@ -139,9 +139,7 @@ class PlotOversamplingContingency(AbstractPlotClass):
def _min_max_threshold(self):
min_threshold = 0
max_threshold = 0
logging.info("min_max thresholds")
for station in self._stations:
logging.info(f"{station}")
file = os.path.join(self._file_path, self._file_name % station)
forecast_file = xr.open_dataarray(file)
obs = forecast_file.sel(type=self._obs_name)
......@@ -159,17 +157,12 @@ class PlotOversamplingContingency(AbstractPlotClass):
for station in self._stations:
file = os.path.join(self._file_path, self._file_name % station)
forecast_file = xr.open_dataarray(file)
logging.info(f"{station}: load obs")
obs = forecast_file.sel(type=self._obs_name)
logging.info(f"{station}: load pred")
predictions = [forecast_file.sel(type=self._model_name)]
logging.info(f"{station}: load comp, comp_list:{self._comp_names}")
for comp in self._comp_names:
c = self._load_competitors(station, [comp])
if c is not None:
logging.info(f"{station}: {comp} is not None")
predictions.append(c.sel(type=comp))
logging.info(f"itearate over thresholds")
for threshold in range(self._min_threshold, self._max_threshold):
for pred in predictions:
ta, fa, fb, tb = self._single_contingency(obs, pred, threshold)
......@@ -177,7 +170,6 @@ class PlotOversamplingContingency(AbstractPlotClass):
contingency_array.loc[dict(thresholds=threshold, contingency_cell="fa", type=pred.type.values)] = fa + 1
contingency_array.loc[dict(thresholds=threshold, contingency_cell="fb", type=pred.type.values)] = fb + 1
contingency_array.loc[dict(thresholds=threshold, contingency_cell="tb", type=pred.type.values)] = tb + 1
logging.info(f"{station}: finished")
return contingency_array
def _single_contingency(self, obs, pred, threshold):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment