Skip to content

Instantly share code, notes, and snippets.

@jpvantassel
Created January 5, 2022 14:22
Show Gist options
  • Save jpvantassel/bebf146dadf90444ef8830063fce1985 to your computer and use it in GitHub Desktop.
Save jpvantassel/bebf146dadf90444ef8830063fce1985 to your computer and use it in GitHub Desktop.
Combine Three One-Component Miniseed Files to a Single Three-Component File
import obspy
input_fnames = [f"AA.STN01.HN{c}.mseed" for c in list("ENZ")]
output_fname = "combined.mseed"
traces = []
for file in input_fnames:
stream = obspy.read(file)
traces.append(stream[0])
combined = obspy.Stream(traces)
combined.write(output_fname, format="MSEED")
@Adnan-Barkat
Copy link

How about multiple files?

@jpvantassel
Copy link
Author

Hi @Adnan-Barkat,
This is gist is just to combine three, one-component miniSEED files to a single three-component miniSEED file.
All the best,
Joe

@Adnan-Barkat
Copy link

Thanks

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