miniseed filesize

Dear all

I have a question regarding the miniseed files and their size after working with them.

I read in the miniseed file, with the size of 17.296 KB

if I save it with:

st.write(“my_new_file”, format=“MSEED”) its size on disk is 12.820 KB

if I save it to SAC, its size is 67.501 KB

So 1st question. Why is mseed after writing it to the disk smaller then the original? For SAC it is clear, since it is using different encoding.

Next step was to remove the response of the station and changing from raw to DISP.

When I remove the response and save mseed to the disk, the size of mseed is 136.872 KB.

When I remove the response and save it as SAC, the size is still 67.501 KB

So, to the 2nd question:

Why is mseed with removed response so much bigger? And why is SAC after removing response the same size as before?



Not sure why writing the same data as miniseed is smaller, might be that
it's writing with a different record size that is more efficiently
compressing the data..

Doing manipulations (filter, instrument correction etc) leads to data
being converted to float, and miniseed storing float is much less
efficient than integer compression.

Not sure about SAC but I think it's stored without compression,
therefore the larger file size.


The first MiniSEED file might be smaller for a couple of reasons
(reading and writing MiniSEED with ObsPy should not change the record
length nor the encoding):

(i) The records might have been padded due to whatever reasons. ObsPy
would have removed the padding.
(ii) There might have been some blockettes and using `obspy.core` to
read and write MiniSEED does not retain all blockettes.
(iii) Maybe there were some noise/shadow records in the data? ObsPy also
removes those.

The second MiniSEED file is likely larger because the instrument
deconvolution converted the data to double precision floats. Otherwise
MiniSEED and SAC should be very similar in size as neither compresses
floating point data and the difference is only in headers and the fact
that MiniSEED is bound to its record size.

You can convert your data to single precision before writing it which
should result in a smaller MiniSEED file:

import numpy as np
for tr in st:

    = np.require(, dtype=np.float32)