From: W. Trevor King Date: Wed, 19 May 2010 08:08:42 +0000 (-0400) Subject: Fix 'min deviation' -> 'min deviations' typos. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4903fb9f61208db19b5ca45d3ee71cd3abd8cb9c;p=hooke.git Fix 'min deviation' -> 'min deviations' typos. In hooke.util.peak and hooke.plugin.convfilt/flatfilt. Also: * Fix "std == data.std" typo in hooke.util.peak.above_noise * Pass mean and std from noise to above_noise in find_peaks. --- diff --git a/hooke/plugin/convfilt.py b/hooke/plugin/convfilt.py index 37794ad..7400f22 100644 --- a/hooke/plugin/convfilt.py +++ b/hooke/plugin/convfilt.py @@ -72,7 +72,7 @@ Minimum number of peaks for curve acceptance. for key,value in [('cut side', 'positive'), ('stable', 0.005), ('max cut', 0.2), - ('min deviation', 5.0), + ('min deviations', 5.0), ('min points', 1), ('see double', 10e-9), ]: diff --git a/hooke/plugin/flatfilt.py b/hooke/plugin/flatfilt.py index 25abf75..a1d5e83 100644 --- a/hooke/plugin/flatfilt.py +++ b/hooke/plugin/flatfilt.py @@ -62,7 +62,7 @@ Median window filter size (in points). for key,value in [('cut side', 'both'), ('stable', 0.005), ('max cut', 0.2), - ('min deviation', 9.0), + ('min deviations', 9.0), ('min points', 4), ('see double', 10e-9), ]: @@ -163,7 +163,7 @@ Number of points to use in the initial rolling median filter. if value == None: # Use configured default value. params[key] = self.plugin.config[key] # TODO: better option parser to do this automatically by Argument.type - for key in ['max cut', 'min deviation', 'min points', 'see double', 'stable']: + for key in ['max cut', 'min deviations', 'min points', 'see double', 'stable']: params[key] = float(params[key]) # TODO: convert 'see double' from nm to points return z_data,d_data,params diff --git a/hooke/util/peak.py b/hooke/util/peak.py index 32ec79f..f980267 100644 --- a/hooke/util/peak.py +++ b/hooke/util/peak.py @@ -333,7 +333,7 @@ def above_noise(data, side='both', min_deviations=5.0, mean=None, std=None): if mean == None: mean = data.mean() if std == None: - std == data.std() + std = data.std() if side == 'negative': data = -data mean = -mean @@ -348,7 +348,7 @@ above_noise_arguments = [ Select the side of the curve that counts as "above". `positive`, `negative`, or `both`. """.strip()), - Argument('min deviation', type='float', default=5.0, help=""" + Argument('min deviations', type='float', default=5.0, help=""" Number of standard deviations above the noise to define a peak. Increase to tighten the filter. """.strip()), @@ -504,7 +504,8 @@ def find_peaks(data, **kwargs): The input parameters may be any accepted by the above functions. """ mask,mean,std,converged = noise(data, **_kwargs(kwargs, noise_arguments)) - mask = above_noise(data, **_kwargs(kwargs, above_noise_arguments)) + mask = above_noise(data, mean=mean, std=std, + **_kwargs(kwargs, above_noise_arguments)) peaks = mask_to_peaks(data, mask) peaks = merge_double_peaks( data, peaks, **_kwargs(kwargs, merge_double_peaks_arguments))