pisces.io.readwaveform#

Home to read_waveform and all format-specific reading functions.

pisces.io.readwaveform.numpy_read(DATAFILE, BYTEOFFSET, NUM, PERMISSION, DTYPE)[source]#

Read NumPy-compatible binary data.

Modeled after MatSeis function read_file in util/waveread.m.

pisces.io.readwaveform.read_s3(DATAFILE, BYTEOFFSET, NUM)[source]#

Read signed big-endian 3-byte integers into a 4-byte native NumPy array.

pisces.io.readwaveform.read_seed(DATAFILE, BYTEOFFSET=0, NUM=None)[source]#

Read a SEED or miniSEED ‘sd’ datatype.

pisces.io.readwaveform.read_waveform(DATAFILE, DATATYPE, BYTEOFFSET, NUM)[source]#

Read a data vector of a certain data type.

Parameters:
DATAFILEstring

Path and name of data file.

DATATYPEstring
{‘f4’, ‘i1’, ‘i2’, ‘i4’, ‘p4’, ‘t8’, ‘s2’, ‘p8’, ‘s4’, ‘f8’, ‘u4’, ‘t4’,

‘s1’, ‘sd’, ‘e1’, ‘sc’, ‘sy’}

Data type string (from wfdisc.datatype). ‘sd’, ‘sc’, and ‘sy’ are SEED/miniSEED, SAC, and SEGY ‘e1’ requires installation of the “e1” python module.

BYTEOFFSETint

Number of bytes from beginning of file.

NUMint

Number of samples to read.

Returns:
datanumpy.array

Vector of NUM samples of type DATATYPE.

Raises:
ValueError

Unrecognized DATATYPE.

IOError

DATAFILE does not exist.

Notes

If the file has a header and you want it, you’ll have to read it manually with obspy.core.read or something else.