MSeed.Native (wsdataselect v1.4.0)

Copy Markdown View Source

Native (pure-Elixir) miniSEED data reader.

This is the application-level counterpart to MSeed.NIF for the :native mode. It reads each DataFile through MSeed.Parser and produces the same per-file {source_id, earliest, binary} records ordered by (source_id, earliest) as MSeed.NIF.stream_data/1.

Unlike the :libmseed mode it does not require the C library / NIF at all, so it can serve as a portable fallback and as a basis for a streaming, bounded-memory reader.

The inventory (QueryController.get_datafiles/1 -> Repo.get_contents/1) already resolves the request into concrete files and byte ranges, so no per-record filtering is needed here.

Summary

Functions

Read all matching miniSEED data files and return the records in (source_id, earliest) order.

Functions

fetch(datafiles)

@spec fetch([Wsdataselect.DataFile.t()]) ::
  {:ok, [{String.t(), DateTime.t(), binary()}]} | {:error, term()}

Read all matching miniSEED data files and return the records in (source_id, earliest) order.

Mirrors MSeed.NIF.stream_data/1: a list of {source_id, DateTime, binary} tuples, one per non-empty DataFile.