コード例 #1
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short_3_mice")
     raw_data = uf.read_single_file(path, "20101010_110000.txt")
     cls.data1 = uf.from_raw_data(raw_data)
     cls.data2 = uf.from_raw_data(raw_data)
     cls.data2["Time"] += 15 * 60
     cls.combined_data = uf.append_data_sources([cls.data1, cls.data2])
コード例 #2
0
    def setUpClass(cls):
        config = SetupConfig()
        path = os.path.join(data_path, "weird_short_3_mice")
        raw_data = uf.read_single_file(path, "20101010_110000.txt")
        data = uf.from_raw_data(raw_data)
        cls.mismatch1 = uf.antenna_mismatch(data, config)
        cls.presences1 = uf.check_antenna_presence(data, config, 24 * 3600)
        res_path = os.path.join(path, "Results")
        files = glob.glob(os.path.join(res_path + "/diagnostics/*.csv"))
        for f in files:
            print("rm ", f)
        cls.length = len(data["Antenna"])
        out1 = uf.run_diagnostics(data, 24 * 3600, res_path, config)
        cls.str11, cls.str12, cls.str13, cls.str14, cls.str15 = out1
        path = os.path.join(data_path, "weird_short")
        raw_data = uf.read_single_file(path, "20101010_110000.txt")
        data = uf.from_raw_data(raw_data)
        cls.mismatch2 = uf.antenna_mismatch(data, config)
        cls.presences2 = uf.check_antenna_presence(data, config, 24 * 3600)
        res_path = os.path.join(path, "Results")
        files = glob.glob(os.path.join(res_path + "/diagnostics/*.csv"))
        for f in files:
            os.remove(f)

        out2 = uf.run_diagnostics(data, 24 * 3600, res_path, config)
        cls.str21, cls.str22, cls.str23, cls.str24, cls.str25 = out2
        path1 = os.path.join(data_path, "weird_very_short_3_mice")
        raw_data1 = uf.read_single_file(path1, "20101010_110000.txt")
        data1 = uf.from_raw_data(raw_data1)
        config1 = SetupConfig()
        res_path1 = os.path.join(path1, "Results")
        out = uf.run_diagnostics(data1, 24 * 3600, res_path1, config1)
        cls.incorr_tunnel = out[-1]
コード例 #3
0
 def setUpClass(cls):
     config = SetupConfig()
     cls.mismatched_pairs = config.mismatched_pairs
     path = os.path.join(data_path, "weird_short_3_mice")
     raw_data1 = uf.read_single_file(path, "20101010_110000.txt")
     cls.data1 = uf.from_raw_data(raw_data1)
     cls.mismatch1 = uf.antenna_mismatch(cls.data1, config)
     path = os.path.join(data_path, "weird_short")
     raw_data2 = uf.read_single_file(path, "20101010_110000.txt")
     cls.data2 = uf.from_raw_data(raw_data2)
     cls.mismatch2 = uf.antenna_mismatch(cls.data2, config)
コード例 #4
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short")
     raw_data = uf.read_single_file(path, "20101010_110000.txt")
     data = uf.from_raw_data(raw_data)
     setup_config = SetupConfig()
     cls.data = EcoHabDataBase(data, None, 2, setup_config)
     cls.config = Timeline(path)
コード例 #5
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short")
     raw_data = uf.read_single_file(path, "20101010_110000.txt")
     data = uf.from_raw_data(raw_data)
     cls.data = ut.get_animal_position(data["Time"],
                                       data["Antenna"],
                                       "mouse_1",
                                       2,
                                       same_pipe=SAME_PIPE,
                                       same_address=SAME_ADDRESS,
                                       opposite_pipe=OPPOSITE_PIPE,
                                       address=ADDRESS,
                                       surrounding=SURROUNDING,
                                       address_not_adjacent=NON_ADJACENT,
                                       internal_antennas=[])
     cls.visits = uf.transform_visits(cls.data)
コード例 #6
0
 def setUpClass(cls):
     antennas = ["1", "2", "1", "2", "3", "4", "5", "6", "7"]
     times = [1, 2, 2.5, 3, 4.5, 5.5, 6.5, 7.5, 10.5]
     durations = [3, 600, 3, 34, 55, 66, 1999, 200, 100]
     cls.pred_out = {"1 2": 1, "3 4": 0, "5 6": 1, "7 8": 0}
     keys = cls.pred_out.keys()
     cls.out, cls.tot = uf.incorrect_tunnel_single_mouse(
         keys, antennas, times, durations)
     cls.pred_tot = {"1 2": 3, "3 4": 1, "5 6": 1, "7 8": 0}
     path = os.path.join(data_path, "weird_very_short_3_mice")
     cls.raw_data = uf.read_single_file(path, "20101010_110000.txt")
     cls.data = uf.from_raw_data(cls.raw_data)
     config = SetupConfig()
     cls.out_i, cls.out_tot_i = uf.incorrect_tunnel_registrations(
         cls.data, config)
     cls.pred_out_i = {"1 2": 0, "3 4": 0, "5 6": 2, "7 8": 0}
     cls.pred_tot_i = {"1 2": 2, "3 4": 1, "5 6": 7, "7 8": 0}
コード例 #7
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short_3_mice")
     raw_data = uf.read_single_file(path, "20101010_110000.txt")
     data = uf.from_raw_data(raw_data)
     cls.config = SetupConfig()
     cls.presences = uf.check_antenna_presence(data, cls.config, 24 * 3600)
     cls.end = data["Time"][-1]
     cls.begs = []
     for key in cls.presences.keys():
         if len(cls.presences[key]):
             cls.begs.append(cls.presences[key][0][0])
     cls.begs_data = []
     for antenna in ["1", "2", "3", "4", "5", "6", "7", "8"]:
         if antenna == "4":
             continue
         idx = np.where(data["Antenna"] == antenna)[0][-1]
         cls.begs_data.append(np.round(data["Time"][idx]))
コード例 #8
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short")
     raw_data = uf.read_single_file(path, "20101010_110000.txt")
     cls.old_data = uf.from_raw_data(raw_data)
     cls.data = uf.rename_antennas("setup1", cls.old_data)
コード例 #9
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short_3_mice")
     raw_data = uf.read_single_file(path, "20101010_110000.txt")
     data = uf.from_raw_data(raw_data)
     config = SetupConfig()
     cls.mismatch1 = uf.skipped_registrations(data, config)
コード例 #10
0
 def setUpClass(cls):
     path = os.path.join(data_path, "weird_short_3_mice")
     cls.raw_data = uf.read_single_file(path, "20101010_110000.txt")
     cls.data = uf.from_raw_data(cls.raw_data)