nectarchain.makers.component.flatfield_component.FlatFieldComponent#
- class FlatFieldComponent(*args: t.Any, **kwargs: t.Any)[source]#
Bases:
NectarCAMComponentComponent that computes flat field coefficients from raw data.
- Parameters:
- window_shift: int
time in ns before the peak to integrate charge (default value = 5)
- window_width: int
duration of the extraction window in ns (default value = 12)
- window_pedestal: int
duration of the pedestal estimation time window since the start of the waveform, in ns (default value = 20)
- gain: list
array of gain value (default value = array of 58 and 58/13)
- bad_pix: list
list of bad pixels (default value = [])
- charge_extraction_method: srt
name of the charge extraction method (“LocalPeakWindowSum” or “GlobalPeakWindowSum” ; default value = None)
- charge_integration_correction: bool
application of a correction from the charge extractor (default value = False)
Initialize the FlatFieldComponent.
- Parameters:
- subarrayctapipe.instrument.SubarrayDescription
The subarray description.
- configtraitlets.config.loader.Config, optional
Configuration object.
- parentobject, optional
Parent component.
Methods
add_traitsDynamically add trait attributes to the HasTraits instance.
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.Finalize the flat-field computation.
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.
Make a boolean mask with the list of bad pixels (used by GlobalPeakWindowSum)
Define an array that will be used as a mask on the waveforms for the calculation of the integrated amplitude of the signal
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
set_traitForcibly sets trait attribute, including read-only attributes.
setup_instanceSubstract the pedestal from a given
NectarCAMPedestalContainerSubtract the pedestal defined as the average of the first samples of each trace
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.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
SubComponentsList of Component names that are used inside current component, this is used to resolve recursively the configurable traits defined in sub-components.
list of bad pixels
cameraReturns the camera description.
camera_nameReturns the camera name.
name of the charge extraction method
correction applied by the charge extractor
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.
default gain value
Path to h5 file with gain calibration coefficients
npixelsReturns a deep copy of the number of pixels.
parentA trait whose value must be an instance of a specified class.
Path to h5 file with pedestal calibration coefficients
pixels_idReturns a deep copy of the pixel IDs array.
run_numberReturns a deep copy of the run number.
subarraytel_idReturns the telescope ID.
the duration of the pedestal estimation window since the start of the waveform in ns
the time in ns before the peak to integrate charge
the duration of the extraction window in ns
- __call__(event: NectarCAMDataContainer, *args, **kwargs)[source]#
Process a flat-field event.
- Parameters:
- eventNectarCAMDataContainer
The event to process. Only FLATFIELD events are handled.
- bad_pix#
list of bad pixels
- charge_extraction_method#
name of the charge extraction method
- charge_integration_correction#
correction applied by the charge extractor
- finish()[source]#
Finalize the flat-field computation.
- Returns:
- FlatFieldContainer
Container with the flat-field coefficients, event metadata, integrated charges, efficiency coefficients, and bad pixel mask.
- gain#
default gain value
- gain_file#
Path to h5 file with gain calibration coefficients
- static make_badpix_mask(pixels_id, bad_pixel_list)[source]#
Make a boolean mask with the list of bad pixels (used by GlobalPeakWindowSum)
- Args:
bad_pixel_list: list of bad pixels
- Returns:
badpix_mask: boolean mask
- static make_masked_array(t_peak, window_shift, window_width)[source]#
Define an array that will be used as a mask on the waveforms for the calculation of the integrated amplitude of the signal
- Args:
t_peak: sample corresponding the the highest peak of the trace window_shift: number of samples before the peak to integrate charge window_width: duration of the extraction window in samples
- Returns:
masked_wfs: a mask array
- pedestal_file#
Path to h5 file with pedestal calibration coefficients
- subtract_pedestal_from_container(wfs)[source]#
Substract the pedestal from a given
NectarCAMPedestalContainer- Args:
wfs: raw waveforms
- Returns:
wfs_pedsub: waveforms substracted from the pedestal
- static subtract_pedestal_from_first_samples(wfs, window=20)[source]#
Subtract the pedestal defined as the average of the first samples of each trace
- Args:
wfs: raw wavefroms window: number of samples n to calculate the pedestal (default value is 20)
- Returns:
wfs_pedsub: wavefroms subtracted from the pedestal
- window_pedestal#
the duration of the pedestal estimation window since the start of the waveform in ns
- window_shift#
the time in ns before the peak to integrate charge
- window_width#
the duration of the extraction window in ns