nexusformat / NIAC

Issue for the NIAC to discuss (no code)
2 stars 0 forks source link

Allow NXdata dimension variables to contain a list of strings #97

Open benajamin opened 2 years ago

benajamin commented 2 years ago

NXdata groups contain a multidimensional data array with the @axes attribute pointing to fields within the group that hold lists of values to be used as labels for the corresponding dimensions of the dataset. Currently, the values of these "variable" datasets are restricted to NX_NUMBER. I propose that this be relaxed to allow a list of strings, with the number of list items being equal to the size of the corresponding dimension of the main data array (the one that https://github.com/signal points to). This proposal is motivated by Dectris, who would like to present data recorded by some of their detectors in terms of "channels". They would like one axis of the dataset to be labelled as "channel" and to label slices of the data array with strings like "low threshold", "high threshold" and "difference". Presented in https://github.com/nexusformat/definitions/issues/945 Partly fixes https://github.com/nexusformat/definitions/issues/940

benajamin commented 2 years ago

Proposal is to allow data types of NX_NUMBER or NX_CHAR in the NXdata dimension labels

prjemian commented 2 years ago

As a note, I cannot find any existing NXDL file that contains a choice of data types. However, the NX_TRANSFORMATION data type provides this capability (as described in its documentation):

        could be any of these: ``NX_LENGTH``, ``NX_ANGLE``, or ``NX_UNITLESS``

One way to allow NXdata dimension variables to contain a list of strings, we could follow the existing pattern of NX_TRANSFORMATION.