Skip to content
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

Added a very basic example nxs file #79

Open
wants to merge 1 commit into
base: fairmat
Choose a base branch
from

Conversation

sherjeelshabih
Copy link
Collaborator

@sherjeelshabih sherjeelshabih commented Oct 19, 2023

This is an example of how one could have HDF5 instance linking themselves to NeXus concepts. The actual HDF5 names could be anything the instrument manufacturer or user likes. This way it is super easy to browse for the user in their domain/experiment. These entities could be from various producers written for different versions NeXus definitions.

I also use 3 different base classes here. An AppDef could also be created with such linking to concepts if a data producer actually has motivation to completely package their technique/measurement in one file. This way we enable producers to have a complete file if they can. And also smaller/partial producers to still give us FAIR data.

These are the contents of the file for easier discussion:

  • beam_stopper
    • nexus_concept /NXversion:a216aa5/NXbeam_stop
    • detector_distance 0.0004
      • nexus_concept /NXversion:a216aa5/NXbeam_stop/distance_to_detector
      • units m
  • instrument
    • polarization [2, 3, 7]
      • nexus_concept /NXversion:81abd33/NXbeam_polarized/polarization
    • pulse_power 2.3
      • nexus_concept /NXversion:81abd33/NXbeam_time_resolved/pulse_energy
      • units W
    • pulse_time_length
      • nexus_concept /NXversion:81abd33/NXbeam_time_resolved/pulse_duration
      • units s

@domna @lukaspie @mkuehbach @RubelMozumder @sanbrock

@RubelMozumder
Copy link

RubelMozumder commented Oct 19, 2023

This is a nice example to start. I like this idea for the backward formation of AppDef from HDF5. I am also wondering:

  1. How could they write the docs for specialized concepts, if they need to write?
    My idea is to write the doc under the concept (Probably this is also somthing in your mind if you would write the doc in the example.).
  2. If NXversion:a216aa5 is the base class's version (or base definition), could you also allow to write it in a separate attribute under the physical quantity as units? Then we do not need to split the string the each time to remove the base class version.
  3. Probably units is a bit misleading for anyone (But we can take care of it while converting to nxdl)

@sherjeelshabih
Copy link
Collaborator Author

sherjeelshabih commented Oct 20, 2023

This is a nice example to start. I like this idea for the backward formation of AppDef from HDF5. I am also wondering:

Thanks! I do not intend to reverse create AppDefs from the HDF5 files. But I meant data producers can write an AppDef manually with a similar link to concept idea if they possible can i.e. have all the data they need to make sense of this.

  1. How could they write the docs for specialized concepts, if they need to write?
    My idea is to write the doc under the concept (Probably this is also somthing in your mind if you would write the doc in the example.).

With the way I see this working, one should not define another concept in the AppDef. Just reuse it from the BaseClass or specialize it in the base class realm. If we keep making specialized concepts in AppDefs, then it's no different than "custom schemas".

  1. If NXversion:a216aa5 is the base class's version (or base definition), could you also allow to write it in a separate attribute under the physical quantity as units? Then we do not need to split the string the each time to remove the base class version.

Well, you either need to split to make sense of it in this example. Or you concatenate it to make sense of it in what you recommend. So they are quite equivalent. We can discuss this to see what will suit best. I don't mind either way. I only like one thing with the way it is now that it is one entity we have to deal with to get what the concept exactly is. If we have it detached, it can be ambiguous when merging two or more HDF5 files/AppDefs.

  1. Probably units is a bit misleading for anyone (But we can take care of it while converting to nxdl)

I wouldn't want to convert it like that necessarily. If one wants to, it is possible. But if we make that a design choice, we will start limiting users again. I don't want that. If they will need to always worry about how the HDF5 file become an AppDef, they might as well just write good AppDefs now and we can even ditch the idea of linking concepts in the HDF5 file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants