lisa_noise.io.write

Write LISA noise estimation results to HDF5 files.

Functions

write_inference_result(filepath, result) → None

Write a PipelineResult to HDF5.

collect_segments(output_dir, out_path) → None

Merge per-segment output files into one combined HDF5.

write_mle(filepath, x_mle, knots, *[, converged, ...]) → None

Write MLE results to an HDF5 file.

Module Contents

lisa_noise.io.write.write_inference_result(filepath: str, result: lisa_noise.types.PipelineResult) → None

Write a PipelineResult to HDF5.

Layout:

/
  attrs: schema_version
  metadata/
    attrs: model_name, segment_idx, method, science_band
    param_names  (dataset, string array)
  geometry/
    attrs: t0, duration (optional), n_ltt_epochs (optional)
    ltts         (dataset, (6,) light travel times at t0, or
                  (n_ltt_epochs, 6) at the epochs averaged over)
  inference/
    mle/         (one attr per parameter name)
    diagnostics/ (optional, one attr per key)
    samples      (optional dataset)
  extras/        (optional, mode-specific metadata)
Parameters:
lisa_noise.io.write.collect_segments(output_dir: str, out_path: str) → None

Merge per-segment output files into one combined HDF5.

Reads every segment_*.h5 in output_dir and copies each into its own group of out_path (one group per segment, mirroring the per-segment layout). The combined file is the product consumed by lisa_noise.io.read.get_XYZ_inst_cov().

Parameters:
  • output_dir (str) – Directory containing segment_*.h5 files written by write_inference_result().

  • out_path (str) – Path for the combined output file (overwritten if it exists).

lisa_noise.io.write.write_mle(filepath: str, x_mle: numpy.ndarray, knots: dict, *, converged: bool = True, n_iter: int = 0, segment: str = 'segment0', science_band: tuple = (0.0001, 0.1)) → None

Write MLE results to an HDF5 file.

Deprecated since version Use: write_inference_result() with a PipelineResult instead.

Parameters:
  • filepath (str) – Path to the output HDF5 file (will be overwritten if it exists).

  • x_mle ((ndim,) ndarray) – MLE parameter vector — log₁₀ PSD values at free knots, TMA then OMS.

  • knots (dict) – Output of build_knots, used to extract knot frequencies.

  • converged (bool, optional) – Whether the optimiser converged according to scipy.

  • n_iter (int, optional) – Number of optimiser iterations.

  • segment (str, optional) – Label for the data segment processed, e.g. "segment0".

  • science_band ((float, float), optional) – (f_low, f_high) science-band limits in Hz.