-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2338 from cta-observatory/ctao_dl0
Add fields defined in CTAO DL0 and R1 data models
- Loading branch information
Showing
5 changed files
with
208 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Tests for the data structures defined in ctapipe.containers""" | ||
import numpy as np | ||
from numpy.testing import assert_equal | ||
|
||
|
||
def test_pixel_status(): | ||
"""Test methods of the PixelStatus enum on numpy arrays""" | ||
from ctapipe.containers import PixelStatus | ||
|
||
pixel_status = np.array([0b1101, 0b1000, 0b1110, 0b1101, 0b0000], dtype=np.uint8) | ||
|
||
assert_equal( | ||
PixelStatus.is_invalid(pixel_status), [False, False, False, False, True] | ||
) | ||
assert_equal(PixelStatus.get_dvr_status(pixel_status), [1, 0, 2, 1, 0]) | ||
assert_equal( | ||
PixelStatus.get_channel_info(pixel_status), [0b11, 0b10, 0b11, 0b11, 0b00] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added missing fields defined in the CTAO R1 and DL0 data models to the corresponding containers. |