GSBFileWriter¶
-
class
baseband.gsb.base.GSBFileWriter(fh_raw)[source] [edit on github]¶ Bases:
baseband.base.base.FileBaseSimple writer for GSB data files.
Adds
write_payloadmethod to the basic binary file wrapper.Attributes Summary
Methods Summary
close()temporary_offset([offset, whence])Context manager for temporarily seeking to another file position.
write_payload(data[, bps])Write single data block.
Attributes Documentation
-
fh_raw= None¶
Methods Documentation
-
close() [edit on github]¶
-
temporary_offset(offset=None, whence=0) [edit on github]¶ Context manager for temporarily seeking to another file position.
To be used as part of a
withstatement:with fh_raw.temporary_offset() [as fh_raw]: with-block
On exiting the
with-block, the file pointer is moved back to its original position. As a convenience, one can pass on the offset to seek to when entering the context manager. Parameters are as forio.IOBase.seek().
-
write_payload(data, bps=4)[source] [edit on github]¶ Write single data block.
- Parameters
- data
ndarrayorGSBPayload If an array,
bpsneeds to be passed in.- bpsint, optional
Bits per elementary sample, to use when encoding the payload. Ignored if
datais a GSB payload. Default: 4.
- data
-