read

function of dascore.io.core source

read(
    path: str | pathlib.Path | dascore.utils.io.IOResourceManager[str, Path, IOResourceManager] ,
    file_format: str | None[str, None] = None,
    file_version: str | None[str, None] = None,
    time: tuple[tuple[int | float | str | numpy.datetime64 | pandas._libs.tslibs.timestamps.Timestamp | None[int, float, str, datetime64, Timestamp, None], int | float | str | numpy.datetime64 | pandas._libs.tslibs.timestamps.Timestamp | None[int, float, str, datetime64, Timestamp, None]], None] = None,
    distance: tuple[tuple[float | None[float, None], float | None[float, None]], None] = None,
    **kwargs ,
)-> ‘SpoolType’

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.
*kwargs All kwargs are passed to the format-specific read functions.
Note

Unlike spool this function reads the entire file into memory.

Examples

import dascore as dc
from dascore.utils.downloader import fetch

file_path = fetch("prodml_2.1.h5")

patch = dc.read(file_path)