f = datainfo.open_experiment_data(mode='r') if args.matching: lsensors = datainfo.sensors[isig:fsig] lclusters = datainfo.clusters[isig:fsig] smatching = compute_signals_matching(datainfo, lsensors, rescale=args.rescale, globalc=args.globalclust) print (len(smatching)) else: lsensors = datainfo.sensors lclusters = datainfo.clusters smatching = [] for nclusters, sensor in zip(lclusters, lsensors): print(sensor) if args.matching: mapping = compute_matching_mapping(nclusters, sensor, smatching) else: mapping = None lfrstrings = [] lseqstrings = [] lacounts = [] for dfile, ename in zip(datainfo.datafiles, datainfo.expnames): print(dfile, ename) d = datainfo.get_peaks_time(f, dfile, sensor) if d is not None: clpeaks = datainfo.compute_peaks_labels(f, dfile, sensor, nclusters, globalc=args.globalclust) timepeaks = d[()] peakstr, peakfreq, lstrings = peaks_sequence_frequent_strings(timepeaks, gap=gap, rand=rand, sup=sup)
lsensors = datainfo.sensors[isig:fsig] lclusters = datainfo.clusters[isig:fsig] smatching = compute_signals_matching(datainfo, lsensors, rescale=args.rescale, globalc=args.globalclust) print(len(smatching)) else: lsensors = datainfo.sensors lclusters = datainfo.clusters smatching = [] for nclusters, sensor in zip(lclusters, lsensors): print(sensor) if args.matching: mapping = compute_matching_mapping(nclusters, sensor, smatching) else: mapping = None lfrstrings = [] lseqstrings = [] lacounts = [] for dfile, ename in zip(datainfo.datafiles, datainfo.expnames): print(dfile, ename) d = datainfo.get_peaks_time(f, dfile, sensor) if d is not None: clpeaks = datainfo.compute_peaks_labels( f, dfile, sensor, nclusters, globalc=args.globalclust) timepeaks = d[()]
save_sync_sequence(lsynchs, dfile) if args.sequential: save_sequential_transactions(lsynchs, ename, lsensors, gap=gap) # print len(lsynchs) # for i, s in enumerate(datainfo.sensors): # lsyn_fil = select_sensor(lsynchs, i, 1) # print s, len(lsyn_fil) # gen_peaks_contingency(peakdata, datainfo.sensors, dfile, datainfo.clusters) if args.matching: dmappings = {} for ncl, sensor in zip(lclusters, lsensors): dmappings[sensor] = compute_matching_mapping(ncl, sensor, smatching) else: dmappings = None if args.draw and args.matching: draw_synchs(lsynchs, dfile, ename, lsensors, window, datainfo.clusters[0], nmatch=len(smatching), dmappings=dmappings) if args.boxes: draw_synchs_boxes(lsynchs, dfile, ename, lsensors, window, datainfo.clusters[0], nmatch=len(smatching), dmappings=dmappings) if args.histogram: length_synch_frequency_histograms(lsynchs, dfile, ename, lsensors, window=int(round(window))) if args.coincidence: