Exemple #1
0
def process(input_paths):
    for path in input_paths:
        pedestal_path = path.replace(".tio", "_ped.tcal")
        reader = TIOReader(path)

        pedestal = PedestalTargetCalib(reader.n_pixels, reader.n_samples,
                                       reader.n_cells)
        desc = "Generating pedestal"
        for wfs in tqdm(reader, total=reader.n_events, desc=desc):
            if wfs.missing_packets:
                continue
            pedestal.add_to_pedestal(wfs, wfs.first_cell_id)
        pedestal.save_tcal(pedestal_path)
def process(path):
    pedestal_path = path.replace("_r0.tio", "_ped.tcal")
    reader = TIOReader(path)

    pedestal = PedestalTargetCalib(reader.n_pixels, reader.n_samples - 32,
                                   reader.n_cells)
    desc = "Generating pedestal"
    for wfs in tqdm(reader, total=reader.n_events, desc=desc):
        if wfs.missing_packets:
            continue
        cells = get_cell_ids_for_waveform(wfs.first_cell_id, reader.n_samples,
                                          reader.n_cells)
        wfs = wfs[:, 32:]
        wfs.first_cell_id = cells[32]
        pedestal.add_to_pedestal(wfs, wfs.first_cell_id)
    pedestal.save_tcal(pedestal_path)