obspy.io.gse2.libgse2.write

write(headdict, data, f, inplace=False)[source]

Write GSE2 file, given the header and data.

Currently supports only CM6 compressed GSE2 files, this should be sufficient for most cases. Data are in circular frequency counts, for correction of calper multiply by 2PI and calper: data * 2 * pi * header[‘calper’].

Warning: The data are actually compressed in place for performance issues, if you still want to use the data afterwards use data.copy()

Note:

headdict dictionary entries C{‘datatype’, ‘n_samps’, ‘samp_rate’} are absolutely necessary

Parameters:
  • data (numpy.ndarray, dtype=int32) – Contains the data.

  • f (file) – Open file pointer of GSE2 file to write, opened in binary mode, e.g. f = open(‘myfile’,’wb’)

  • inplace (bool) – If True, do compression not on a copy of the data but on the data itself — note this will change the data values and make them therefore unusable

  • headdict (dict) – ObsPy Header