FileReaderInfo¶
-
class
baseband.base.file_info.
FileReaderInfo
(parent=None)[source] [edit on github]¶ Bases:
baseband.base.file_info.InfoBase
Standardized information on file readers.
The
info
descriptor has a number of standard attributes, which are determined from arguments passed in opening the file, from the first header (info.header0
) and from possibly scanning the file to determine the duration of frames.Examples
The most common use is simply to print information:
>>> from baseband.data import SAMPLE_MARK5B >>> from baseband import mark5b >>> fh = mark5b.open(SAMPLE_MARK5B, 'rb') >>> fh.info Mark5BFile information: format = mark5b number_of_frames = 4 frame_rate = 6400.0 Hz bps = 2 complex_data = False readable = False missing: nchan: needed to determine sample shape, frame rate, ... kday, ref_time: needed to infer full times. >>> fh.close() >>> fh = mark5b.open(SAMPLE_MARK5B, 'rb', kday=56000, nchan=8) >>> fh.info Mark5BFile information: format = mark5b number_of_frames = 4 frame_rate = 6400.0 Hz sample_rate = 32.0 MHz samples_per_frame = 5000 sample_shape = (8,) bps = 2 complex_data = False start_time = 2014-06-13T05:30:01.000000000 readable = True checks: decodable: True >>> fh.close()
Attributes Summary
Attributes that the container provides.
Number of bits used to encode each elementary sample.
dict of checks for readability.
Whether parent is closed
Whether the data are complex.
Whether decoding the first frame worked.
dict of attributes that raised errors.
The file format.
First frame from the file.
Number of frames per unit time.
Header of the first frame in the file.
dict of missing attributes.
Total number of frames.
Whether the file is readable and decodable.
Rate of complete samples per unit time.
Shape of each complete sample (e.g.,
(nchan,)
).Number of complete samples in each frame.
Link to header0.time
dict of attributes that gave warnings.
Methods Summary
__call__
()Create a dict with file information.
Attributes Documentation
-
attr_names
= ('format', 'number_of_frames', 'frame_rate', 'sample_rate', 'samples_per_frame', 'sample_shape', 'bps', 'complex_data', 'start_time', 'readable', 'missing', 'checks', 'errors', 'warnings')¶ Attributes that the container provides.
-
bps
¶ Number of bits used to encode each elementary sample.
-
checks
¶ dict of checks for readability.
-
closed
¶ Whether parent is closed
-
complex_data
¶ Whether the data are complex.
-
errors
¶ dict of attributes that raised errors.
-
missing
¶ dict of missing attributes.
-
sample_shape
¶ Shape of each complete sample (e.g.,
(nchan,)
).
-
samples_per_frame
¶ Number of complete samples in each frame.
-
start_time
¶ Link to header0.time
-
warnings
¶ dict of attributes that gave warnings.
Methods Documentation
-
__call__
() [edit on github]¶ Create a dict with file information.
This includes information about checks done, possible missing information, as well as possible warnings and errors.
-