coseda.nexus package¶
Submodules¶
coseda.nexus.detector module¶
Helpers for detector geometry metadata in NeXus.
- coseda.nexus.detector.write_detector_geometry(h5file, camera_length_m, correction_factor=1.0)[source]¶
Store camera length metadata and NXtransformations for detector placement.
camera_length: given value from microscope (m)
camera_length_correction: dimensionless multiplier
camera_length_effective: corrected length (m)
transformations/det_z: translation along +Z by corrected length
- Parameters:
h5file (h5py.File)
camera_length_m (float)
correction_factor (float)
- Return type:
None
coseda.nexus.goniometer module¶
Helpers for NeXus goniometer transform chains.
coseda.nexus.groups module¶
Helpers to ensure NeXus parent groups exist with NX_class attributes.
coseda.nexus.images module¶
NeXus-friendly NXdata view for image stacks.
coseda.nexus.indices module¶
Helpers for index mappings between dense and sparse frame streams.
- coseda.nexus.indices.ensure_image_key(h5file)[source]¶
Ensure /entry/data/image_key exists, mapping current frames to original indices.
If an index dataset exists and matches the image length, reuse it (unless it already contains stripped markers). Otherwise, fall back to arange.
- Parameters:
h5file (h5py.File)
- Return type:
None
coseda.nexus.logs module¶
Helpers for dense NXlog views over full-length metadata streams.
coseda.nexus.paths module¶
NeXus path constants and lookup helpers.
- coseda.nexus.paths.get_first_existing_path(h5file, paths)[source]¶
Return the first existing HDF5 path from paths, or None.
- Parameters:
paths (Iterable[str])
- Return type:
str | None
coseda.nexus.peaks module¶
NeXus-friendly NXdata views for peakfinding outputs.
coseda.nexus.process module¶
Helpers for writing NeXus NXprocess metadata.
- coseda.nexus.process.write_beam_incident_energy(h5file, energy_ev)[source]¶
Ensure NXbeam exists and write incident_energy in eV.
- Parameters:
h5file (h5py.File)
energy_ev (float)
- Return type:
None
- coseda.nexus.process.write_nxprocess_centerfinding(h5file, program, method=None, parameters=None, input_path=None, output_path=None)[source]¶
Write an NXprocess record for beam center finding.
- Parameters:
h5file (h5py.File)
program (str)
method (str | None)
parameters (Dict[str, Any] | None)
input_path (str | None)
output_path (str | None)
- Return type:
None
- coseda.nexus.process.write_nxprocess_centerrefinement(h5file, program, method=None, parameters=None, input_path=None, output_path=None)[source]¶
Write an NXprocess record for beam center refinement.
- Parameters:
h5file (h5py.File)
program (str)
method (str | None)
parameters (Dict[str, Any] | None)
input_path (str | None)
output_path (str | None)
- Return type:
None
- coseda.nexus.process.write_nxprocess_import(h5file, program, parameters=None, input_path=None, output_path=None)[source]¶
Write an NXprocess record for import/conversion steps.
- Parameters:
h5file (h5py.File)
program (str)
parameters (Dict[str, Any] | None)
input_path (str | None)
output_path (str | None)
- Return type:
None
- coseda.nexus.process.write_nxprocess_indexing(h5file, program, method=None, parameters=None, input_path=None, output_path=None)[source]¶
Write an NXprocess record for indexing/integration runs.
- Parameters:
h5file (h5py.File)
program (str)
method (str | None)
parameters (Dict[str, Any] | None)
input_path (str | None)
output_path (str | None)
- Return type:
None
- coseda.nexus.process.write_nxprocess_merging(h5file, program, method=None, parameters=None, input_path=None, output_path=None)[source]¶
Write an NXprocess record for merging runs.
- Parameters:
h5file (h5py.File)
program (str)
method (str | None)
parameters (Dict[str, Any] | None)
input_path (str | None)
output_path (str | None)
- Return type:
None
- coseda.nexus.process.write_nxprocess_peakfinding(h5file, parameters, program, inputs=None, outputs=None)[source]¶
Write an NXprocess record for peakfinding (non-destructive to data).
- Parameters:
h5file (h5py.File)
parameters (Dict[str, Any])
program (str)
inputs (Iterable[str] | None)
outputs (Iterable[str] | None)
- Return type:
None
- coseda.nexus.process.write_nxprocess_stripping(h5file, threshold, force, input_path=None, output_path=None, kept_frames=None, stripped_frames=None)[source]¶
Write an NXprocess record for stripping.
- Parameters:
h5file (h5py.File)
threshold (float | None)
force (bool | None)
input_path (str | None)
output_path (str | None)
kept_frames (int | None)
stripped_frames (int | None)
- Return type:
None
Module contents¶
NeXus helpers and schema wiring.