obspy.io.segy.segy.SEGYFile._read_traces

SEGYFile._read_traces(unpack_headers=False, headonly=False, yield_each_trace=False)[source]

Reads the actual traces starting at the current file pointer position to the end of the file.

Parameters:
  • unpack_headers (bool) Determines whether or not all headers will be unpacked during reading the file. Has a huge impact on the memory usage and the performance. They can be unpacked on-the-fly after being read. Defaults to False.
  • headonly (bool) Determines whether or not the actual data records will be read and unpacked. Has a huge impact on memory usage. Data can be read and unpacked on-the-fly after reading the file. Defaults to False.
  • yield_each_trace (bool) If True, it will yield each trace after it has been read. This enables a simple implementation of a streaming interface to read SEG-Y files. Read traces will no longer be collected in self.traces list if this is set to True.