import numpy as np
import dascore as dc
patch = dc.read("examples://terra15_das_1_trimmed.hdf5")read
read(
path: str | pathlib._local.Path | upath.core.UPath | dascore.utils.io.IOResourceManager[str, Path, UPath, IOResourceManager] ,
file_format: str | None[str, None] = None,
file_version: str | None[str, None] = None,
time: tuple[tuple[None | int | float | str | numpy.datetime64 | pandas.Timestamp | ellipsis[None, int, float, str, datetime64, Timestamp, <class ’ellipsis], None | int | float | str | numpy.datetime64 | pandas.Timestamp | ellipsis[None, int, float, str, datetime64, Timestamp, <class ’ellipsis]], None] = None,
distance: tuple[tuple[float | ellipsis | None[float, <class ’ellipsis, None], float | ellipsis | None[float, <class ’ellipsis, None]], None] = None,
snap: bool | str | collections.abc.Collection[bool, str, collections.abc.Collection[str], None] = None,
**kwargs ,
)-> ‘dc.Spool’
Read a fiber file.
For most cases, dascore.spool is preferable to this function.
Parameters
| Parameter | Description |
|---|---|
| path | A path to the file to read. |
| file_format |
A string indicating the file format. If not provided dascore will try to estimate the format. |
| file_version | An optional string indicating the format version. |
| time | An optional tuple of time ranges. |
| distance | An optional tuple of distances. |
| snap |
The dimensions whose stored labels come back on a grid. None (the default) snaps the names the format’s reader defaults to, shown in its get_metadata signature; True every one-dimensional numeric ortime-like dimension; False none, returning every coordinate exactly as stored; a name or tuple of names those dimensions, raising if a patch has no such dimension. Where a stored label sits more than dascore.config.max_shift steps off its grid, a reader keeps thelabels as stored and warns, naming the file. See rule 3 of the coordinate guidelines. |
| *kwargs | All kwargs are passed to the format-specific read functions. |
This function loads the requested samples immediately. Use spool to defer loading until patches are accessed.