Skip to content

Reading MS signal metadata in rdheader #442

Done

Description

@bemoody

In general, it's useful to be able to read record metadata without reading the signals.

For multi-segment records, however, rdheader just reads the MS header by default (rd_segments=False), which means it doesn't read any of the signal metadata (e.g. signal names and units).

With rd_segments=True, rdheader reads the signal metadata and also all of the segment headers, which are not always needed.

For some applications it would be useful to have a middle ground of reading the multisegment header and the layout header, but not any of the segment headers. (Note that this is what isigopen does.)

I think this might make sense as the default behavior, since reading the signal metadata is a very common use of rdheader.

Activity

  1. tompollard commented on Nov 29, 2026

    @tompollard
    Member

    Update: #770 adds read_multi_segment_headers(path) for the metadata-only middle ground described here. It reads the main multi-segment header plus the layout header for variable layout, or the first non-gap data segment header for fixed layout, without loading samples or the remaining segment headers.

    We kept rdheader's default unchanged for compatibility and made the additional header read explicit. I am leaving this issue open for the separate question of whether the legacy rdheader default should change, but the two-header use case now has a direct API.

  2. tompollard commented on Nov 30, 2026

    @tompollard
    Member

    Correction to my update above: I do not think the rdheader default should change. The original suggestion addressed a missing middle ground, which #770 now provides through an explicit metadata-only read. Changing rdheader would make existing calls fetch another header, potentially over the network, and change their behavior without the caller asking for it. I am closing this issue as addressed by read_multi_segment_headers().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions