예제 #1
0
        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)
예제 #2
0
            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[()]
예제 #3
0
                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: