Saves stream into a file.
Parameters: |
|
---|
Example
>>> from obspy import read
>>> st = read()
>>> st.write("example.mseed", format="MSEED")
Writing single traces into files with meaningful filenames can be done e.g. using trace.id
>>> for tr in st:
... tr.write(tr.id + ".MSEED", format="MSEED")
Supported Formats
Additional ObsPy modules extend the parameters of the write() method. The following table summarizes all known formats currently available for ObsPy.
Please refer to the Linked Function Call of each module for any extra options available.
Format | Required Module | Linked Function Call |
---|---|---|
MSEED | obspy.mseed | obspy.mseed.core.writeMSEED() |
SAC | obspy.sac | obspy.sac.core.writeSAC() |
GSE2 | obspy.gse2 | obspy.gse2.core.writeGSE2() |
SACXY | obspy.sac | obspy.sac.core.writeSACXY() |
Q | obspy.sh | obspy.sh.core.writeQ() |
SH_ASC | obspy.sh | obspy.sh.core.writeASC() |
SLIST | obspy.core | obspy.core.ascii.writeSLIST() |
TSPAIR | obspy.core | obspy.core.ascii.writeTSPAIR() |
SEGY | obspy.segy | obspy.segy.core.writeSEGY() |
SU | obspy.segy | obspy.segy.core.writeSU() |
WAV | obspy.wav | obspy.wav.core.writeWAV() |
PICKLE | obspy.core | obspy.core.stream.writePickle() |