forked from nexusformat/definitions
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #2 from nexusformat/master
Sync HDRMX definitions to nexussormat
- Loading branch information
Showing
14 changed files
with
125 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
v2020.1HDRMX | ||
v2020.1 | ||
|
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
Binary file not shown.
Binary file not shown.
Empty file.
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,26 @@ | ||
|
||
import h5py | ||
|
||
with h5py.File("prj_test.nexus.hdf5", "r") as nx: | ||
# find the default NXentry group | ||
nx_entry = nx[nx.attrs["default"]] | ||
# find the default NXdata group | ||
nx_data = nx_entry[nx_entry.attrs["default"]] | ||
# find the signal field | ||
signal = nx_data[nx_data.attrs["signal"]] | ||
# find the axes field(s) | ||
attr_axes = nx_data.attrs["axes"] | ||
if isinstance(attr_axes, (set, tuple, list)): | ||
# but check that attr_axes only describes 1-D data | ||
if len(attr_axes) == 1: | ||
attr_axes = attr_axes[0] | ||
else: | ||
raise ValueError(f"expected 1-D data but @axes={attr_axes}") | ||
axes = nx_data[attr_axes] | ||
|
||
print(f"file: {nx.filename}") | ||
print(f"signal: {signal.name}") | ||
print(f"axes: {axes.name}") | ||
print(f"{axes.name} {signal.name}") | ||
for x, y in zip(axes, signal): | ||
print(x, y) |
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,35 @@ | ||
file: prj_test.nexus.hdf5 | ||
signal: /entry/mr_scan/I00 | ||
axes: /entry/mr_scan/mr | ||
/entry/mr_scan/mr /entry/mr_scan/I00 | ||
17.92608 1037 | ||
17.92591 1318 | ||
17.92575 1704 | ||
17.92558 2857 | ||
17.92541 4516 | ||
17.92525 9998 | ||
17.92508 23819 | ||
17.92491 31662 | ||
17.92475 40458 | ||
17.92458 49087 | ||
17.92441 56514 | ||
17.92425 63499 | ||
17.92408 66802 | ||
17.92391 66863 | ||
17.92375 66599 | ||
17.92358 66206 | ||
17.92341 65747 | ||
17.92325 65250 | ||
17.92308 64129 | ||
17.92291 63044 | ||
17.92275 60796 | ||
17.92258 56795 | ||
17.92241 51550 | ||
17.92225 43710 | ||
17.92208 29315 | ||
17.92191 19782 | ||
17.92175 12992 | ||
17.92158 6622 | ||
17.92141 4198 | ||
17.92125 2248 | ||
17.92108 1321 |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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