-
Notifications
You must be signed in to change notification settings - Fork 278
reorganized stats/chunk containers #2999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Reorganized the chunk and statistics containers. |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -61,6 +61,7 @@ | |||||||||
| "TelescopePointingContainer", | ||||||||||
| "ArrayPointingContainer", | ||||||||||
| "StatisticsContainer", | ||||||||||
| "ChunkContainer", | ||||||||||
| "ChunkStatisticsContainer", | ||||||||||
| "ImageStatisticsContainer", | ||||||||||
| "IntensityStatisticsContainer", | ||||||||||
|
|
@@ -1237,46 +1238,33 @@ class CameraCalibrationContainer(Container): | |||||||||
|
|
||||||||||
|
|
||||||||||
| class StatisticsContainer(Container): | ||||||||||
| """Store descriptive statistics of a pixel-wise quantity for each channel""" | ||||||||||
| """Container for descriptive statistics""" | ||||||||||
|
|
||||||||||
| mean = Field( | ||||||||||
| None, | ||||||||||
| "mean of a pixel-wise quantity for each channel" | ||||||||||
| "Type: float; Shape: (n_channels, n_pixel)", | ||||||||||
| ) | ||||||||||
| median = Field( | ||||||||||
| None, | ||||||||||
| "median of a pixel-wise quantity for each channel" | ||||||||||
| "Type: float; Shape: (n_channels, n_pixel)", | ||||||||||
| ) | ||||||||||
| std = Field( | ||||||||||
| None, | ||||||||||
| "standard deviation of a pixel-wise quantity for each channel" | ||||||||||
| "Type: float; Shape: (n_channels, n_pixel)", | ||||||||||
| ) | ||||||||||
| n_events = Field(-1, "number of events used for the extraction of the statistics") | ||||||||||
| outlier_mask = Field( | ||||||||||
| None, | ||||||||||
| "Boolean mask indicating which pixels are considered outliers." | ||||||||||
| " Shape: (n_channels, n_pixels)", | ||||||||||
| ) | ||||||||||
| is_valid = Field( | ||||||||||
| False, | ||||||||||
| ( | ||||||||||
| "True if the pixel statistics are valid, False if they are not valid or " | ||||||||||
| "if a high fraction of faulty pixels exceeding the pre-defined threshold " | ||||||||||
| "is detected across the chunk of images." | ||||||||||
| ), | ||||||||||
| ) | ||||||||||
| mean = Field(None, "mean value") | ||||||||||
| median = Field(None, "median value") | ||||||||||
| std = Field(None, "standard deviation") | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class ChunkStatisticsContainer(StatisticsContainer): | ||||||||||
| """Store descriptive statistics of a chunk of images""" | ||||||||||
| class ChunkContainer(Container): | ||||||||||
| """Store values of a chunk""" | ||||||||||
|
|
||||||||||
| time_start = Field(NAN_TIME, "high resolution start time of the chunk") | ||||||||||
| time_end = Field(NAN_TIME, "high resolution end time of the chunk") | ||||||||||
| event_id_start = Field(None, "event id of the first event of the chunk") | ||||||||||
| event_id_end = Field(None, "event id of the last event of the chunk") | ||||||||||
| n_events = Field( | ||||||||||
| -1, "number of events used for the calculation of the chunk values" | ||||||||||
| ) | ||||||||||
| outlier_mask = Field(None, "boolean mask indicating outliers in the chunk") | ||||||||||
| is_valid = Field(False, "true if chunk values are valid") | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class ChunkStatisticsContainer(ChunkContainer): | ||||||||||
| """Container for descriptive statistics of the chunk distribution""" | ||||||||||
|
|
||||||||||
| mean = Field(None, "mean value of the chunk distribution") | ||||||||||
| median = Field(None, "median value of the chunk distribution") | ||||||||||
| std = Field(None, "standard deviation of the chunk distribution") | ||||||||||
|
Comment on lines
+1262
to
+1267
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking of replacing this duplication by which would be nice but would also lead to breaking changes here and elsewhere.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What we do elsewhere is have separate containers for the index and the data and write multiple containers to the same table. I.e. you could have the like this, you also don't need separate containers for the interpolated result and the chunk storage.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See e.g.: ctapipe/src/ctapipe/io/datawriter.py Lines 309 to 312 in 8705606
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mmh, that seems a bit weird. the
It should also be independent from which values are actually used due to e.g. outlier detection, sigma clipping or under/overflow.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, the number of events are related to the chunks and the number of entries are related to the number of values used in the aggregation. |
||||||||||
|
|
||||||||||
|
|
||||||||||
| class PixelStatisticsContainer(Container): | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.