aboutsummaryrefslogtreecommitdiff
path: root/misc.py
diff options
context:
space:
mode:
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')
+