Portable SSB results: JSON and NumPy#
Save a result as two ordinary files beside the original measurements:
data/
sample_master.h5
sample_data_000001.h5
live/screen/sample_master/
ssb.json
ssb.npy
The .npy contains the numerical phase, not a colored preview. JSON is readable
metadata, with no base64 arrays. Keep both files together when sharing. No raw
data, complex object, or large Fourier evidence is duplicated. A 512-square
phase is 1,048,704 bytes as NumPy v1, plus its small JSON record.
Schema 2 contract#
schema:quantem.ssb-phase/2. Records of version 1 (format: live.ssb,schemaVersion: 1, camelCase keys) are refused; export them again.phase_file: companion.npybasename in the same directory; no traversal.shape:[rows, cols]integers, 1 through 4096 inclusive.NumPy v1, C-order, little-endian float32 (
<f4); finite values only.phase_encoding:float32-le-row-major;phase_unit:rad.phase_sha256: SHA-256 of raw row-major phase bytes, excluding the NumPy header. No uint16 conversion, clipping, normalization or quantization.source_identity: lowercase SHA-256 from the existinglive4dstem.dataset/v0.1master/ordered-member byte identity.calibration:voltage_kV,semiangle_mrad,scan_sampling_Aanddetector_sampling_mrad([row, col]),bright_field_center_px([row, col], full detector); optionalbright_field_radius_pxandexcluded_detector_pixels. The detector sampling is the one the fit used.aberrations:C10_nm,C12_nm,phi12_deg(scan frame);scan_detector_rotation_degin [0, 360) andscan_detector_rotation_flipped: saved physical settings, independent of display contrast and colormap.sample_tilt_mrad([row, col], scan frame) anddepth_spread_nm: present together for a tilt-corrected fit, whose C10 is the defocus at mid-depth; absent for a fit at tilt 0. A record with one and not the other is refused.provenance: nonempty string-valued object identifying producer, phase variant, recorded revision and calibration/identity limitations.run_metadata: readable JSON object preserving the original scientific run, including higher-order settings when recorded.
The exporter reads only a stored fit block of the current fit schema
(computed.ssb with "schema": "quantem.ssb-fit/7"); another block is
refused with the reason.
Publish NumPy first and JSON last. Never overwrite a different result. Repeating identical exports is safe. Readers validate shape, dtype, finite values, units, calibration, companion location and checksum. Unknown versions are rejected. JSON is bounded to 32 MiB. The native explorer currently accepts 512 x 512 phase images, although the interchange reader supports larger shapes.