import numpy as np import matplotlib.pyplot as plt import time from classes import WaveForm from fun import find_hits, Recon_wf, get_spes, get_delays import sys #[ 9051 9052 9073 ... 48908 48922 48982] PMT_num=20 time_samples=1024 id=9051 pmts=[0,1,4,7,8,14] chns=[2,3,6,9,10,15] Init=20 spes, height_cuts, rise_time_cuts, BL=get_spes(pmts) delays=get_delays(pmts) WFs=np.zeros((len(pmts), 1000)) recon_WFs=np.zeros((len(pmts), 1000)) start_time = time.time() path='/home/gerak/Desktop/DireXeno/190803/Co57/' file=open(path+'out.DXD', 'rb') Data=np.fromfile(file, np.float32, (PMT_num+4)*(time_samples+2)*id) j=0 Data=np.fromfile(file, np.float32, (PMT_num+4)*(time_samples+2)) Data=np.reshape(Data, (PMT_num+4, time_samples+2)).T trig=np.argmin(Data[2:1002,0]) H=np.zeros(200) WFs=np.zeros((len(pmts), 1000))
import numpy as np import matplotlib.pyplot as plt import time from classes import WaveForm from fun import find_hits, Recon_wf, get_spes, get_delays import sys PMT_num = 20 time_samples = 1024 id = 2021 pmts = [0, 1, 4, 7, 8, 14] chns = [2, 3, 6, 9, 10, 15] pmts = [1] chns = [3] Init = 20 spes, height_cuts, dh3_cut, BL = get_spes(pmts) delays = get_delays(pmts) WFs = np.zeros((len(pmts), 1000)) recon_WFs = np.zeros((len(pmts), 1000)) start_time = time.time() path = '/home/gerak/Desktop/DireXeno/190803/Co57B/' file = open(path + 'out.DXD', 'rb') Data = np.fromfile(file, np.float32, (PMT_num + 4) * (time_samples + 2) * id) j = 0 Data = np.fromfile(file, np.float32, (PMT_num + 4) * (time_samples + 2)) Data = np.reshape(Data, (PMT_num + 4, time_samples + 2)).T trig = np.argmin(Data[2:1002, 0])
def find_trig(wf): bl = np.median(wf[:200]) top = np.median(wf[325:475]) mid = 0.5 * (bl + top) return np.argmin(np.abs(wf[:400] - mid)) PMT_num = 20 time_samples = 1024 id = 0 pmts = np.array([0, 1, 4, 7, 8, 14]) chns = [2, 3, 6, 9, 10, 15] Init = 20 spes, BL, height_cuts, dh3_cuts, spk_cuts = get_spes(pmts) delays = get_delays(pmts) WFs = np.zeros((len(pmts), 1000)) recon_WFs = np.zeros((len(pmts), 1000)) blw_cut = 25 start_time = time.time() rec = np.recarray(1000, dtype=[('area', 'i8', len(pmts)), ('blw', 'f8', len(pmts)), ('id', 'i8'), ('sat', 'i8', len(pmts)), ('chi2', 'f8', len(pmts)), ('h', 'i8', (200, len(pmts))), ('init_event', 'i8'), ('init_wf', 'i8', len(pmts))])