lisa_noise.io.write =================== .. py:module:: lisa_noise.io.write .. autoapi-nested-parse:: Write LISA noise estimation results to HDF5 files. Functions --------- .. autoapisummary:: lisa_noise.io.write.write_inference_result lisa_noise.io.write.collect_segments lisa_noise.io.write.write_mle Module Contents --------------- .. py:function:: write_inference_result(filepath: str, result: lisa_noise.types.PipelineResult) -> None Write a :class:`~lisa_noise.types.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) :param filepath: Output HDF5 path. :param result: :class:`~lisa_noise.types.PipelineResult` instance. .. py:function:: 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 :func:`lisa_noise.io.read.get_XYZ_inst_cov`. :param output_dir: Directory containing ``segment_*.h5`` files written by :func:`write_inference_result`. :type output_dir: str :param out_path: Path for the combined output file (overwritten if it exists). :type out_path: str .. py:function:: 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:: Use :func:`write_inference_result` with a :class:`~lisa_noise.types.PipelineResult` instead. :param filepath: Path to the output HDF5 file (will be overwritten if it exists). :type filepath: str :param x_mle: MLE parameter vector — log₁₀ PSD values at free knots, TMA then OMS. :type x_mle: (ndim,) ndarray :param knots: Output of ``build_knots``, used to extract knot frequencies. :type knots: dict :param converged: Whether the optimiser converged according to scipy. :type converged: bool, optional :param n_iter: Number of optimiser iterations. :type n_iter: int, optional :param segment: Label for the data segment processed, e.g. ``"segment0"``. :type segment: str, optional :param science_band: ``(f_low, f_high)`` science-band limits in Hz. :type science_band: (float, float), optional