diff novelty.py @ 1:c11ea9e0357f

adding funcs
author mitian
date Thu, 02 Apr 2015 22:16:38 +0100
parents 26838b1f560f
children 294f66d285af
line wrap: on
line diff
--- a/novelty.py	Thu Apr 02 18:09:27 2015 +0100
+++ b/novelty.py	Thu Apr 02 22:16:38 2015 +0100
@@ -10,6 +10,7 @@
 import sys, os
 import numpy as np
 from scipy.signal import correlate2d, convolve2d
+import matplotlib.pyplot as plt
 
 # from utils.PeakPickerUtil import PeakPicker
 
@@ -60,9 +61,14 @@
 				
 	return kernel	
 	
-def getNoveltyPeaks(ssm, kernel_size, peak_picker, normalise=False):
+def process(ssm, kernel_size, peak_picker, normalise=False, plot=False):
 	'''Detect segment boundaries in the ssm.'''
 	novelty = getNoveltyCurve(ssm, kernel_size, normalise=False)
 	smoothed_novelty, novelty_peaks = peak_picker.process(novelty)
 	
-	return novelty, smoothed_novelty, novelty_peaks
\ No newline at end of file
+	if plot:
+		plot_detection(smoothed_novelty, novelty_peaks)
+	return novelty, smoothed_novelty, novelty_peaks
+	
+def plot_detection(smoothed_novelty, novelty_peaks):
+	pass
\ No newline at end of file