nectarchain.makers.component.waveforms_component.WaveformsComponent#
- class WaveformsComponent(**kwargs: Any)[source]#
Bases:
ArrayDataComponentMethods
add_traitsDynamically add trait attributes to the HasTraits instance.
broken_pixels_hgReturns an array of broken pixels for high gain for the specified trigger type.
broken_pixels_lgReturns an array of broken pixels for low gain for the specified trigger type.
class_config_rst_docGenerate rST documentation for this class' config options.
class_config_sectionGet the config section for this class.
class_get_helpGet the help string for this class in ReST format.
class_get_trait_helpGet the helptext string for a single trait.
class_own_trait_eventsGet a dict of all event handlers defined on this class, not a parent.
class_own_traitsGet a dict of all the traitlets defined on this class, not a parent.
class_print_helpGet the help string for a single trait and print it.
class_trait_namesGet a list of all the names of this class' traits.
class_traitsGet a
dictof all the traits of this class.Create a container for the extracted waveforms from a list of events.
event_idReturns an array of event IDs for the specified trigger type.
event_typeReturns an array of event types for the specified trigger type.
Make the output container for the selected trigger types.
from_nameObtain an instance of a subclass via its name
get_current_configreturn the current configuration as a dict (e.g. the values of all traits, even if they were not set during configuration).
has_traitReturns True if the object has a trait with the specified name.
hold_trait_notificationsContext manager for bundling trait change notifications and cross validation.
mergeMethod to merge 2 ArrayDataContainer into one single ArrayDataContainer.
merge_along_slicesmultiplicityReturns an array of multiplicities for the specified trigger type.
neventsReturns the number of events for the specified trigger type.
non_abstract_subclassesGet a dict of all non-abstract subclasses of this class.
notify_changeNotify observers of a change event
observeSetup a handler to be called when a trait changes.
on_trait_changeDEPRECATED: Setup a handler to be called when a trait changes.
section_namesreturn section names as a list
select_container_array_fieldSelects specific fields from an ArrayDataContainer object based on a given list of pixel IDs.
Select HIGH GAIN waveforms from the container.
Select LOW GAIN waveforms from the container.
set_traitForcibly sets trait attribute, including read-only attributes.
setup_instanceSort the waveformsContainer based on a specified method.
trait_defaultsReturn a trait's default value or a dictionary of them
trait_eventsGet a
dictof all the event handlers of this class.trait_has_valueReturns True if the specified trait has a value.
trait_metadataGet metadata values for trait by key.
trait_namesGet a list of all the names of this class' traits.
trait_valuesA
dictof trait names and their values.traitsGet a
dictof all the traits of this class.trig_patternReturns an array of trigger patterns for the specified trigger type.
trig_pattern_allReturns an array of trigger patterns for all events for the specified trigger type.
ucts_busy_counterReturns an array of UCTS busy counters for the specified trigger type.
ucts_event_counterReturns an array of UCTS event counters for the specified trigger type.
ucts_timestampReturns an array of UCTS timestamps for the specified trigger type.
unobserveRemove a trait change handler.
unobserve_allRemove trait change handlers of any type for the specified name.
update_configUpdate config and load the new values
Returns the waveform data for the specified trigger type.
Returns the waveform data for the specified trigger type in the low gain channel.
Attributes
CAMERACAMERA_NAMEThe camera name
List of Component names that are used inside current component, this is used to resolve recursively the configurable traits defined in sub-components.
TEL_IDThe telescope ID
configA trait whose value must be an instance of a specified class.
cross_validation_lockA contextmanager for running a block with our cross validation lock set to True.
Returns a deep copy of the geometry attribute.
npixelsnsamplesReturns a deep copy of the nsamples attribute.
parentA trait whose value must be an instance of a specified class.
pixels_idrun_numbersubarray- 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:
- 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.