diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2024-10-18 22:57:16 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2024-10-18 22:57:16 +0200 |
commit | f809e0dd326c1120ec28500f72a085a25acc5520 (patch) | |
tree | 48274b66a096d9bc8f7e2a0102e674566f5226a2 /metchart/aggregator/misc.py | |
parent | 1bb7d33a80f951b7dcc47f363b555fa0ec7f8387 (diff) | |
download | meteo_toolbox-f809e0dd326c1120ec28500f72a085a25acc5520.tar.gz |
fix imports
Diffstat (limited to 'metchart/aggregator/misc.py')
-rw-r--r-- | metchart/aggregator/misc.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/metchart/aggregator/misc.py b/metchart/aggregator/misc.py deleted file mode 100644 index 6594d0f..0000000 --- a/metchart/aggregator/misc.py +++ /dev/null @@ -1,23 +0,0 @@ -import os -import numpy as np -import datetime - -def np_time_convert(dt64, func=datetime.datetime.utcfromtimestamp): - unix_epoch = np.datetime64(0, 's') - one_second = np.timedelta64(1, 's') - seconds_since_epoch = (dt64 - unix_epoch) / one_second - - return func(seconds_since_epoch) - -def np_time_convert_offset(init, step): - return np_time_convert(init) + np_time_convert(step, func=lambda x: datetime.timedelta(seconds=x)) - -def np_time_list_convert_offset(init, steps): - return list(map(lambda x: np_time_convert_offset(init, x), steps)) - -def create_output_dir(path, clear=False): - if not os.path.exists(path): - os.makedirs(path) - elif clear: - raise Exception('clear not implemented') - |