aboutsummaryrefslogtreecommitdiff
path: root/misc.py
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-09-12 12:13:06 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-09-12 12:13:06 +0200
commit459b4665e436a23a55202ccdfdaf5b3bb9c83416 (patch)
treeb2a6687dc07c07ff3d507b30a1e6f05cc6a74cf5 /misc.py
parent76a9a93d72ad3ff21854f532d64aca42c72c1ebf (diff)
downloadmeteo_toolbox-459b4665e436a23a55202ccdfdaf5b3bb9c83416.tar.gz
output dir
Diffstat (limited to 'misc.py')
-rw-r--r--misc.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/misc.py b/misc.py
index 90417f1..dcbd2f8 100644
--- a/misc.py
+++ b/misc.py
@@ -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')
+