Exemplo n.º 1
0
    def calc_pedestals(self):
        start = 15
        end = None

        for event in hessio_event_source(self.filename):
            for telid in event.r0.tels_with_data:
                for chan in range(event.r0.tel[telid].adc_samples.shape[0]):
                    traces = event.r0.tel[telid].adc_samples[chan, ...]
                    peds, pedvars = pedestals.calc_pedestals_from_traces(
                        traces, start, end)

                    print("Number of samples: {}".format(traces.shape[1]))
                    print("Calculate over window:({},{})".format(start, end))
                    print("PEDS:", peds)
                    print("VARS:", pedvars)
                    print("-----")

        self.plot_peds(event, peds, pedvars)
        plt.show()
Exemplo n.º 2
0
    start = 15
    end = None  # None means through sample

    # loop over all events, all telescopes and all channels and call
    # the calc_peds function defined above to do some work:
    for event in event_source(filename):
        for telid in event.r0.tels_with_data:
            for chan in range(event.r0.tel[telid].waveform.shape[0]):

                print(f"CT{telid} chan {chan}:")

                traces = event.r0.tel[telid].waveform[chan, ...]

                peds, pedvars = pedestals.calc_pedestals_from_traces(
                    traces, start, end
                )

                print("Number of samples: {}".format(traces.shape[1]))
                print(f"Calculate over window:({start},{end})")
                print("PEDS:", peds)
                print("VARS:", pedvars)
                print("-----")

    # as an example, for the final event, let's plot the pedestals and
    # variances: (you could also move this into the for-loop, but
    # would then have tons of plots)

    plot_peds(peds, pedvars)
    plt.show()
Exemplo n.º 3
0
    # sample windows:

    start = 15
    end = None  # None means through sample

    # loop over all events, all telescopes and all channels and call
    # the calc_peds function defined above to do some work:
    for event in hessio_event_source(filename):
        for telid in event.dl0.tels_with_data:
            for chan in event.dl0.tel[telid].adc_samples.keys():

                print("CT{} chan {}:".format(telid, chan))

                traces = event.dl0.tel[telid].adc_samples[chan]
                peds, pedvars = pedestals.calc_pedestals_from_traces(traces,
                                                                     start,
                                                                     end)

                print("Number of samples: {}".format(traces.shape[1]))
                print("Calculate over window:({},{})".format(start, end))
                print("PEDS:", peds)
                print("VARS:", pedvars)
                print("-----")

    # as an example, for the final event, let's plot the pedestals and
    # variances: (you could also move this into the for-loop, but
    # would then have tons of plots)

    plot_peds(peds, pedvars)
    plt.show()
Exemplo n.º 4
0
neigh_mask = generate_neighbourg_masks()
hollow_neigh_mask = generate_hollow_neighbourg_masks()

min_evtcounter = 3383 - 3018
best_pix = -1
h, h1 = [], []
evt_counter = 0
cnt = 0
for event in inputfile_reader:
    evt_counter += 1
    if evt_counter < min_evtcounter: continue
    for telid in event.r1.tels_with_data:
        data = np.array(list(event.r1.tel[telid].adc_samples.values()))
        # pedestal subtraction
        peds, pedvars = pedestals.calc_pedestals_from_traces(data, 0, 50)
        nsamples = event.r1.tel[telid].num_samples
        # data_ped = np.array([data_ped[0], data_ped[0]])  # Test LG functionality
        params = {
            "integrator": "nb_peak_integration",
            "integration_window": [50, 0],
            "integration_sigamp": [2, 4],
            "integration_lwt": 0
        }

        data = np.array([data])
        integration, window, peakpos = integrators.simple_integration(
            data, params)
        integration[0] = integration[0] / 50.
        integration_sub = integration[0] - np.ones(1296) * np.median(
            np.extract(good_pixels, integration[0]))