-
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
NXexperiment and NXexperimentdata #580
Conversation
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"> | ||
<doc> | ||
Describe the contents of an NXentry resulting from a data collection using multiple detectors, |
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.
per #469 & #270, make the first line a one-line summary since only the first line will be used to generate the summary documentation about each NXDL shown on http://download.nexusformat.org/doc/html/classes/contributed_definitions/index.html
Describe the contents of an NXentry resulting from a data collection using multiple detectors, | ||
generating raw and derived data, potentially being scanned across multiple dimensions. | ||
|
||
It is not uncommon for a beamline at a synchrotron to collect data from multiple detectors in during a single scan. NeXus files |
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.
remove in
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd" | ||
> | ||
<doc> | ||
Describe all the plottable data from a single detector in a single entity. To be used |
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.
per #469 & #270, make the first line a one-line summary since only the first line will be used to generate the summary documentation about each NXDL shown on http://download.nexusformat.org/doc/html/classes/contributed_definitions/index.html
|
||
(**required**) :ref:`NXdata` at least one NXdata, related to the NXdetector | ||
</doc> | ||
<attribute name="DATANAME_origin"> |
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.
add nameType="any"
(per #562) to indicate that DATANAME is not required text in the name
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.
Just to check, the issue suggests using this in fields, whereas this is an attribute. No other attributes (such as AXISNAME_indices) follow this convention.
name of an :ref:`NXdata` that must be in the same :ref:`NXexperimentdata`. | ||
</doc> | ||
</attribute> | ||
<attribute name="primary"> |
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.
change name of this attribute to default
(per #380)
documentation should mention that an absolute HDF5 path address (starts with /
, such as /entry/instrument/detector1/ccd3
) must be used.
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.
I would prefer not to have to use the absolute HDF5 path for this, just the name of (one of) the NXdata in this class.
This would be expected to be used more like the signal
attribute in NXData
, that is, from my collection of objects, which is the one i should actually care about. If it is a path to a location outside the group, it loses all the connections in the group.
For example, NXexperimentdata contains
Xspress3 (/entry/instrument/detector)[NXDetector]
AllElementSum(/entry/AllElementSum)[NXData]
FeKAlpha(/entry/FeKAlpha)[NXData]
with default
wanting to refer to FeKalpha (which has an origin
of AllElementSum, which has an origin
of Xspress3). If default was /entry/FeKalpha I have to strip the HDF5 path to make any use of the origin
attributes.
There is the requirement that all the NXdata
groups in this class must have unique names (which could be explicitly stated in the doc) but if there are mulitple NXdata, derived from the same NXDetector, with the same name, that suggests to me bigger issues with the file.
Since this behaviour breaks with the use of default
in the issue (by not using the full path), but would work with the external default
definition (I assume there is no reason why the default
in an NXentry
couldn't contain the full path to the NXdata
in an NXexperimentaldata
), maybe a different name would be better.
Thanks for making this suggestion, which looks interesting, but I'm struggling to understand exactly how these classes would be used. Could you provide an example file tree, such as your SAXS example, with its various detectors? |
Happy to, but it will take a few days to find suitable example data and construct the file by hand. The main issue the classes aim to solve is relating The minute there are multiple Also, for a grid scan, if one I have no emotional attachment to these classes. @markbasham and I have discussed around this issue for a long time, and this seems to be one method of encapsulating the information we need, without just adding more fields to the existing base classes. I'm sure there are many elegant solutions, and I am happy to discuss the most NeXus way to get the information we need from the file. |
It is possible that the functionality that you are looking for is already provided by NeXus links. Here is part of the tree structure of one of the example files distributed with NeXpy:
So It also allows the mixing of axes from multiple groups. For example, if you are scanning both incident energy and detector angle, the former could be stored in a NXmonochromator group and the latter in a NXdetector group. Your method may be more transparent, although high-level APIs can make the association clearer. For example, in the attached image from NeXpy, the chain-link icon shows that the item is a link. If you right-click on the link, one of the options is Let us know if this meets your needs, or if you think new classes will still be useful. We will certainly consider them if you do. |
Thank you, I had seen the I think the second use case (multiple Thanks again for taking time to review and discuss this request, it is greatly appreciated. |
Good point. The That documentation will be addressed with (new) issue #581. |
This is where the |
The Design chapter of the manual describes NeXus links and gives an example use of the |
Brilliant! Thank you, I will start making sure target attributes are added appropriately. I assume it is also correct to add them when the data is externally linked (e.g. unless the data is only written directly in the Finally, is there an approved manner of representing that a certain |
There is not a standard set for Another way is to place both |
The NAPI code makes no You'd best avoid using the |
Thank you so much for this again, I just want to check with one final example and then I will close the request (although at this point it sounds like I should try the NAPI if that is the reference implementation). If I have some data in myfile.h5, and I make an eternal link to it in my NeXus file in the |
The procedure sounds right. BUT, HDF5 will not let you be do this ("Interfile hard links are not allowed"). Just tried it with Python and h5py, following the external file example in the manual. Continuing that example:
Conclusion is that when you want to make a link to an object in a NeXus HDF5 data file and that object is itself externally linked, then instead of making a hard link at the new location, you make an external file link at the new location back to the data source. Clear enough? |
Your external link example does reveal a limitation in using the |
That's a shame, the I don't suppose there is a plan to move the (As an aside, should I close this pull request - i'm now not convinced this is the most NeXus approach - and open an issue pointing at it? Are more people likely to read pull request comments or issues?) |
The Perhaps we re-examine your original intention, which was to associate the NXdata and NXdetector groups. I agree that closing this PR without a merge is the right course, and open a new issue to discuss how best to implement your intention. The scope may expand to include associations between NXprocess, NXlog, and NXnote as well. |
Hi, to add my 2c's worth: In a normal in-file link look at the target attribute. For an external link, NAPI So, yes, we have the use case for NXexperiment_data well covered. |
Hi Mark, P.S. I see that Jacob was already making a similar point. |
Hi, Thanks, but if this points to the external file, the only way I can find the corresponding NXDetector is to parse all the NXDetectors looking for the same url which I don't really want to do. Also, is the napimount atttribute well documented NeXus standard (I haven't seen it before, but I am certainly not a NeXus expert)? Finally structuring code like:
doesn't seem ideal. I admit that the NXexperiment/NXexperimentdata is not the way we want to do things, but the above can't be the recommended approach? |
Not the right solution for this functionality, discussion moved to issue #583 |
Contributed definitions to allow NXdata groups to be related to each other and an NXdetector.
With the aim of making writing software for visualisation and processing of data collections with multiple detectors in the same scan easier by explicitly describing how the NXdata groups are released to each other and the corresponding NXDetector.