Skip to content

Conversation

@Gautzilla
Copy link
Contributor

🐳 What's new?

This PR adds support for accessing MiniSEED data within the osekit ecosystem.

🐳 How does it work?

The metadata/data access is based on ObsPy.

The osekit AudioFileManager has been tweaked so that reading .mseed info/data use ObsPy rather than soundlib.

As ObsPy doesn't access data lazily with frame indexes, the AudioFileManager loads the entire file data and returns the requested frames afterwards.

🐳 Note

The MiniSEED data seems to be stored as large integer values (at least, that is the case with the OOI dataset). Hence, I'd recommend normalizing the data with Normalization.PEAK to get it back into the WAV data [0.,1.] range.

resolve #282

@Gautzilla Gautzilla self-assigned this Sep 24, 2025
@Gautzilla Gautzilla added the data format Work related to spectrogram/audio format and how to process it label Sep 24, 2025
@Gautzilla
Copy link
Contributor Author

I'm still trying to figure out a way of creating small mseed files on the fly for adding the feature to the test suite.
Aside from that, the feature can be tested if you want to!

@mathieudpnt mathieudpnt removed their request for review September 25, 2025 06:34
@Gautzilla Gautzilla marked this pull request as ready for review September 25, 2025 09:26
@mathieudpnt mathieudpnt removed their request for review September 25, 2025 09:38
@mathieudpnt
Copy link
Contributor

I think @cazaudo is better suited to review this PR.

cazaudo
cazaudo previously approved these changes Dec 18, 2025
@Gautzilla
Copy link
Contributor Author

Note for 2026:

I tried to isolate the obspy-dependent part to keep basic users from the obspy/windows hell.

I still have some tests that don't pass: maybe it is because i changed the data returned by get_data() to a 2D array?

I'll have to look back at it in january!

@Gautzilla Gautzilla requested a review from cazaudo January 5, 2026 14:56
@Gautzilla
Copy link
Contributor Author

@cazaudo I had to rework this PR since ObSpy was impossible to install back on my PC (I don't even know how I proceeded to do so in september).

I switched the obspy dependency to an optional dependency, which has to be specificaly declared when installing osekit (see the updated doc on Acoustock).

Then, I refactored a bit the audio module (see the new audio_backend module) so that a new AudioBackend class redirects the audio backend to either the SoundFile backend (which relies on soundfile and manages classic audio formats) or the MseedBackend which manages MSEED files and checks wether the obspy package has been installed.

I'm really not familiar enough with the mseed format to know if the file reading is correct in edge cases (I'm not sure how traces should work), so I come back to you to see if everything works as intended!

@Gautzilla Gautzilla dismissed cazaudo’s stale review January 5, 2026 15:41

The branch still needed a redesign after the first approval

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

Labels

data format Work related to spectrogram/audio format and how to process it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the audio reader compatible with .mseed files ?

3 participants