nectarchain.makers.component.pedestal_component.PedestalEstimationComponent#
- class PedestalEstimationComponent(**kwargs: Any)[source]#
Bases:
NectarCAMComponentComponent that computes calibration pedestal coefficients from raw data. Waveforms can be filtered based on time, standard deviation of the waveforms or charge distribution within the sample. Use the
events_per_sliceparameter ofNectarCAMComponentto reduce memory load.- Parameters:
- ucts_tminint
Minimum UCTS timestamp for events used in pedestal estimation
- ucts_tmaxint
Maximum UCTS timestamp for events used in pedestal estimation
- filter_methodstr
The waveforms filter method to be used. Implemented methods: WaveformsStdFilter (standard deviation of waveforms), ChargeDistributionFilter (charge distribution).
- wfs_std_thresholdfloat
Threshold of waveforms standard deviation in ADC counts above which a waveform is excluded from pedestal computation.
- charge_sigma_high_thrfloat
Threshold in charge distribution (number of sigmas above mean) beyond which a waveform is excluded from pedestal computation.
- charge_sigma_low_thrfloat
Threshold in charge distribution (number of sigmas below mean) beyond which a waveform is excluded from pedestal computation.
- pixel_mask_nevents_minint
Minimum number of events below which the pixel is flagged as bad
- pixel_mask_mean_minfloat
Minimum value of pedestal mean below which the pixel is flagged as bad
- pixel_mask_mean_maxfloat
Maximum value of pedestal mean above which the pixel is flagged as bad
- pixel_mask_std_sample_minfloat
Minimum value of pedestal standard deviation for all samples below which the pixel is flagged as bad
- pixel_mask_std_pixel_maxfloat
Maximum value of pedestal standard deviation in a pixel above which the pixel is flagged as bad
Component that computes calibration pedestal coefficients from raw data. Waveforms can be filtered based on time, standard deviation of the waveforms or charge distribution within the sample. Use the
events_per_sliceparameter ofNectarCAMComponentto reduce memory load.- Parameters:
- ucts_tminint
Minimum UCTS timestamp for events used in pedestal estimation
- ucts_tmaxint
Maximum UCTS timestamp for events used in pedestal estimation
- filter_methodstr
The waveforms filter method to be used. Implemented methods: WaveformsStdFilter (standard deviation of waveforms), ChargeDistributionFilter (charge distribution).
- wfs_std_thresholdfloat
Threshold of waveforms standard deviation in ADC counts above which a waveform is excluded from pedestal computation.
- charge_sigma_high_thrfloat
Threshold in charge distribution (number of sigmas above mean) beyond which a waveform is excluded from pedestal computation.
- charge_sigma_low_thrfloat
Threshold in charge distribution (number of sigmas below mean) beyond which a waveform is excluded from pedestal computation.
Methods
add_traitsDynamically add trait attributes to the HasTraits instance.
Calculate statistics for the pedestals from a waveforms container.
Generates a mask to filter waveforms that have a charge in the tails of the distribution.
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.Finish the component by filtering the waveforms and calculating the pedestal quantities.
Flag bad pixels based on pedestal properties.
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.
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_instanceGenerates a mask to filter waveforms outside the required time interval.
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
Generates a mask to filter waveforms that have a standard deviation above a threshold.
Attributes
List of Component names that are used inside current component, this is used to resolve recursively the configurable traits defined in sub-components.
Threshold in charge distribution (number of sigmas above mean) beyond which a waveform is excluded from pedestal computation.
Threshold in charge distribution (number of sigmas below mean) beyond which a waveform is excluded from pedestal computation.
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.
The kwargs to be pass to the charge extractor method
The waveforms filter method to be used.
the charge extraction method
npixelsparentA trait whose value must be an instance of a specified class.
Maximum value of pedestal mean above which the pixel is flagged as bad
Minimum value of pedestal mean below which the pixel is flagged as bad
Minimum number of events below which the pixel is flagged as bad
Maximum value of pedestal standard deviation in a pixel above which the pixel is flagged as bad
Minimum value of pedestal standard deviation for all samples below which the pixel is flagged as bad
pixels_idrun_numbersubarrayMaximum UCTS timestamp for events used in pedestal estimation
Minimum UCTS timestamp for events used in pedestal estimation
Threshold of waveforms standard deviation in ADC counts above which a waveform is excluded from pedestal computation.
- 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]#
Fill the waveform container looping over the events of type SKY_PEDESTAL.
- static calculate_stats(waveformsContainers, wfs_mask, statistics)[source]#
Calculate statistics for the pedestals from a waveforms container.
- Parameters:
- waveformsContainers
WaveformsContainer Waveforms container
- wfs_mask
numpy.ndarray Mask to apply to exclude outliers with shape (n_pixels,n_samples)
- statistics
list Names of the statistics (numpy.ma attributes) to compute
- waveformsContainers
- Returns:
- ped_stats
dict A dictionary containing 3D (n_chan,n_pixels,n_samples) arrays for each statistic.
- ped_stats
- chargeDistributionFilter_mask(sigma_low, sigma_high)[source]#
Generates a mask to filter waveforms that have a charge in the tails of the distribution. This option is useful for data with NSB.
- Parameters:
- sigma_lowfloat
Number of standard deviation below mean charge beyond which waveforms are filtered out
- sigma_highfloat
Number of standard deviation above mean charge beyond which waveforms are filtered out
- Returns:
- mask
ndarray A boolean array of shape (n_events,n_pixels,n_samples) that identifies waveforms to be masked
- mask
- charge_sigma_high_thr#
Threshold in charge distribution (number of sigmas above mean) beyond which a waveform is excluded from pedestal computation.
- charge_sigma_low_thr#
Threshold in charge distribution (number of sigmas below mean) beyond which a waveform is excluded from pedestal computation.
- extractor_kwargs#
The kwargs to be pass to the charge extractor method
- filter_method#
The waveforms filter method to be used. Implemented methods: WaveformsStdFilter (standard deviation of waveforms), ChargeDistributionFilter (charge distribution).
- finish(*args, **kwargs)[source]#
Finish the component by filtering the waveforms and calculating the pedestal quantities.
- flag_bad_pixels(ped_stats, nevents)[source]#
Flag bad pixels based on pedestal properties.
- Parameters:
- ped_stats
dict A dictionary containing 3D (n_chan,n_pixels,n_samples) arrays for each statistic
- nevents
np.ndarray An array that contains the numbber of events used to calculate the statistics for each pixel
- ped_stats
- Returns:
- pixel_mask
np.ndarray An array that contains the binary mask of shape (nchannels,npixels) to flag bad pixels
- pixel_mask
- method#
the charge extraction method
- pixel_mask_mean_max#
Maximum value of pedestal mean above which the pixel is flagged as bad
- pixel_mask_mean_min#
Minimum value of pedestal mean below which the pixel is flagged as bad
- pixel_mask_nevents_min#
Minimum number of events below which the pixel is flagged as bad
- pixel_mask_std_pixel_max#
Maximum value of pedestal standard deviation in a pixel above which the pixel is flagged as bad
- pixel_mask_std_sample_min#
Minimum value of pedestal standard deviation for all samples below which the pixel is flagged as bad
- timestamp_mask(tmin, tmax)[source]#
Generates a mask to filter waveforms outside the required time interval.
- Parameters:
- tminint
Minimum time of the required interval
- tmaxint
Maximum time of the required interval
- Returns:
- mask
ndarray A boolean array of shape (n_events,n_pixels,n_samples) that identifies waveforms to be masked.
- mask
- ucts_tmax#
Maximum UCTS timestamp for events used in pedestal estimation
- ucts_tmin#
Minimum UCTS timestamp for events used in pedestal estimation
- waveformsStdFilter_mask(threshold)[source]#
Generates a mask to filter waveforms that have a standard deviation above a threshold. This option is effective for dark room verification data.
- Parameters:
- thresholdfloat
Waveform standard deviation (in ADC counts) above which the waveform is filtered out
- Returns:
- mask
ndarray A boolean array of shape (n_events,n_pixels,n_samples) that identifies waveforms to be masked
- mask
- wfs_std_threshold#
Threshold of waveforms standard deviation in ADC counts above which a waveform is excluded from pedestal computation.