How to use the ctapipe.core.Field function in ctapipe

To help you get started, we’ve selected a few ctapipe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
", estimated by dividing the ring into segments"
        " and counting segments above a threshold",
    )
    intensity_ratio = Field(nan, "Intensity ratio of pixels in the ring to all pixels")
    mean_squared_error = Field(
        nan, "MSE of the deviation of all pixels after cleaning from the ring fit"
    )


class FlatFieldContainer(Container):
    """
    Container for flat-field parameters obtained from a set of
    [n_events] flat-field events
    """

    sample_time = Field(
        0 * u.s, "Time associated to the flat-field event set ", unit=u.s
    )
    sample_time_min = Field(
        nan * u.s, "Minimum time of the flat-field events", unit=u.s
    )
    sample_time_max = Field(
        nan * u.s, "Maximum time of the flat-field events", unit=u.s
    )
    n_events = Field(0, "Number of events used for statistics")

    charge_mean = Field(None, "np array of signal charge mean (n_chan, n_pix)")
    charge_median = Field(None, "np array of signal charge median (n_chan, n_pix)")
    charge_std = Field(
        None, "np array of signal charge standard deviation (n_chan, n_pix)"
    )
    time_mean = Field(None, "np array of signal time mean (n_chan, n_pix)", unit=u.ns)
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
)
    altitude_cor = Field(
        0, "the tracking Altitude corrected for pointing errors for the telescope"
    )


class MCEventContainer(Container):
    """
    Monte-Carlo
    """

    container_prefix = "true"

    energy = Field(nan * u.TeV, "Monte-Carlo Energy", unit=u.TeV)
    alt = Field(nan * u.deg, "Monte-carlo altitude", unit=u.deg)
    az = Field(nan * u.deg, "Monte-Carlo azimuth", unit=u.deg)
    core_x = Field(nan * u.m, "MC core position", unit=u.m)
    core_y = Field(nan * u.m, "MC core position", unit=u.m)
    h_first_int = Field(nan * u.m, "Height of first interaction", unit=u.m)
    x_max = Field(nan * u.g / (u.cm ** 2), "MC Xmax value", unit=u.g / (u.cm ** 2))
    shower_primary_id = Field(
        -1,
        "MC shower primary ID 0 (gamma), 1(e-),"
        "2(mu-), 100*A+Z for nucleons and nuclei,"
        "negative for antimatter.",
    )
    tel = Field(Map(MCCameraEventContainer), "map of tel_id to MCCameraEventContainer")


class MCHeaderContainer(Container):
    """
    Monte-Carlo information that doesn't change per event
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
Container holding pointing information for a single telescope
    after all necessary correction and calibration steps.
    These values should be used in the reconstruction to transform
    between camera and sky coordinates.
    """

    azimuth = Field(nan * u.rad, "Azimuth, measured N->E", unit=u.rad)
    altitude = Field(nan * u.rad, "Altitude", unit=u.rad)


class PointingContainer(Container):
    tel = Field(Map(TelescopePointingContainer), "Telescope pointing positions")
    array_azimuth = Field(nan * u.rad, "Array pointing azimuth", unit=u.rad)
    array_altitude = Field(nan * u.rad, "Array pointing altitude", unit=u.rad)
    array_ra = Field(nan * u.rad, "Array pointing right ascension", unit=u.rad)
    array_dec = Field(nan * u.rad, "Array pointing declination", unit=u.rad)


class EventCameraCalibrationContainer(Container):
    """
    Container for the calibration coefficients for the current event and camera
    """

    dl1 = Field(
        DL1CameraCalibrationContainer(), "Container for DL1 calibration coefficients"
    )


class EventCalibrationContainer(Container):
    """
    Container for calibration coefficients for the current event
    """
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
nan * u.m, "Minimum wavelength of cherenkov light", unit=u.nm
    )
    corsika_wlen_max = Field(
        nan * u.m, "Maximum wavelength of cherenkov light", unit=u.nm
    )
    corsika_low_E_detail = Field(nan, "Detector MC information")
    corsika_high_E_detail = Field(nan, "Detector MC information")


class TelescopeTriggerContainer(Container):
    time = Field(NAN_TIME, "Telescope trigger time")


class TriggerContainer(Container):
    time = Field(NAN_TIME, "central average time stamp")
    tels_with_trigger = Field([], "list of telescope ids with data")
    event_type = Field(EventType.SUBARRAY, "Event type")
    tel = Field(Map(TelescopeTriggerContainer), "telescope-wise trigger information")


class ReconstructedShowerContainer(Container):
    """
    Standard output of algorithms reconstructing shower geometry
    """

    alt = Field(nan * u.deg, "reconstructed altitude", unit=u.deg)
    alt_uncert = Field(nan * u.deg, "reconstructed altitude uncertainty", unit=u.deg)
    az = Field(nan * u.deg, "reconstructed azimuth", unit=u.deg)
    az_uncert = Field(nan * u.deg, "reconstructed azimuth uncertainty", unit=u.deg)
    core_x = Field(
        nan * u.m, "reconstructed x coordinate of the core position", unit=u.m
    )
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
"array containing the telescope ids used in the"
            " reconstruction of the shower"
        ),
    )
    goodness_of_fit = Field(0.0, "goodness of the algorithm fit")


class ParticleClassificationContainer(Container):
    """
    Standard output of gamma/hadron classification algorithms
    """

    # TODO: Do people agree on this? This is very MAGIC-like.
    # TODO: Perhaps an integer classification to support different classes?
    # TODO: include an error on the prediction?
    prediction = Field(
        0.0,
        (
            "prediction of the classifier, defined between "
            "[0,1], where values close to 0 are more "
            "gamma-like, and values close to 1 more "
            "hadron-like"
        ),
    )
    is_valid = Field(
        False,
        (
            "classificator validity flag. True if the "
            "predition was successful within the algorithm "
            "validity range"
        ),
    )
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
"""Time when shower simulation started,
                              CORSIKA: only date""",
    )
    shower_prog_id = Field(nan, "CORSIKA=1, ALTAI=2, KASCADE=3, MOCCA=4")
    detector_prog_start = Field(nan, "Time when detector simulation started")
    detector_prog_id = Field(nan, "simtelarray=1")
    num_showers = Field(nan, "Number of showers simulated")
    shower_reuse = Field(nan, "Numbers of uses of each shower")
    max_alt = Field(nan * u.rad, "Maximimum shower altitude", unit=u.rad)
    min_alt = Field(nan * u.rad, "Minimum shower altitude", unit=u.rad)
    max_az = Field(nan * u.rad, "Maximum shower azimuth", unit=u.rad)
    min_az = Field(nan * u.rad, "Minimum shower azimuth", unit=u.rad)
    diffuse = Field(False, "Diffuse Mode On/Off")
    max_viewcone_radius = Field(nan * u.deg, "Maximum viewcone radius", unit=u.deg)
    min_viewcone_radius = Field(nan * u.deg, "Minimum viewcone radius", unit=u.deg)
    max_scatter_range = Field(nan * u.m, "Maximum scatter range", unit=u.m)
    min_scatter_range = Field(nan * u.m, "Minimum scatter range", unit=u.m)
    core_pos_mode = Field(nan, "Core Position Mode (fixed/circular/...)")
    injection_height = Field(nan * u.m, "Height of particle injection", unit=u.m)
    atmosphere = Field(nan * u.m, "Atmospheric model number")
    corsika_iact_options = Field(nan, "Detector MC information")
    corsika_low_E_model = Field(nan, "Detector MC information")
    corsika_high_E_model = Field(nan, "Detector MC information")
    corsika_bunchsize = Field(nan, "Number of photons per bunch")
    corsika_wlen_min = Field(
        nan * u.m, "Minimum wavelength of cherenkov light", unit=u.nm
    )
    corsika_wlen_max = Field(
        nan * u.m, "Maximum wavelength of cherenkov light", unit=u.nm
    )
    corsika_low_E_detail = Field(nan, "Detector MC information")
    corsika_high_E_detail = Field(nan, "Detector MC information")
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
None, "np array of signal charge standard deviation (n_chan, n_pix)"
    )
    time_mean = Field(None, "np array of signal time mean (n_chan, n_pix)", unit=u.ns)
    time_median = Field(
        None, "np array of signal time median (n_chan, n_pix)", unit=u.ns
    )
    time_std = Field(
        None, "np array of signal time standard deviation (n_chan, n_pix)", unit=u.ns
    )
    relative_gain_mean = Field(
        None, "np array of the relative flat-field coefficient mean (n_chan, n_pix)"
    )
    relative_gain_median = Field(
        None, "np array of the relative flat-field coefficient  median (n_chan, n_pix)"
    )
    relative_gain_std = Field(
        None,
        "np array of the relative flat-field coefficient standard deviation (n_chan, n_pix)",
    )
    relative_time_median = Field(
        None,
        "np array of time (median) - time median averaged over camera (n_chan, n_pix)",
        unit=u.ns,
    )

    charge_median_outliers = Field(
        None, "Boolean np array of charge median outliers (n_chan, n_pix)"
    )
    charge_std_outliers = Field(
        None, "Boolean np array of charge std outliers (n_chan, n_pix)"
    )
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
None, "np array of the relative flat-field coefficient  median (n_chan, n_pix)"
    )
    relative_gain_std = Field(
        None,
        "np array of the relative flat-field coefficient standard deviation (n_chan, n_pix)",
    )
    relative_time_median = Field(
        None,
        "np array of time (median) - time median averaged over camera (n_chan, n_pix)",
        unit=u.ns,
    )

    charge_median_outliers = Field(
        None, "Boolean np array of charge median outliers (n_chan, n_pix)"
    )
    charge_std_outliers = Field(
        None, "Boolean np array of charge std outliers (n_chan, n_pix)"
    )

    time_median_outliers = Field(
        None, "Boolean np array of pixel time (median) outliers (n_chan, n_pix)"
    )


class PedestalContainer(Container):
    """
    Container for pedestal parameters obtained from a set of
    [n_pedestal] pedestal events
    """

    n_events = Field(-1, "Number of events used for statistics")
    sample_time = Field(
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
)
    core = Field(nan, "Percentage of photo-electrons inside the hillas ellipse")
    pixel = Field(nan, "Percentage of photo-electrons in the brightest pixel")


class TimingParametersContainer(Container):
    """
    Slope and Intercept of a linear regression of the arrival times
    along the shower main axis
    """

    container_prefix = "timing"
    slope = Field(
        nan / u.m, "Slope of arrival times along main shower axis", unit=1 / u.m
    )
    slope_err = Field(nan / u.m, "Uncertainty `slope`", unit=1 / u.m)
    intercept = Field(nan, "intercept of arrival times along main shower axis")
    intercept_err = Field(nan, "Uncertainty `intercept`")
    deviation = Field(
        nan,
        "Root-mean-square deviation of the pulse times "
        "with respect to the predicted time",
    )


class MorphologyContainer(Container):
    """ Parameters related to pixels surviving image cleaning """

    num_pixels = Field(-1, "Number of usable pixels")
    num_islands = Field(-1, "Number of distinct islands in the image")
    num_small_islands = Field(-1, "Number of <= 2 pixel islands")
    num_medium_islands = Field(-1, "Number of 2-50 pixel islands")
github cta-observatory / ctapipe / ctapipe / containers.py View on Github external
max_alt = Field(nan * u.rad, "Maximimum shower altitude", unit=u.rad)
    min_alt = Field(nan * u.rad, "Minimum shower altitude", unit=u.rad)
    max_az = Field(nan * u.rad, "Maximum shower azimuth", unit=u.rad)
    min_az = Field(nan * u.rad, "Minimum shower azimuth", unit=u.rad)
    diffuse = Field(False, "Diffuse Mode On/Off")
    max_viewcone_radius = Field(nan * u.deg, "Maximum viewcone radius", unit=u.deg)
    min_viewcone_radius = Field(nan * u.deg, "Minimum viewcone radius", unit=u.deg)
    max_scatter_range = Field(nan * u.m, "Maximum scatter range", unit=u.m)
    min_scatter_range = Field(nan * u.m, "Minimum scatter range", unit=u.m)
    core_pos_mode = Field(nan, "Core Position Mode (fixed/circular/...)")
    injection_height = Field(nan * u.m, "Height of particle injection", unit=u.m)
    atmosphere = Field(nan * u.m, "Atmospheric model number")
    corsika_iact_options = Field(nan, "Detector MC information")
    corsika_low_E_model = Field(nan, "Detector MC information")
    corsika_high_E_model = Field(nan, "Detector MC information")
    corsika_bunchsize = Field(nan, "Number of photons per bunch")
    corsika_wlen_min = Field(
        nan * u.m, "Minimum wavelength of cherenkov light", unit=u.nm
    )
    corsika_wlen_max = Field(
        nan * u.m, "Maximum wavelength of cherenkov light", unit=u.nm
    )
    corsika_low_E_detail = Field(nan, "Detector MC information")
    corsika_high_E_detail = Field(nan, "Detector MC information")


class TelescopeTriggerContainer(Container):
    time = Field(NAN_TIME, "Telescope trigger time")


class TriggerContainer(Container):
    time = Field(NAN_TIME, "central average time stamp")