nectarchain.makers.component.pedestal_component.PedestalEstimationComponent#

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

Bases: NectarCAMComponent

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_slice parameter of NectarCAMComponent to 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_slice parameter of NectarCAMComponent to 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_traits

Dynamically add trait attributes to the HasTraits instance.

calculate_stats

Calculate statistics for the pedestals from a waveforms container.

chargeDistributionFilter_mask

Generates a mask to filter waveforms that have a charge in the tails of the distribution.

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.

finish

Finish the component by filtering the waveforms and calculating the pedestal quantities.

flag_bad_pixels

Flag bad pixels based on pedestal properties.

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.

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

set_trait

Forcibly sets trait attribute, including read-only attributes.

setup_instance

timestamp_mask

Generates a mask to filter waveforms outside the required time interval.

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.

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

waveformsStdFilter_mask

Generates a mask to filter waveforms that have a standard deviation above a threshold.

Attributes

SubComponents

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

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.

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.

extractor_kwargs

The kwargs to be pass to the charge extractor method

filter_method

The waveforms filter method to be used.

method

the charge extraction method

npixels

parent

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

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

pixels_id

run_number

subarray

ucts_tmax

Maximum UCTS timestamp for events used in pedestal estimation

ucts_tmin

Minimum UCTS timestamp for events used in pedestal estimation

wfs_std_threshold

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:
waveformsContainersWaveformsContainer

Waveforms container

wfs_masknumpy.ndarray

Mask to apply to exclude outliers with shape (n_pixels,n_samples)

statisticslist

Names of the statistics (numpy.ma attributes) to compute

Returns:
ped_statsdict

A dictionary containing 3D (n_chan,n_pixels,n_samples) arrays for each statistic.

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:
maskndarray

A boolean array of shape (n_events,n_pixels,n_samples) that identifies waveforms to be masked

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_statsdict

A dictionary containing 3D (n_chan,n_pixels,n_samples) arrays for each statistic

neventsnp.ndarray

An array that contains the numbber of events used to calculate the statistics for each pixel

Returns:
pixel_masknp.ndarray

An array that contains the binary mask of shape (nchannels,npixels) to flag bad pixels

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:
maskndarray

A boolean array of shape (n_events,n_pixels,n_samples) that identifies waveforms to be masked.

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:
maskndarray

A boolean array of shape (n_events,n_pixels,n_samples) that identifies waveforms to be masked

wfs_std_threshold#

Threshold of waveforms standard deviation in ADC counts above which a waveform is excluded from pedestal computation.