Skip to content

Commit

Permalink
reformated CALET_GBM conversion using black
Browse files Browse the repository at this point in the history
  • Loading branch information
Athish Thiruvengadam committed Jul 30, 2024
1 parent 7f9e60d commit 3d61c10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gcn_classic_to_json/notices/CALET_GBM_FLT_LC/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def parse(bin_arr):
# I have defined 0 in the binary as "on" and 1 as "triggered"
detector_options = ["on", "triggered"]
# First define as an array with a single 4 byte integer value and then convert to an array of 4 1 byte integer values
detectors_bits = np.unpackbits(np.asarray(bin_arr[19:20], dtype=">i4").view(dtype=">u1"))[-3:]
detectors_bits = np.unpackbits(
np.asarray(bin_arr[19:20], dtype=">i4").view(dtype=">u1")
)[-3:]
detectors_status = [detector_options[bit] for bit in detectors_bits]
detectors = dict(zip(["SGM", "HXM1", "HMX2"], detectors_status))

Expand Down

0 comments on commit 3d61c10

Please sign in to comment.