HDF5 metadata layout¶
Overview¶
Diffraction data are written on the server by Jungfraujoch (jfjoch_writer), producing NeXus/NXmx-style
HDF5 files. After acquisition, the Jungfrau GUI (JFGui) optionally post-processes the written HDF5 and
adds/updates electron-diffraction/TEM-specific metadata (beam fit, TEM state, stage motion, apertures, etc.).
This page documents:
The baseline file structure produced by Jungfraujoch (master + data files).
The extra/overwritten fields written by the JFGui (this project).
Conventions (units, datatypes, and where values come from).
References¶
JFJOCH_WRITER — Jungfraujoch writer file structure (upstream).
NXmx — NeXus NXmx application definition (schema reference).
NXmx_xml — NXmx NXDL definition file (formal schema).
Files produced by Jungfraujoch¶
Jungfraujoch writes a master file (high-level metadata + links) and one or more data files (the actual image stacks). From the GUI perspective, the important point is:
The diffraction frames are stored in the data files; the master file aggregates metadata and provides convenient links to the data.
Master file vs data file layout¶
Master file (overview)¶
The master file (*_master.h5) contains the NeXus entry and metadata groups (e.g. /entry/instrument, /entry/sample,
/entry/source). It also contains an /entry/data group that acts as a link table to the individual
data files:
/entry/data/data_000001,data_000002, … are links to frame datasets stored in the corresponding*_data_*.h5files.The master file therefore references the frames but does not store them as a single contiguous dataset.
Data file (frames)¶
Each data file (e.g. *_data_000034.h5) stores the actual frames as a single dataset:
/entry/data/data→ shape(nframes, ny, nx)
A non-exhaustive view of the relevant groups is shown below (see JFJOCH_WRITER for the full structure):
File |
Path |
Description |
|---|---|---|
Master |
|
Links to per-run data files / frame datasets |
Data |
|
Raw image data (stack: |
Master (optional) |
|
Spot finding / indexing auxiliaries (optional) |
Master (optional) |
|
Azimuthal integration results (optional) |
Master (optional) |
|
User-provided metadata (optional; depends on acquisition configuration) |
JFGui metadata injection¶
JFGui post-processes the master HDF5 file after acquisition and only updates metadata
(i.e. it does not modify the diffraction frames under /entry/data). See Overwrite semantics
for details on the create-or-replace behavior.
The injected metadata are grouped below by subsystem.
1) Detector group¶
Paths under /entry/instrument/detector:
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
string |
Human-readable detector identifier (site-specific) |
|
|
int |
pixel |
Beam center X from beam fitting (JFGui) |
|
int |
pixel |
Beam center Y from beam fitting (JFGui) |
|
uint64 |
mm |
Calibrated sample-to-detector distance from LUT (see note). |
|
uint64 |
Hz |
Detector frame rate (fixed for JUNGFRAU here) |
|
uint64 |
keV |
JUNGFRAU threshold used during acquisition |
Paths under /entry/instrument/detector/detectorSpecific:
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
string |
Sensor material label (e.g. |
|
|
string |
JFGui version tag ( |
|
|
string |
Git commit hash of the GUI build |
2) Source group¶
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
string |
Set to |
Note
NeXus/NXmx is historically rooted in X-ray crystallography, but electron-diffraction pipelines
commonly set probe=electron when writing NXmx-like files.
3) Optics (TEM state + beam characterization)¶
These are written under /entry/instrument/optics:
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
string |
Timestamp of GUI metadata update |
|
|
string |
TEM model string |
|
|
float |
kV |
HT value (fallback to 200 kV on read error) |
|
uint16 |
HT readout status (1=valid, 0=invalid) |
|
|
float |
Å |
Computed from acceleration voltage (relativistic electron wavelength) |
|
uint16 |
TEM Magnification value readback (Imaging mode) |
|
|
uint16 |
TEM Magnification value readback (Diffraction mode) |
|
|
float |
deg |
Final TX tilt angle (stage readback) |
|
uint16 |
Spot size index (+1 stored). Range is 1-8 |
|
|
uint16 |
Alpha index (+1 stored). Range is 1-9 |
Apertures:
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
uint16 |
(index) |
Condenser aperture hole number (0=open, 1–4=hole index). |
|
string |
µm |
Condenser aperture diameter from LUT mapping (CL_ID → size in µm). |
|
uint16 |
(device counts) |
Condenser aperture centering X |
|
uint16 |
(device counts) |
Condenser aperture centering Y |
|
uint16 |
(index) |
Selected-area aperture hole number (0=open, 1–4=hole index). |
|
string |
µm |
Selected-area (SA) aperture size label |
|
uint16 |
(device counts) |
Selected-area (SA) aperture centering X |
|
uint16 |
(device counts) |
Selected-area (SA) aperture centering Y |
Note
Aperture positions are reported in microscope controller coordinates (“device counts”). In JEOL TEMExt-style interfaces these are typically 12-bit values (0–4095).
Lens/deflector state (raw readbacks):
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
uint32 |
(device counts) |
Raw value of CL3 lens setting (0–65535) |
|
uint32 |
(device counts) |
Raw value of IL1 lens setting (0–65535) |
|
uint32 |
(device counts) |
Raw value of X component of Intermediate Stigmator (IL Stig) deflector (0–65535) |
|
uint32 |
(device counts) |
Raw value of Y component of IL Stig (0–65535) |
|
uint32 |
(device counts) |
Raw value of X component of the Projector Shift (PLA) deflector (0–65535) |
|
uint32 |
(device counts) |
Raw value of Y component of the PLA (0–65535) |
Beam fit / illumination (GUI-derived):
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
float |
pixel |
Optical axis center X on detector (from LUT/config). |
|
float |
pixel |
Optical axis center Y on detector (from LUT/config). |
|
float |
pixel |
Beam width sigma X from beam fit |
|
float |
pixel |
Beam width sigma Y from beam fit |
|
float |
deg |
Beam ellipse angle from fit |
|
float |
pA/cm² |
Estimated illumination at detector plane |
|
float |
e⁻/Ų |
Dose estimate at sample plane |
4) Stage (position + rotation during collection)¶
Written under /entry/instrument/stage.
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
float |
µm |
Stage X (converted from TEM readback) |
|
float |
µm |
Stage Y (converted from TEM readback) |
|
float |
µm |
Stage Z (converted from TEM readback) |
|
string |
|
|
|
float |
(index) |
Speed selector index from TEM |
|
float |
deg/s |
Nominal rotation speed from lookup table |
|
float[3] |
(vector) |
Rotation axis unit vector (XDS convention) from LUT (ht_voltage and magnification regime). |
If rotation angle samples were recorded (rotations_angles not None),
additional datasets are stored:
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
float |
deg |
Start angle from recorded samples |
|
float |
deg |
End angle from recorded samples |
|
float |
deg/s |
Mean measured angular velocity from samples |
|
float |
deg/s |
Std dev of measured angular velocity |
|
string |
|
|
|
array |
(time,deg) |
Raw record (as stored by GUI) |
5) CIF convenience block (downstream crystallography tooling)¶
Written under /entry/cif as simple text fields to help downstream export.
Path |
Type |
Unit |
Description |
|---|---|---|---|
|
string |
K |
Fixed-format CIF temperature formatted as text |
|
string |
Å |
Wavelength formatted as text |
|
string |
|
|
|
string |
CIF label (monochromatic beam) |
|
|
string |
TEM source |
|
|
string |
TEM model (JEOL JEM2100Plus) |
|
|
string |
kV |
HT formatted as text |
|
string |
Holder / goniometer (e.g. single axis tomography holder) |
|
|
string |
Detector class (e.g. hybrid pixel area detector) |
|
|
string |
Detector model (e.g. JUNGFRAU) |
|
|
string |
1/mm |
Convenience value, computed as |
Notes¶
LUT-derived calibration values¶
Some metadata are not direct TEM readbacks; they are calibrated using lookup tables stored in
jfgui2_config.json (e.g. detector distance, aperture sizes, rotation axis, optical-axis center).
detector_distanceis interpolated from LUT points as a function of DIFF nominal and HT.CL_size/SA_sizemap aperture IDs to diameters in µm.stage_tx_axisprovides an XDS-style rotation-axis unit vector keyed by HT (and magnification regime).optical_axis_center_{x,y}are detector pixel coordinates defined for the current setup.
Overwrite semantics¶
JFGui uses “delete then recreate” for each dataset. This is simple, deterministic, and ensures the GUI-written metadata takes precedence. However, it also discards:
existing dataset attributes,
chunking/compression,
original dtype choices.