Skip to content

How to implement correctly type from NXdetector in hdf? #33

@RGBYCP

Description

@RGBYCP

Dear Nexus community,
Could I ask here for advice, please?

NXdetector has an entry called type
https://manual.nexusformat.org/classes/base_classes/NXdetector.html

"Description of type such as He3 gas cylinder, He3 PSD, scintillator, fission chamber, proportion counter, ion chamber, ccd, pixel, image plate, CMOS, …"

How do I implement this with h5py correctly?
The manual for h5py does not give an example for string datasets. https://docs.h5py.org/en/stable/strings.html#storing-strings

My approach:

uv_spectra=grp_uv.create_group("uv_spectra")
uv_spectra.attrs["NX_class"] = 'NXdetector'
string_dt = h5py.special_dtype(vlen=str)
uv_spectra_type=uv_spectra.create_dataset('type', data='ccd', dtype=string_dt)

But I don't know if this is the correct way.
Thank you for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions