Commit 008efaa6 authored by Gregor Moenke's avatar Gregor Moenke

enhanced doc, on the fly NaN interpolation

parent c30ba177
#### Version 0.8.17
- Warning and on-the-fly interpolation of non-contiguous missing values (NaNs)
#### Version 0.8.16
- added the pyBOAT icon
......
......@@ -343,7 +343,14 @@ class WAnalyzer:
def get_averaged_spectrum(self):
""" Average over time """
"""
Average Wavelet spectrum over time.
Returns
-------
mfourier : Fourier spectrum estimate
"""
if not self._has_spec:
print("Need to compute a wavelet spectrum first!")
......
''' This module provides all visualizations, both for the ui and the API '''
import matplotlib.pyplot as ppl
import numpy as np
from numpy import pi
......@@ -102,7 +104,6 @@ def draw_envelope(ax, time_vector, envelope):
ax.plot(time_vector, envelope, color=ENVELOPE_COLOR,
alpha=0.8, lw=TREND_LW, label="envelope")
def draw_detrended(ax, time_vector, detrended):
m, lw = get_marker_lw(detrended)
......@@ -543,7 +544,7 @@ def plot_ensemble_dynamics(
powers : DataFrame containing the 'median' and the
two quartiles 'Q1' and 'Q3' over time
phases : DataFrame containing 'R'
phases : DataFrame containing 1st order parameter 'R'
dt : float, the sampling interval to get a proper time axis
......
......@@ -717,10 +717,26 @@ class DataViewer(QWidget):
# checks for empty signal_id string
if signal_id:
self.raw_signal = self.df[signal_id]
raw_signal = self.df[signal_id]
# remove NaNs
self.raw_signal = self.raw_signal[~np.isnan(self.raw_signal)]
NaNswitches = np.sum( np.diff( np.isnan(raw_signal) ) )
if NaNswitches > 1:
print(f'Warning, non-contiguous NaN region found in {signal_id}!')
self.NonContiguous = MessageWindow(
'''
Non contiguous regions of missing values
encountered, using linear interpolation.
Try 'Import..' from the main menu
to interpolate missing values in all signals!
'''
, "Missing Values")
self.raw_signal = pyboat.core.interpolate_NaNs(raw_signal)
else:
# remove contiguous (like trailing) NaN region
self.raw_signal = raw_signal[~np.isnan(raw_signal)]
self.tvec = np.arange(0, len(self.raw_signal), step=1) * self.dt
return True # success
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment