-
Notifications
You must be signed in to change notification settings - Fork 17
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 #187 from cta-observatory/fix_tib_data_type
Correct dtype of TIB data
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
import numpy as np | ||
from ctapipe_io_lst.anyarray_dtypes import parse_tib_10MHz_counter | ||
|
||
COUNTER_VALUES = np.array([1, 1234, 2**16 - 1, 2**24 - 1], dtype=np.uint32) | ||
|
||
|
||
@pytest.mark.parametrize("value", COUNTER_VALUES) | ||
def test_parse_tib_10MHz_counter(value): | ||
counter_24bit = np.frombuffer(value.tobytes()[:3], np.uint8) | ||
result = parse_tib_10MHz_counter(counter_24bit) | ||
assert result == value |