Commit 6d24e45b authored by Remy Moll's avatar Remy Moll
Browse files

Better test.ipynb

parent 68dd4a91
......@@ -4,7 +4,11 @@ from scipy import signal
import decode
DECODER = decode.ArrayLoader("data/")
class Channel:
"""Basic object: one channel consists of 1024 readouts. There are two distinct quantities: the timings and the voltage"""
def __init__(self, number, timings, voltage, nbins) -> None:
self.number = number
self.timings = timings
......@@ -37,7 +41,7 @@ class Channel:
def find_peaks(self):
peak_indices, _ = signal.find_peaks(np.abs(self.voltage), height=0.1)#, width=5)
peak_indices, _ = signal.find_peaks(np.abs(self.voltage), height=0.05)#, width=5)
return peak_indices
......@@ -49,13 +53,15 @@ class Channel:
if len(self.peaks) == 0:
return False
if len(self.peaks) > 10:
if len(self.peaks) > 20:
return False
return True
class Event:
"""One event is the data taken across all (usually 8) channels"""
def __init__(self, event_data, nbins, min_good_channels) -> None:
self.min_good_channels = min_good_channels
self.channels = []
......@@ -71,8 +77,13 @@ class Event:
return good >= self.min_good_channels
def recreate_muon_path(self, drift_velocity):
pass
class Measurement:
"""The whole measurement consists of n events, each having data across multiple channels"""
def __init__(self, cathode_voltage, n_events=0, delay=0, nbins=0, min_good_channels=6) -> None:
loaded, cathode_voltage, n_events, delay = DECODER.get_data(cathode_voltage, events=n_events, delay=delay)
......
Supports Markdown
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