Skip to content
Snippets Groups Projects
Commit 08c206f5 authored by Falco Weichselbaum's avatar Falco Weichselbaum
Browse files

ahead_dim=ahead now as kwarg to skill_score() and climatological_skill_score()

parent fef96a03
No related branches found
No related tags found
6 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!317enabled window_lead_time=1,!314include #313,!310Resolve "allow non-monotonic window lead times in helpers/statistics.py ahead_names definition",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #73565 passed
...@@ -288,7 +288,7 @@ class SkillScores: ...@@ -288,7 +288,7 @@ class SkillScores:
combination_strings = [f"{first}-{second}" for (first, second) in combinations] combination_strings = [f"{first}-{second}" for (first, second) in combinations]
return combinations, combination_strings return combinations, combination_strings
def skill_scores(self, window_lead_time: int) -> pd.DataFrame: def skill_scores(self, window_lead_time: int, ahead_dim="ahead") -> pd.DataFrame:
""" """
Calculate skill scores for all combinations of model names. Calculate skill scores for all combinations of model names.
...@@ -296,7 +296,7 @@ class SkillScores: ...@@ -296,7 +296,7 @@ class SkillScores:
:return: skill score for each comparison and forecast step :return: skill score for each comparison and forecast step
""" """
ahead_names = list(self.external_data.ahead.data) ahead_names = list(self.external_data[ahead_dim].data)
combinations, combination_strings = self.get_model_name_combinations() combinations, combination_strings = self.get_model_name_combinations()
skill_score = pd.DataFrame(index=combination_strings) skill_score = pd.DataFrame(index=combination_strings)
for iahead in ahead_names: for iahead in ahead_names:
...@@ -309,7 +309,7 @@ class SkillScores: ...@@ -309,7 +309,7 @@ class SkillScores:
return skill_score return skill_score
def climatological_skill_scores(self, internal_data: Data, window_lead_time: int, def climatological_skill_scores(self, internal_data: Data, window_lead_time: int,
forecast_name: str) -> xr.DataArray: forecast_name: str, ahead_dim="ahead") -> xr.DataArray:
""" """
Calculate climatological skill scores according to Murphy (1988). Calculate climatological skill scores according to Murphy (1988).
...@@ -322,7 +322,7 @@ class SkillScores: ...@@ -322,7 +322,7 @@ class SkillScores:
:return: all CASES as well as all terms :return: all CASES as well as all terms
""" """
ahead_names = list(self.external_data.ahead.data) ahead_names = list(self.external_data[ahead_dim].data)
all_terms = ['AI', 'AII', 'AIII', 'AIV', 'BI', 'BII', 'BIV', 'CI', 'CIV', 'CASE I', 'CASE II', 'CASE III', all_terms = ['AI', 'AII', 'AIII', 'AIV', 'BI', 'BII', 'BIV', 'CI', 'CIV', 'CASE I', 'CASE II', 'CASE III',
'CASE IV'] 'CASE IV']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment