diff options
author | andreas128 <Andreas> | 2017-09-02 19:18:01 +0200 |
---|---|---|
committer | andreas128 <Andreas> | 2017-09-02 19:18:01 +0200 |
commit | 719238f0adc19fb3de3b4fd2695b6bb30d4c9dd5 (patch) | |
tree | 05fb049f22a526dd3b2c46b99f7546a84f4938a3 /dpd/src/phase_align.py | |
parent | 6907d576b69ae065f25584fd4c6635c0c26beab2 (diff) | |
download | dabmod-719238f0adc19fb3de3b4fd2695b6bb30d4c9dd5.tar.gz dabmod-719238f0adc19fb3de3b4fd2695b6bb30d4c9dd5.tar.bz2 dabmod-719238f0adc19fb3de3b4fd2695b6bb30d4c9dd5.zip |
Cleanup logging and plots
Diffstat (limited to 'dpd/src/phase_align.py')
-rw-r--r-- | dpd/src/phase_align.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dpd/src/phase_align.py b/dpd/src/phase_align.py index 7045586..f8e38c4 100644 --- a/dpd/src/phase_align.py +++ b/dpd/src/phase_align.py @@ -15,7 +15,7 @@ import sys import matplotlib.pyplot as plt -def phase_align(sig, ref_sig): +def phase_align(sig, ref_sig, plot=False): """Do phase alignment for sig relative to the reference signal ref_sig. @@ -26,7 +26,7 @@ def phase_align(sig, ref_sig): real_diffs = np.cos(angle_diff) imag_diffs = np.sin(angle_diff) - if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + if logging.getLogger().getEffectiveLevel() == logging.DEBUG and plot: dt = datetime.datetime.now().isoformat() fig_path = logging_path + "/" + dt + "_phase_align.pdf" @@ -66,7 +66,7 @@ def phase_align(sig, ref_sig): )) sig = sig * np.exp(1j * -angle) - if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + if logging.getLogger().getEffectiveLevel() == logging.DEBUG and plot: plt.subplot(515) plt.plot(np.angle(ref_sig[:128]), label="ref_sig") plt.plot(np.angle(sig[:128]), label="sig") |