gwexpy.timeseries.io.zarr_
Note
現在の挙動は Phase 7 Truth Ledger と #8-19 fail-fast 修正に従います。
配列ごとの timing metadata は
sample_rateを優先します。dtだけがある場合はsample_rate = 1 / dtとして復元します。両方ない場合は、以前のように暗黙で
1 Hzを仮定せずValueErrorを送出します。legacy store を意図的に読む場合だけ、
sample_rate_override=...またはdt_override=...のどちらか一方を 明示してください。
Zarr reader/writer for gwexpy.
Convention
A Zarr store is a group where each array represents one channel.
Per-array attributes sample_rate (Hz) and t0 (GPS seconds) are
used to reconstruct the time axis. If sample_rate is absent the
inverse of dt is tried. If both are absent, reading fails with a
clear error instead of silently assuming 1 Hz.
Directory stores, zip stores, and any other backend supported by the
zarr library can be used as source / target.
Functions
|
Read a Zarr store into a TimeSeriesDict. |
|
Read a Zarr store and return the first channel. |
|
Read a Zarr store and convert its channels to a matrix. |
|
Write a TimeSeriesDict to a Zarr store. |
|
Write one |
- gwexpy.timeseries.io.zarr_.read_timeseriesdict_zarr(source, *, channels=None, unit=None, sample_rate_override=None, dt_override=None, **kwargs) TimeSeriesDict[source]
Read a Zarr store into a TimeSeriesDict.
- Parameters:
source (str, path-like, or zarr store) – Path to the
.zarrdirectory (or any zarr-compatible store).channels (iterable of str, optional) – Array names to read. If None, all arrays in the root group are loaded.
unit (str, optional) – Physical unit override applied to every channel.
sample_rate_override (float, optional) – Explicit sample-rate recovery value in Hz for legacy stores that lack per-array
sample_rateanddtmetadata. Mutually exclusive withdt_override.dt_override (float, optional) – Explicit sample-spacing recovery value in seconds for legacy stores that lack per-array timing metadata. Mutually exclusive with
sample_rate_override.**kwargs – Additional keyword arguments forwarded to
zarr.open_group.
- gwexpy.timeseries.io.zarr_.read_timeseries_zarr(source, **kwargs) TimeSeries[source]
Read a Zarr store and return the first channel.
- gwexpy.timeseries.io.zarr_.read_timeseriesmatrix_zarr(source, **kwargs) TimeSeriesMatrix[source]
Read a Zarr store and convert its channels to a matrix.
- gwexpy.timeseries.io.zarr_.write_timeseriesdict_zarr(tsd, target, **kwargs)[source]
Write a TimeSeriesDict to a Zarr store.
Each channel is written as an array in the root group with
sample_rate,t0, andunitstored as attributes.
- gwexpy.timeseries.io.zarr_.write_timeseries_zarr(ts, target, **kwargs)[source]
Write one
TimeSeriesto a Zarr store.