APE-HE NeXuS to JSON
Description
The APE-HE NeXus to JSON converter is designed to automate the process of extracting metadata from NeXus (.nxs) files produced by the Advanced Photoelectric Effect - High Energy (APE-HE) experiment,
which is performed for various scientific techniques such as XAS, XMCD, IV CURVE, or 2D MAP.
It automatically maps the extracted metadata into the agreed-upon schema
using the Python Pydantic library, and generates a structured JSON document.
The NeXus file is parsed using the Python library H5py, which allows efficient navigation and manipulation of HDF5-based files like NeXus.
The current converter processes individual NeXus files and zipped NeXus files from APE-HE experiments, transforming the extracted metadata into a structured JSON format or zipped JSON files suitable for storage.
The source code is available here.
Input
- Path to the Schema file (
.json): A JSON schema that defines the desired structure of the output document. - Path to the NeXus file (
.nxs) or zipped NeXus files (.zip): A NeXus file containing experimental metadata and data. - Name of the output file (
.json) for a single NeXus file input or (.zip) for zipped NeXus files input: The desired name of the output file where the metadata document will be saved.
Supported Vendors
- Custom acquisition software for CNR-IOM beamline @Elettra-Sincrotrone Trieste
Output
- A structured
JSONfile or zippedJSONfiles containing the extracted metadata aligned with the schema.