def initialize_pixel_status(mon_camera_container, shape):
    """
    Initialize the pixel status container in the case of
    simulation events (this should be done in the event source, but
    added here for the moment)
    """
    # initialize the container
    status_container = PixelStatusContainer()
    status_container.hardware_failing_pixels = np.zeros((shape[0], shape[1]),
                                                        dtype=bool)
    status_container.pedestal_failing_pixels = np.zeros((shape[0], shape[1]),
                                                        dtype=bool)
    status_container.flatfield_failing_pixels = np.zeros((shape[0], shape[1]),
                                                         dtype=bool)

    mon_camera_container.pixel_status = status_container
示例#2
0
    def initialize_mon_container(self):
        """
        Fill with MonitoringContainer.
        For the moment, initialize only the PixelStatusContainer

        """
        container = self.data.mon
        container.tels_with_data = [self.tel_id, ]
        mon_camera_container = container.tel[self.tel_id]

        # initialize the container
        status_container = PixelStatusContainer()
        status_container.hardware_failing_pixels = np.zeros((self.n_gains, self.n_camera_pixels), dtype=bool)
        status_container.pedestal_failing_pixels = np.zeros((self.n_gains, self.n_camera_pixels), dtype=bool)
        status_container.flatfield_failing_pixels = np.zeros((self.n_gains, self.n_camera_pixels), dtype=bool)

        mon_camera_container.pixel_status = status_container
示例#3
0
    def initialize_mon_container(self, array_event):
        """
        Fill with MonitoringContainer.
        For the moment, initialize only the PixelStatusContainer

        """
        container = array_event.mon
        mon_camera_container = container.tel[self.tel_id]

        shape = (N_GAINS, N_PIXELS)
        # all pixels broken by default
        status_container = PixelStatusContainer(
            hardware_failing_pixels=np.ones(shape, dtype=bool),
            pedestal_failing_pixels=np.zeros(shape, dtype=bool),
            flatfield_failing_pixels=np.zeros(shape, dtype=bool),
        )
        mon_camera_container.pixel_status = status_container
# read back the monitoring containers written with the tool calc_camera_calibration.py
from ctapipe.containers import FlatFieldContainer, WaveformCalibrationContainer, PedestalContainer, \
    PixelStatusContainer

from ctapipe.io.hdf5tableio import HDF5TableReader

__all__ = [
    'read_file',
    'plot_all'
    ]

ff_data = FlatFieldContainer()
ped_data = PedestalContainer()
calib_data = WaveformCalibrationContainer()
status_data = PixelStatusContainer()

channel = ['HG', 'LG']

plot_dir = "none"


def read_file(file_name, tel_id=1):
    """
     read camera calibration quantities

     Parameters
     ----------
     file_name:   calibration hdf5 file

     tel_id:      telescope id