diff --git a/example.danra.yaml b/example.danra.yaml index 3c4b81c..79e4999 100644 --- a/example.danra.yaml +++ b/example.danra.yaml @@ -21,30 +21,30 @@ output: end: 1990-09-06T00:00 compute_statistics: MeanOperator: - - name: mean + - var_name: mean dims: [grid_index, time] StdOperator: - - name: std + - var_name: std dims: [grid_index, time] DiffMeanOperator: - - name: diff_mean + - var_name: diff_mean dims: [grid_index, time] - - name: diff_time_mean + - var_name: diff_time_mean dims: [time] DiffStdOperator: - - name: diff_std + - var_name: diff_std dims: [grid_index, time] - - name: diff_time_std + - var_name: diff_time_std dims: [time] DiurnalDiffMeanOperator: - - name: diurnal_diff_mean + - var_name: diurnal_diff_mean dims: [grid_index, time] - - name: diurnal_diff_time_mean + - var_name: diurnal_diff_time_mean dims: [time] DiurnalDiffStdOperator: - - name: diurnal_diff_std + - var_name: diurnal_diff_std dims: [grid_index, time] - - name: diurnal_diff_time_std + - var_name: diurnal_diff_time_std dims: [time] val: start: 1990-09-06T00:00 diff --git a/mllam_data_prep/config.py b/mllam_data_prep/config.py index d0bee62..3878d0c 100644 --- a/mllam_data_prep/config.py +++ b/mllam_data_prep/config.py @@ -171,7 +171,7 @@ class Statistic: The dimensions to compute the statistics over, e.g. ["time", "grid_index"]. """ - name: str + var_name: str dims: List[str] diff --git a/mllam_data_prep/ops/statistics.py b/mllam_data_prep/ops/statistics.py index c59ac3f..6a7006e 100644 --- a/mllam_data_prep/ops/statistics.py +++ b/mllam_data_prep/ops/statistics.py @@ -41,9 +41,9 @@ def calc_stats( # of the same operator can be applied) for statistic in statistics: operator: StatisticOperator = globals()[stat_name]( - ds=ds, splitting_dim=splitting_dim, name=statistic.name + ds=ds, splitting_dim=splitting_dim, var_name=statistic.var_name ) - stats[statistic.name] = operator.calc_stats(statistic.dims) + stats[statistic.var_name] = operator.calc_stats(statistic.dims) else: raise NotImplementedError(stat_name) @@ -67,7 +67,7 @@ class StatisticOperator(ABC): ds: xr.Dataset splitting_dim: str - name: str + var_name: str @abstractmethod def calc_stats(self, dims):