Skip to content

Commit

Permalink
Fixed logic error with saturation check
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Mateos Langerak committed Feb 7, 2024
1 parent b258547 commit 8cbb4b7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/microscopemetrics/utilities/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
INT_DETECTOR_BIT_DEPTHS = [8, 10, 11, 12, 15, 16, 32]
FLOAT_DETECTOR_BIT_DEPTHS = [32, 64]


## Some useful functions
def convert_SI(val, unit_in, unit_out):
si = {
Expand Down Expand Up @@ -163,10 +162,10 @@ def is_saturated(
if detector_bit_depth is not None:
if (
detector_bit_depth not in INT_DETECTOR_BIT_DEPTHS
or detector_bit_depth not in FLOAT_DETECTOR_BIT_DEPTHS
and detector_bit_depth not in FLOAT_DETECTOR_BIT_DEPTHS
):
raise ValueError(
f"The detector bit depth provided is not supported. Supported values are {INT_DETECTOR_BIT_DEPTHS} for integer detectors and {FLOAT_DETECTOR_BIT_DEPTHS} for floating point detectors."
f"The detector bit depth provided ({detector_bit_depth}) is not supported. Supported values are {INT_DETECTOR_BIT_DEPTHS} for integer detectors and {FLOAT_DETECTOR_BIT_DEPTHS} for floating point detectors."
)
if (
np.issubdtype(channel.dtype, np.integer)
Expand Down

0 comments on commit 8cbb4b7

Please sign in to comment.