Skip to content

Commit

Permalink
implement tendencies statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed May 1, 2024
1 parent 213a849 commit b5c9827
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion anemoi/datasets/create/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,21 @@ def patch(self, **kwargs):

apply_patch(self.path, **kwargs)

def init_additions(self):
def init_additions(self, delta=[1, 3, 6, 12]):
from .loaders import StatisticsAddition
from .loaders import TendenciesStatisticsAddition
from .loaders import TendenciesStatisticsDeltaNotMultipleOfFrequency

a = StatisticsAddition.from_dataset(path=self.path, print=self.print)
a.initialise()

for d in delta:
try:
a = TendenciesStatisticsAddition.from_dataset(path=self.path, print=self.print, delta=d)
a.initialise()
except TendenciesStatisticsDeltaNotMultipleOfFrequency:
self.print(f"Skipping delta={d} as it is not a multiple of the frequency.")

def run_additions(self, parts=None, delta=[1, 3, 6, 12]):
from .loaders import StatisticsAddition
from .loaders import TendenciesStatisticsAddition
Expand Down

0 comments on commit b5c9827

Please sign in to comment.