Input and output
Reading and writing time series.
read_hdf5(path)
¶
Read every dataset in path written in the layout :func:write_hdf5 writes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Input file. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, TimeSeries]
|
Mapping of dataset name to :class: |
Raises:
| Type | Description |
|---|---|
TypeError
|
If a member is a group rather than a dataset. |
ValueError
|
If a dataset lacks the |
Source code in src/gwmock_data/io/hdf5.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
write_hdf5(series, path)
¶
Write each series to path as one HDF5 dataset named by its key, replacing the file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series
|
Mapping[str, TimeSeries]
|
Mapping of dataset name to a one-dimensional time series (this package's or GWpy's). |
required |
path
|
str | Path
|
Output file. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a series is not one-dimensional. |
Source code in src/gwmock_data/io/hdf5.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |