nectarchain.makers.component.waveforms_component.WaveformsComponent#

class WaveformsComponent(**kwargs: Any)[source]#

Bases: ArrayDataComponent

Methods

add_traits

Dynamically add trait attributes to the HasTraits instance.

broken_pixels_hg

Returns an array of broken pixels for high gain for the specified trigger type.

broken_pixels_lg

Returns an array of broken pixels for low gain for the specified trigger type.

class_config_rst_doc

Generate rST documentation for this class' config options.

class_config_section

Get the config section for this class.

class_get_help

Get the help string for this class in ReST format.

class_get_trait_help

Get the helptext string for a single trait.

class_own_trait_events

Get a dict of all event handlers defined on this class, not a parent.

class_own_traits

Get a dict of all the traitlets defined on this class, not a parent.

class_print_help

Get the help string for a single trait and print it.

class_trait_names

Get a list of all the names of this class' traits.

class_traits

Get a dict of all the traits of this class.

create_from_events_list

Create a container for the extracted waveforms from a list of events.

event_id

Returns an array of event IDs for the specified trigger type.

event_type

Returns an array of event types for the specified trigger type.

finish

Make the output container for the selected trigger types.

from_name

Obtain an instance of a subclass via its name

get_current_config

return the current configuration as a dict (e.g. the values of all traits, even if they were not set during configuration).

has_trait

Returns True if the object has a trait with the specified name.

hold_trait_notifications

Context manager for bundling trait change notifications and cross validation.

merge

Method to merge 2 ArrayDataContainer into one single ArrayDataContainer.

merge_along_slices

multiplicity

Returns an array of multiplicities for the specified trigger type.

nevents

Returns the number of events for the specified trigger type.

non_abstract_subclasses

Get a dict of all non-abstract subclasses of this class.

notify_change

Notify observers of a change event

observe

Setup a handler to be called when a trait changes.

on_trait_change

DEPRECATED: Setup a handler to be called when a trait changes.

section_names

return section names as a list

select_container_array_field

Selects specific fields from an ArrayDataContainer object based on a given list of pixel IDs.

select_waveforms_hg

Select HIGH GAIN waveforms from the container.

select_waveforms_lg

Select LOW GAIN waveforms from the container.

set_trait

Forcibly sets trait attribute, including read-only attributes.

setup_instance

sort

Sort the waveformsContainer based on a specified method.

trait_defaults

Return a trait's default value or a dictionary of them

trait_events

Get a dict of all the event handlers of this class.

trait_has_value

Returns True if the specified trait has a value.

trait_metadata

Get metadata values for trait by key.

trait_names

Get a list of all the names of this class' traits.

trait_values

A dict of trait names and their values.

traits

Get a dict of all the traits of this class.

trig_pattern

Returns an array of trigger patterns for the specified trigger type.

trig_pattern_all

Returns an array of trigger patterns for all events for the specified trigger type.

ucts_busy_counter

Returns an array of UCTS busy counters for the specified trigger type.

ucts_event_counter

Returns an array of UCTS event counters for the specified trigger type.

ucts_timestamp

Returns an array of UCTS timestamps for the specified trigger type.

unobserve

Remove a trait change handler.

unobserve_all

Remove trait change handlers of any type for the specified name.

update_config

Update config and load the new values

wfs_hg

Returns the waveform data for the specified trigger type.

wfs_lg

Returns the waveform data for the specified trigger type in the low gain channel.

Attributes

CAMERA

CAMERA_NAME

The camera name

SubComponents

List of Component names that are used inside current component, this is used to resolve recursively the configurable traits defined in sub-components.

TEL_ID

The telescope ID

config

A trait whose value must be an instance of a specified class.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

geometry

Returns a deep copy of the geometry attribute.

npixels

nsamples

Returns a deep copy of the nsamples attribute.

parent

A trait whose value must be an instance of a specified class.

pixels_id

run_number

subarray

SubComponents#

List of Component names that are used inside current component, this is used to resolve recursively the configurable traits defined in sub-components. Possible values: []

__call__(event, *args, **kwargs)[source]#

Process an event and extract waveforms.

Args:

event (NectarCAMDataContainer): The event to process and extract waveforms from. trigger (EventType): The type of trigger for the event.

static create_from_events_list(events_list, run_number, npixels, nsamples, subarray, pixels_id, tel_id=None)[source]#

Create a container for the extracted waveforms from a list of events.

Return type:

WaveformsContainer

Args:

events_list (list[NectarCAMDataContainer]): A list of events to extract waveforms from. run_number (int): The ID of the run to be loaded. npixels (int): The number of pixels in the waveforms. nsamples (int): The number of samples in the waveforms. subarray (SubarrayDescription): The subarray description instance. pixels_id (int): The ID of the pixels to extract waveforms from.

Returns:

WaveformsContainer: A container object that contains the extracted waveforms and other relevant information.

finish(*args, **kwargs)[source]#

Make the output container for the selected trigger types.

Args:

trigger_type (EventType): The selected trigger types.

Returns:

list[WaveformsContainer]: A list of output containers for the selected trigger types.

property geometry#

Returns a deep copy of the geometry attribute.

Returns:

A deep copy of the geometry attribute.

static select_waveforms_hg(waveformsContainer, pixel_id)[source]#

Select HIGH GAIN waveforms from the container.

Args:

waveformsContainer (WaveformsContainer): The container object that contains the waveforms. pixel_id (np.ndarray): An array of pixel IDs to select specific waveforms from the container.

Returns:

np.ndarray: An array of selected waveforms from the container.

static select_waveforms_lg(waveformsContainer, pixel_id)[source]#

Select LOW GAIN waveforms from the container.

Args:

waveformsContainer (WaveformsContainer): The container object that contains the waveforms. pixel_id (np.ndarray): An array of pixel IDs to select specific waveforms from the container.

Returns:

np.ndarray: An array of selected waveforms from the container.

static sort(waveformsContainer, method='event_id')[source]#

Sort the waveformsContainer based on a specified method.

Args:

waveformsContainer (WaveformsContainer): The waveformsContainer to be sorted. method (str, optional): The sorting method. Defaults to ‘event_id’.

Returns:

WaveformsContainer: The sorted waveformsContainer.

wfs_hg(trigger)[source]#

Returns the waveform data for the specified trigger type.

Args:

trigger (EventType): The type of trigger for which the waveform data is requested.

Returns:

An array of waveform data for the specified trigger type.

wfs_lg(trigger)[source]#

Returns the waveform data for the specified trigger type in the low gain channel.

Args:

trigger (EventType): The type of trigger for which the waveform data is requested.

Returns:

An array of waveform data for the specified trigger type in the low gain channel.