Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mseed3 read/write support #3411

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Mseed3 read/write support #3411

wants to merge 20 commits into from

Conversation

crotwell
Copy link
Contributor

What does this PR do?

Adds read and write support for miniseed3.

Why was it initiated? Any relevant Issues?

Read and write the new FDSN miniseed3 format.

FDSN Specification

I set this up to use my simplemseed pypi package. Most other obspy.io subpackages seem to not have external dependencies, so was unsure how to handle this. Simplemseed has a dependency of crc32c, so not as simple as just copying files in, although I guess it is possible.

Also likely worth bringing @chad-earthscope into the conversation as there may be advantages to using mseed3 from new version of his libmseed C library. Personally, I like having a pure python implementation as it makes long term maintenance easier than via a C library, but opinions may vary.

Because the new json "extra headers" in miniseed3 are very flexible, it may be worth thinking about automatically copying more from the Trace Stats object. I have followed other io formats by having "mseed3"
inside of the stats, but that may be an extra layer that doesn't actually help anyone. It would be relative easy to just copy anything from stats that is not a standard part of the header into the extra headers. Its just json after all.

Code for parsing FDSN source ids is used internally, see code here. Not sure if it would be helpful to expose this further within obspy for dealing with FDSN source ids outside of miniseed3?

This code also creates longer network, station, etc in stats, which may break code that assumes the seed length limits. For example a SID of FDSN:XX2024_REALFAKE_01234567_H_HRQ_Z becomes:

         network: XX2024
         station: REALFAKE
        location: 012345
         channel: H_HRQ_Z
       starttime: 2024-01-02T15:13:55.123456Z
         endtime: 2024-01-02T15:13:58.123456Z
   sampling_rate: 1.0
           delta: 1.0
            npts: 4
           calib: 1.0
         _format: MSEED3
          mseed3: AttribDict({'pubVer': 0, 'eh': AttribDict({})})

Believe I have checked all the items for submission, but happy to revise if missed anything.

PR Checklist

  • Correct base branch selected? master for new features, maintenance_... for bug fixes
  • This PR is not directly related to an existing issue (which has no PR yet).
  • While the PR is still work-in-progress, the no_ci label can be added to skip CI builds
  • If the PR is making changes to documentation, docs pages can be built automatically.
    Just add the build_docs tag to this PR.
    Docs will be served at docs.obspy.org/pr/{branch_name} (do not use master branch).
    Please post a link to the relevant piece of documentation.
  • If all tests including network modules (e.g. clients.fdsn) should be tested for the PR,
    just add the test_network tag to this PR.
  • All tests still pass.
  • Any new features or fixed regressions are covered via new tests.
  • Any new or changed features are fully documented.
  • Significant changes have been added to CHANGELOG.txt .
  • First time contributors have added your name to CONTRIBUTORS.txt .
  • If the changes affect any plotting functions you have checked that the plots
    from all the CI builds look correct. Add the "upload_plots" tag so that plotting
    outputs are attached as artifacts.
  • New modules, add the module to CODEOWNERS with your github handle
  • Add the yellow ready for review label when you are ready for the PR to be reviewed.

@crotwell crotwell added the build_docs Docs will be automatically built and deployed in github actions on pushes to the PR label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build_docs Docs will be automatically built and deployed in github actions on pushes to the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant