GSBFileReader¶
-
class
baseband.gsb.base.
GSBFileReader
(fh_raw, payload_nbytes, nchan=1, bps=4, complex_data=False)[source] [edit on github]¶ Bases:
baseband.vlbi_base.base.VLBIFileBase
Simple reader for GSB data files.
Wraps a binary filehandle, providing a
read_payload
method to help interpret the data.- Parameters
- payload_nbytesint
Number of bytes to read.
- nchanint, optional
Number of channels. Default: 1.
- bpsint, optional
Bits per elementary sample, i.e. per real or imaginary component for complex data. Default: 4.
- complex_databool, optional
Whether data are complex. Default:
False
.
Methods Summary
close
(self)read_payload
(self)Read a single block.
temporary_offset
(self)Context manager for temporarily seeking to another file position.
Methods Documentation
-
close
(self) [edit on github]¶
-
read_payload
(self)[source] [edit on github]¶ Read a single block.
- Returns
- frame
GSBPayload
With a
.data
property that returns the data encoded.
- frame
-
temporary_offset
(self) [edit on github]¶ Context manager for temporarily seeking to another file position.
To be used as part of a
with
statement: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.