#TODO full fit including cross talk # Fit the baseline and sigma_e of all pixels adcs.fit(fit_dark.fit_func, fit_dark.p0_func, fit_dark.slice_func, fit_dark.bounds_func, config=prev_fit_result) if options.verbose: print('--|> Save the data in %s' % (options.output_directory + options.fit_filename)) np.savez_compressed(options.output_directory + options.fit_filename, adcs_fit_result=adcs.fit_result) else: if options.verbose: print('--|> Recover data from %s' % (options.output_directory + options.fit_filename)) file = np.load(options.output_directory + options.fit_filename) adcs.fit_result = np.copy(file['adcs_fit_result']) adcs.fit_function = fit_dark.fit_func # Leave the hand plt.ion() # Define Geometry sector_to_angle = {1: 120., 2: 240., 3: 0.} cts = cts.CTS('/data/software/CTS/config/cts_config_%d.cfg' % (sector_to_angle[options.cts_sector]), '/data/software/CTS/config/camera_config.cfg', angle=sector_to_angle[options.cts_sector], connected=False) geom, good_pixels = generate_geometry(cts) # Perform some plots display_var(adcs, geom, title='$\sigma_e$ [ADC]', index_var=2, limit_min=0., limit_max=2., bin_width=0.05) display_var(adcs, geom, title='Baseline [ADC]', index_var=1, limit_min=1950., limit_max=2050., bin_width=10.) display([adcs],geom,norm='log')
#!/usr/bin/env python3 import matplotlib.pyplot as plt from utils.geometry import generate_geometry from ctapipe import visualization from ctapipe.calib import pedestals from ctapipe.calib.camera import integrators import numpy as np from ctapipe.io import zfits from cts import cameratestsetup as cts plotting = True # Define Geometry cts = cts.CTS('/data/software/CTS/config/cts_config_0.cfg', '/data/software/CTS/config/camera_config.cfg', angle=0., connected=False) geom, good_pixels = generate_geometry(cts, availableBoard={ 1: [0, 1, 2, 3, 4, 6, 7, 8, 9], 2: [], 3: [] }) good_pixels_mask = np.repeat(good_pixels, 50).reshape(good_pixels.shape[0], 1, 50) plt.ion() availableSector = [1] availableBoard = [0, 1, 2, 3, 4, 6, 7, 8, 9] # Define cts cts = cts.CTS('/data/software/CTS/config/cts_config_0.cfg',