Skip to content

Commit

Permalink
Some more cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Toennis committed Oct 2, 2024
1 parent 583b408 commit aa4819f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
11 changes: 0 additions & 11 deletions docs/api-reference/monitoring/calculator.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api-reference/monitoring/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Monitoring data are time-series used to monitor the status or quality of hardwar

This module provides some code to help to generate monitoring data from processed event data, particularly for the purposes of calibration and data quality assessment.

Code related to :ref:`stats_aggregator`, :ref:`calibration_calculator`, and :ref:`outlier_detector` is implemented here.
Currently, only code related to :ref:`stats_aggregator` and :ref:`outlier_detector` is implemented here.


Submodules
Expand Down
1 change: 0 additions & 1 deletion docs/changes/2554.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/changes/2609.features.rst

This file was deleted.

1 change: 0 additions & 1 deletion src/ctapipe/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from .datawriter import DATA_MODEL_VERSION, DataWriter


__all__ = [
"HDF5TableWriter",
"HDF5TableReader",
Expand Down
6 changes: 3 additions & 3 deletions src/ctapipe/monitoring/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ def __call__(
and call the relevant function of the particular aggregator to compute aggregated statistic values.
The chunks are generated in a way that ensures they do not overflow the bounds of the table.
- If ``chunk_shift`` is None, chunks will not overlap, but the last chunk is ensured to be
of size ``chunk_size``, even if it means the last two chunks will overlap.
of size `chunk_size`, even if it means the last two chunks will overlap.
- If ``chunk_shift`` is provided, it will determine the number of samples to shift between the start
of consecutive chunks resulting in an overlap of chunks. Chunks that overflows the bounds
of the table are not considered.
Parameters
----------
table : astropy.table.Table
table with images of shape (n_images, n_channels, n_pix), event IDs and
timestamps of shape (n_images, )
table with images of shape (n_images, n_channels, n_pix)
and timestamps of shape (n_images, )
masked_pixels_of_sample : ndarray, optional
boolean array of masked pixels of shape (n_pix, ) that are not available for processing
chunk_shift : int, optional
Expand Down
12 changes: 6 additions & 6 deletions src/ctapipe/monitoring/outlier.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MedianOutlierDetector(OutlierDetector):
the configurable factors and the camera median of the statistic values.
"""

validity_range = List(
median_range_factors = List(
trait=Float(),
default_value=[-1.0, 1.0],
help=(
Expand All @@ -98,8 +98,8 @@ def __call__(self, column):
# Detect outliers based on the deviation of the median distribution
deviation = column - camera_median[:, :, np.newaxis]
outliers = np.logical_or(
deviation < self.validity_range[0] * camera_median[:, :, np.newaxis],
deviation > self.validity_range[1] * camera_median[:, :, np.newaxis],
deviation < self.median_range_factors[0] * camera_median[:, :, np.newaxis],
deviation > self.median_range_factors[1] * camera_median[:, :, np.newaxis],
)
return outliers

Expand All @@ -112,7 +112,7 @@ class StdOutlierDetector(OutlierDetector):
the configurable factors and the camera standard deviation of the statistic values.
"""

validity_range = List(
std_range_factors = List(
trait=Float(),
default_value=[-1.0, 1.0],
help=(
Expand All @@ -131,7 +131,7 @@ def __call__(self, column):
# Detect outliers based on the deviation of the standard deviation distribution
deviation = column - camera_median[:, :, np.newaxis]
outliers = np.logical_or(
deviation < self.validity_range[0] * camera_std[:, :, np.newaxis],
deviation > self.validity_range[1] * camera_std[:, :, np.newaxis],
deviation < self.std_range_factors[0] * camera_std[:, :, np.newaxis],
deviation > self.std_range_factors[1] * camera_std[:, :, np.newaxis],
)
return outliers

0 comments on commit aa4819f

Please sign in to comment.