VLBIStreamReaderInfo¶
-
class
baseband.vlbi_base.file_info.
VLBIStreamReaderInfo
(parent=None)[source] [edit on github]¶ Bases:
baseband.vlbi_base.file_info.VLBIInfoBase
Standardized information on stream readers.
The
info
descriptor provides a few standard attributes, most of which can also be accessed directly on the stream filehandle, and tests basic readability of the stream. More detailed information on the underlying file is stored in its info, accessible viainfo.file_info
(and shown by__repr__
).- Attributes
- start_time
Time
Time of the first complete sample.
- stop_time
Time
Time of the complete sample just beyond the end of the file.
- sample_rate
Quantity
Complete samples per unit of time.
- shapetuple
Equivalent shape of the whole file, i.e., combining the number of complete samples and the shape of those samples.
- bpsint
Number of bits used to encode each elementary sample.
- complex_databool
Whether the data are complex.
- verifybool or str
The type of verification done by the stream reader.
- readablebool
Whether the first and last samples could be read and decoded.
- checksdict
Checks that were done to determine whether the file was readable (normally ‘continuous’ and ‘decodable’).
- errorsdict
Any exceptions raised while trying to determine attributes or doing checks. Keyed by the attributes/checks.
- warningsdict
Any warnings about the attributes or about the checks. Keyed by the attributes/checks.
- start_time
Attributes Summary
Attributes that the container provides.
Link to parent.bps
Link to file_info.checks
Link to parent.complex_data
Check the stream is continuous.
Link to file_info.errors
Information from the underlying file reader.
Format of the underlying file.
Whether the stream can be read (possibly fixing errors).
Link to parent.sample_rate
Link to parent.shape
Link to parent.start_time
Link to parent.stop_time
Link to parent.verify
Link to file_info.warnings
Methods Summary
__call__
(self)Create a dict with information about the stream and the raw file.
Attributes Documentation
-
attr_names
= ('start_time', 'stop_time', 'sample_rate', 'shape', 'format', 'bps', 'complex_data', 'verify', 'readable', 'checks', 'errors', 'warnings')¶ Attributes that the container provides.
-
bps
¶ Link to parent.bps
-
checks
¶ Link to file_info.checks
-
complex_data
¶ Link to parent.complex_data
-
continuous
[source]¶ Check the stream is continuous.
Tries reading the very end. If there is a problem, will bisect to find the exact offset at which the problem occurs.
Errors are raised only to the extent verification is done. Hence, if the stream was opened with
verify=False
, many fewer problems will be found, while if it was opened withverify='fix'
, then for file types that support it, one will get warnings rather than exceptions (if the errors are fixable, of course).
-
errors
¶ Link to file_info.errors
-
sample_rate
¶ Link to parent.sample_rate
-
shape
¶ Link to parent.shape
-
start_time
¶ Link to parent.start_time
-
stop_time
¶ Link to parent.stop_time
-
verify
¶ Link to parent.verify
-
warnings
¶ Link to file_info.warnings
Methods Documentation
-
__call__
(self)[source] [edit on github]¶ Create a dict with information about the stream and the raw file.