diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-22 17:12:40 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-22 17:14:32 -0500 |
commit | 05a5ab2cd71e9c68a7002e1e8a89b887afc4240f (patch) | |
tree | 0e5f02468bfc960956d7d2cbbe93dfd03f530625 /binary_data.py | |
parent | 22e1c3b33984da853d1403843d9d2ce7a596c335 (diff) |
support manual outlier filtering
Diffstat (limited to 'binary_data.py')
-rw-r--r-- | binary_data.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/binary_data.py b/binary_data.py index 152afb7..39d6e05 100644 --- a/binary_data.py +++ b/binary_data.py | |||
@@ -5,7 +5,7 @@ from stats import iqr_remove_outliers, iqr_cutoff | |||
5 | 5 | ||
6 | 6 | ||
7 | def get_data(fname, scale, extent, cutoff=None, maxval=1000.0, | 7 | def get_data(fname, scale, extent, cutoff=None, maxval=1000.0, |
8 | stdev=False): | 8 | stdev=False, manual=None): |
9 | data = load_binary_file(fname) | 9 | data = load_binary_file(fname) |
10 | 10 | ||
11 | if cutoff and len(data) > cutoff: | 11 | if cutoff and len(data) > cutoff: |
@@ -31,6 +31,9 @@ def get_data(fname, scale, extent, cutoff=None, maxval=1000.0, | |||
31 | 31 | ||
32 | min_idx, max_idx = numpy.searchsorted(data, [lower, upper]) | 32 | min_idx, max_idx = numpy.searchsorted(data, [lower, upper]) |
33 | 33 | ||
34 | if manual: | ||
35 | max_idx -= manual | ||
36 | |||
34 | return [data, max_idx, min_idx, upper, lower] | 37 | return [data, max_idx, min_idx, upper, lower] |
35 | 38 | ||
36 | 39 | ||