diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2023-09-12 12:13:06 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2023-09-12 12:13:06 +0200 |
commit | 459b4665e436a23a55202ccdfdaf5b3bb9c83416 (patch) | |
tree | b2a6687dc07c07ff3d507b30a1e6f05cc6a74cf5 /misc.py | |
parent | 76a9a93d72ad3ff21854f532d64aca42c72c1ebf (diff) | |
download | meteo_toolbox-459b4665e436a23a55202ccdfdaf5b3bb9c83416.tar.gz |
output dir
Diffstat (limited to 'misc.py')
-rw-r--r-- | misc.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,4 @@ +import os import numpy as np import datetime @@ -7,3 +8,10 @@ def np_time_convert(dt64): seconds_since_epoch = (dt64 - unix_epoch) / one_second return datetime.datetime.utcfromtimestamp(seconds_since_epoch) + +def create_output_dir(path, clear=False): + if not os.path.exists(path): + os.makedirs(path) + elif clear: + raise Exception('clear not implemented') + |