-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NXdata errors on an axis, signal or auxiliary signal #1047
Conversation
89f6289
to
a3d6f22
Compare
For example an NXdata with 1 axis (energy) and 3 signals (I0, I1 and I2)
import h5py
with h5py.File("test.h5", "w") as f:
f.attrs["NX_class"] = "NXroot"
f.attrs["default"] = "entry"
entry = f.create_group("entry")
entry.attrs["NX_class"] = "NXroot"
entry.attrs["default"] = "data"
data = f.create_group("data")
data.attrs["NX_class"] = "NXdata"
data.attrs["axes"] = ["energy"]
data.attrs["signal"] = "I0"
data.attrs["auxiliary_signals"] = ["I1", "I2"]
data["energy"] = [1, 5, 2]
data["energy_errors"] = [0.1, 0.4, 0.15]
data["I0"] = [1, 0, 1]
data["I0_errors"] = [0.1, 0, 0.1] # called "errors" in the current definition
data["I1"] = [1, 0, 1]
data["I1_errors"] = [0.1, 0, 0.1] # NOT in current definition
data["I2"] = [1, 0, 1]
data["I2_errors"] = [0.1, 0, 0.1] # NOT in current definition |
a3d6f22
to
98ac638
Compare
Just to add on it, that is something already found in the documentation at: https://manual.nexusformat.org/datarules.html?highlight=_errors but not found when describing NXdata. Here is the information concerning reserved suffixes Reserved suffixes When naming a field, NeXus has reserved certain suffixes to the names
so that a specific meaning may be attached. Consider a field named
If |
We seem to have already provided 2 different general strategies for giving errors, as described in https://www.nexusformat.org/NIACDesign.html Maybe we need to decide between |
As I recall, this was decide at a previous NIAC to use |
I propose to leave This MR deals specifically with make it clear in NXdata (in its current form, using the |
Suggestion to deprecate the |
The link to the NIAC 2018 minutes: https://www.nexusformat.org/NIAC2018Minutes.html |
98ac638
to
bda8a7d
Compare
bda8a7d
to
bb5d07f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right to me. Consistent with NIAC2018.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this
Just to clarify the discussion here, there was a decision at the 2018 NIAC meeting:
Therefore issue #1044 is moot and only a clarification of the documentation is required, which was accomplished by this pull request. |
Closes #1044
Currently
NXdata
does not allow errors on auxiliary signals.This PR solves that by
VARIABLE
field toAXISNAME
VARIABLE_errors
to say it applies to axes, signal or auxiliary signals: this is the actual change, although it is already somewhat support by NeXus as described here.errors
in favor ofVARIABLE_errors
for the signal field