nectarchain.makers.component.core.ArrayDataComponent#
- class ArrayDataComponent(**kwargs: Any)[source]#
Bases:
NectarCAMComponentMethods
add_traitsDynamically add trait attributes to the HasTraits instance.
Returns an array of broken pixels for high gain for the specified trigger type.
Returns 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.Returns an array of event IDs for the specified trigger type.
Returns an array of event types for the specified trigger type.
finishfrom_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.
Method to merge 2 ArrayDataContainer into one single ArrayDataContainer.
merge_along_slicesReturns an array of multiplicities for the specified trigger type.
Returns 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
Selects specific fields from an ArrayDataContainer object based on a given list of pixel IDs.
set_traitForcibly sets trait attribute, including read-only attributes.
setup_instancetrait_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.Returns an array of trigger patterns for the specified trigger type.
Returns an array of trigger patterns for all events for the specified trigger type.
Returns an array of UCTS busy counters for the specified trigger type.
Returns an array of UCTS event counters for the specified trigger type.
Returns 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
Attributes
CAMERAThe camera name
SubComponentsList of Component names that are used inside current component, this is used to resolve recursively the configurable traits defined in sub-components.
The 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.
npixelsReturns a deep copy of the nsamples attribute.
parentA trait whose value must be an instance of a specified class.
pixels_idrun_numbersubarray- CAMERA_NAME#
The camera name
- TEL_ID#
The telescope ID
- __call__(event, *args, **kwargs)[source]#
Method to extract data from the event.
- Parameters:
- event: NectarCAMDataContainer
The event object.
- trigger: EventType
The trigger type.
- args
Additional arguments that can be passed to the method.
- kwargs
Additional keyword arguments that can be passed to the method.
- Returns:
- get_wfs_hg, get_wfs_lg
If the
return_wfskeyword argument is True, the method returns the high and low gain waveforms from the event.
- broken_pixels_hg(trigger)[source]#
Returns an array of broken pixels for high gain for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the broken pixels for high gain are requested.
- Returns:
np.ndarray: An array of broken pixels for high gain for the specified trigger type.
- broken_pixels_lg(trigger)[source]#
Returns an array of broken pixels for low gain for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the broken pixels for low gain are requested.
- Returns:
np.ndarray: An array of broken pixels for low gain for the specified trigger type.
- event_id(trigger)[source]#
Returns an array of event IDs for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the event IDs are requested.
- Returns:
np.ndarray: An array of event IDs for the specified trigger type.
- event_type(trigger)[source]#
Returns an array of event types for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the event types are requested.
- Returns:
np.ndarray: An array of event types for the specified trigger type.
- static merge(container_a, container_b)[source]#
Method to merge 2 ArrayDataContainer into one single ArrayDataContainer.
- Return type:
- Returns:
ArrayDataContainer: the merged object
- multiplicity(trigger)[source]#
Returns an array of multiplicities for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the multiplicities are requested.
- Returns:
np.ndarray: An array of multiplicities for the specified trigger type.
- nevents(trigger)[source]#
Returns the number of events for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the number of events is requested.
- Returns:
int: The number of events for the specified trigger type.
- property nsamples#
Returns a deep copy of the nsamples attribute.
- Returns:
np.ndarray: A deep copy of the nsamples attribute.
- static select_container_array_field(container, pixel_id, field)[source]#
Selects specific fields from an ArrayDataContainer object based on a given list of pixel IDs.
- Return type:
- Args:
container (ArrayDataContainer): An object of type ArrayDataContainer that contains the data. pixel_id (ndarray): An array of pixel IDs for which the data needs to be selected. field (str): The name of the field to be selected from the container. WARNING: This field have to be associated to an array indexed by pixels
- Returns:
ndarray: An array containing the selected data for the given pixel IDs.
- trig_pattern(trigger)[source]#
Returns an array of trigger patterns for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the trigger patterns are requested.
- Returns:
np.ndarray: An array of trigger patterns for the specified trigger type.
- trig_pattern_all(trigger)[source]#
Returns an array of trigger patterns for all events for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the trigger patterns for all events are requested.
- Returns:
np.ndarray: An array of trigger patterns for all events for the specified trigger type.
- ucts_busy_counter(trigger)[source]#
Returns an array of UCTS busy counters for the specified trigger type.
- Args:
trigger (EventType): The trigger type for which the UCTS busy counters are requested.
- Returns:
np.ndarray: An array of UCTS busy counters for the specified trigger type.