silx-kit / silx

silx toolkit
http://www.silx.org/doc/silx/latest/
MIT License
136 stars 74 forks source link

[fabioh5] const positioners/counters #681

Closed vallsv closed 7 years ago

vallsv commented 7 years ago

Whould we create a single value when the vector of values from positioners/counters/others is always the same?

For example we can have energy or pixel_size which never change.

It is consistant with the current implementation of spech5, then i think it can be useful to see that a metadata is constant.

PiRK commented 7 years ago

The current implementation of spech5 does not transform constant 1D arrays into a scalar.

If needed, it could be done. But maybe in some situations it's better to know that a detector recorded n-times the same value than just seeing a single value? I'm not sure.

vasole commented 7 years ago

I would not try to be so smart.

If one has a 1D array it should be kept as a 1D array.

pixel_size is a property of a detector. If you are going to interpret it, then it is to be under the NXdetetor group describing it.

energy, by other hand, it is something that can change and indeed it will change, it is not a property and it makes perfect sense to have as many as frames.

I would recommend the approach followed with SPEC files seen as HDF5. Parse what we know it can be parsed and put at proper places and leave the uninterpreted header available for the case some (legacy?) tools need to parse the header in their own way.

vasole commented 7 years ago

Just a comment.

Unfortunately, even though pixel_size is a property of the detector, perhaps the usage is not correct. One can imagine the binning changing and instead of reporting separately binning and pixel_size, the user/software/writer reporting as pixel_size the binned dimensions.

vallsv commented 7 years ago

Ok, let's close the question then. About pixel size and other properties like that, that's very special cases, and we do not try to extract anything right now.