diff --git a/index_calculator/_consts.py b/index_calculator/_consts.py index f73f06c..99a2c6e 100644 --- a/index_calculator/_consts.py +++ b/index_calculator/_consts.py @@ -23,6 +23,7 @@ _split = { "fx": False, + "3hr": "5A", "day": "5A", "week": "10A", "mon": "10A", diff --git a/index_calculator/_preprocessing.py b/index_calculator/_preprocessing.py index 4161427..3a1af7f 100644 --- a/index_calculator/_preprocessing.py +++ b/index_calculator/_preprocessing.py @@ -62,6 +62,7 @@ def __init__( time_range=None, crop_time_axis=True, check_time_axis=True, + convert_time_axis=True, **kwargs, ): if ds is None: diff --git a/index_calculator/_processing.py b/index_calculator/_processing.py index 55d4e2b..046eed8 100755 --- a/index_calculator/_processing.py +++ b/index_calculator/_processing.py @@ -213,13 +213,12 @@ def _processing(self): time_encoding = ds.time.encoding time_encoding["dtype"] = np.float64 idx_ds.time.encoding = time_encoding - idx_ds = ( - pyh.time_control(idx_ds) - .add_time_bounds( - frequency=self.freq, - ) - .ds - ) + #idx_ds = ( + # pyh.time_control(idx_ds) + # .add_time_bounds( + # frequency=self.freq, + # ).ds + # ) self.unlimited_dims = "time" else: for dim in idx_ds[self.CIname].dims: diff --git a/index_calculator/index_calculator.py b/index_calculator/index_calculator.py index 3707642..9cd9d2d 100644 --- a/index_calculator/index_calculator.py +++ b/index_calculator/index_calculator.py @@ -61,11 +61,15 @@ def __init__(self, write=False, **kwargs): def _compute(self, write=False, **kwargs): """Compute climate index.""" preproc_obj = preprocessing(**kwargs) + print('preprocessing done.') proc_obj = processing(preproc_obj=preproc_obj) + print('processing done.') postproc_obj = postprocessing(proc_obj=proc_obj) + print('postprocessing done.') if write is True: outputwriter( postproc_obj=postproc_obj, **kwargs, ) + print('writing done.') return postproc_obj diff --git a/index_calculator/tables/convert_to_frequency.json b/index_calculator/tables/convert_to_frequency.json index 5982384..3bbeeb1 100644 --- a/index_calculator/tables/convert_to_frequency.json +++ b/index_calculator/tables/convert_to_frequency.json @@ -18,5 +18,25 @@ "vas": "mean" }, "freq": "D" - } + }, +"3hr": { + "var": { + "hurs": "mean", + "pr": "mean", + "prsn": "mean", + "rlds": "mean", + "rlus": "mean", + "rsds": "mean", + "rsus": "mean", + "sfcWind": "mean", + "sfcWindmax": "max", + "snd": "mean", + "tas": "mean", + "tasmax": "max", + "tasmin": "min", + "uas": "mean", + "vas": "mean" + }, + "freq": "3H" +} }