summaryrefslogtreecommitdiffstats
path: root/dpd/src/subsample_align.py
diff options
context:
space:
mode:
Diffstat (limited to 'dpd/src/subsample_align.py')
-rwxr-xr-xdpd/src/subsample_align.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/dpd/src/subsample_align.py b/dpd/src/subsample_align.py
index 68f3591..a5e9f8c 100755
--- a/dpd/src/subsample_align.py
+++ b/dpd/src/subsample_align.py
@@ -7,8 +7,10 @@
import datetime
import logging
import os
-
-logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename)
+try:
+ logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename)
+except AttributeError:
+ logging_path = None
import numpy as np
from scipy import optimize
@@ -72,7 +74,7 @@ def subsample_align(sig, ref_sig, plot=False):
if optim_result.success:
best_tau = optim_result.x
- if plot:
+ if plot and logging_path is not None:
corr = np.vectorize(correlate_for_delay)
ixs = np.linspace(-1, 1, 100)
taus = corr(ixs)