Skip to content

Commit

Permalink
Add underload to nexus.py, following resolution of nexusformat/defini…
Browse files Browse the repository at this point in the history
  • Loading branch information
phyy-nx committed Apr 24, 2019
1 parent 312d60a commit 6510c76
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions format/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,16 +1165,10 @@ def set_frame(pg, transformation):
reversed(map(int, nx_detector_module.handle["data_size"][-2:]))
)

# Temporary check for unsupported term. AFAIK undefined_value isn't in any existing nexus files.
# See https://github.com/nexusformat/definitions/issues/656 for the proposed replacement.
assert (
"undefined_value" not in nx_detector.handle
), "undefined_value not an NXmx term. See nexusformat/definitions#656."

# Get the trusted range of pixel values
underload = (
float(nx_detector.handle["undefined_value"][()])
if "undefined_value" in nx_detector.handle
float(nx_detector.handle["underload_value"][()])
if "underload_value" in nx_detector.handle
else -400
)
overload = (
Expand Down

0 comments on commit 6510c76

Please sign in to comment.