jkotan / secop-file-examples

0 stars 0 forks source link

NXenvironment in NXinstrument #5

Open hgoerzig opened 8 months ago

hgoerzig commented 8 months ago

As I understand the NeXus documentation NXenvironment can only be placed inside NXsample. NXenvironment is only cited in NXsample, but not in NXinstrument. The philosophy behind this would be in my understanding: Everything what has to do with the beam meaning the optics and the detectors and related items goes into NXinstrument and everything that creates the conditions for the sample goes into NXsample and here into NXenvironment.

But as I understand, the sample environment has not been a particularly significant issue in the NIAC in the past. So if you have strong arguments this can be changed.

jkotan commented 8 months ago

Hello @hgoerzig,

Yes. Originally, I put all NXenvironment groups below NXsample which means that the NXsensor below NXenvironment describes a sample feature. However, some sensors could be more general, e.g. when they measure temperature in the hutch (which is also a feature of the instrument). Then I found https://github.com/nexusformat/definitions/blob/d73be6075d1fdeb0dc3f361d534afc27289c1b8d/contributed_definitions/NXsensor_scan.nxdl.xml#L118 and discussed with Sandor. He advised to store NXenvironment below NXinstrument which could be used to group general NXsensor belonging to one hardware node. I can move it back to NXsample but it would be good NIAC decide where NXenvironment could appear.

Currently, the definition contains contradiction. You can name only NXenvironment as temperature_env and magnetic_field_env. NXsensor can appear only in NXenvironment (and NXfilter) but its measurement field can have much more allowed values than temperature and magnetic_field.

g-guenther commented 8 months ago

Since context is created by placing certain (meta)data next to each other, it would make sense to place NXenvironment within NXsample. Here, I assume that at least one part of NXenvironment would be connected to NXsample. I sketched this arrangement in #3, too.

jkotan commented 8 months ago

Hello @hgoerzig and @g-guenther, I've added the env_in_sample_00550.nxs file with the nexus configuration where all NXenvironment groups are below NXsample. I've put also the old file into the env_in_instrument subdirectory.

hgoerzig commented 8 months ago

Hi @jkotan, thanks for adding the new example file!

Currently, the definition contains contradiction. You can name only NXenvironment as temperature_env and magnetic_field_env. NXsensor can appear only in NXenvironment (and NXfilter) but its measurement field can have much more allowed values than temperature and magnetic_field.

I don't think that's a contradiction. You can always add what you need to a NeXus file. It's just that nobody needed a definition of e.g. 'pressure_env' in the NeXus standard up to now. As I understand it, the NXsample/NXenvironment was not the focus of NeXus, so there is a lack of definitions in this area that you can fill.