The Fe spectrum dataset of the charge values has an unexpected shape.
Since it's a 1D dataset, we normally would expect the shape to be
(<num elements>, 1).
However, indeed it is just
(<num elements>).
This itself is not a "problem", but it is unexpected. Originally I was of the opinion that a shape as such was not supported in HDF5 (no idea why exactly).
whereas the other FeSpectrum* datasets are created as usual here:
https://github.com/Vindaar/TimepixAnalysis/blob/master/Analysis/ingrid/calibration.nim#L744-L752
using create_dataset directly. It's interesting though that write_dataset hands the data.shape directly, which for a 1D dataset will just be @[<num_elements>]. On the other hand create_dataset in the FeSpectrum cases above is being called with an integer (nEventsPassed = eventSpectrum.len). So the "problem" is that in create_dataset the parsing of an int number of elements maps this to a tuple here:
https://github.com/Vindaar/nimhdf5/blob/master/src/nimhdf5/datasets.nim#L376
whereas a sequence will be taken as is (a couple lines below). In this way it's actually a bug / design issue in nimhdf5.
The Fe spectrum dataset of the charge values has an unexpected shape.
Since it's a 1D dataset, we normally would expect the shape to be
(<num elements>, 1)
.However, indeed it is just
(<num elements>)
.This itself is not a "problem", but it is unexpected. Originally I was of the opinion that a shape as such was not supported in HDF5 (no idea why exactly).
It happens due to the way we create that dataset. It's the only one we create with the
write_dataset
convienience proc: In TPA: https://github.com/Vindaar/TimepixAnalysis/blob/master/Analysis/ingrid/calibration.nim#L1068 In nimhdf5: https://github.com/Vindaar/nimhdf5/blob/master/src/nimhdf5/datasets.nim#L527-L531whereas the other
FeSpectrum*
datasets are created as usual here: https://github.com/Vindaar/TimepixAnalysis/blob/master/Analysis/ingrid/calibration.nim#L744-L752 usingcreate_dataset
directly. It's interesting though thatwrite_dataset
hands thedata.shape
directly, which for a 1D dataset will just be@[<num_elements>]
. On the other handcreate_dataset
in the FeSpectrum cases above is being called with an integer (nEventsPassed = eventSpectrum.len
). So the "problem" is that increate_dataset
the parsing of anint
number of elements maps this to a tuple here: https://github.com/Vindaar/nimhdf5/blob/master/src/nimhdf5/datasets.nim#L376 whereas a sequence will be taken as is (a couple lines below). In this way it's actually a bug / design issue in nimhdf5.