Created
August 14, 2023 13:17
-
-
Save DanPorter/eb37c0683d27e9b5c77e25af996e539f to your computer and use it in GitHub Desktop.
Read I16 Nexus Files in Python using h5py
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
# module load python/3 | |
# or pip install h5py (comes with anaconda python) | |
import h5py | |
with h5py.File('example_nexus/794932.nxs', 'r') as nx: | |
print(nx['entry1']['measurement'].keys()) | |
dataset = nx['entry1/measurement/eta'] | |
print(dataset) | |
values = nx['entry1/measurement/eta'][()] | |
scan_command = nx['entry1/scan_command'] | |
print(scan_command) | |
detector_dataset = nx['entry1/pil3_100k/data'] | |
print(detector_dataset) | |
image = detector_dataset[len(detector_dataset)//2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment