VDIFFileReaderInfo

class baseband.vdif.file_info.VDIFFileReaderInfo(parent=None)[source] [edit on github]

Bases: FileReaderInfo

Attributes Summary

attr_names

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.

decodable

Whether decoding the first frame worked.

edv

Extended data version (False if legacy).

errors

dict of attributes that raised errors.

format

The file format.

frame0

First frame from the file.

frame_rate

Number of frames per unit time.

header0

Like a lazy property, evaluated only once.

missing

dict of missing attributes.

number_of_frames

Total number of frames.

number_of_framesets

Like a lazy property, evaluated only once.

readable

Whether the file is readable and decodable.

sample_rate

Rate of complete samples per unit time.

sample_shape

Like a lazy property, evaluated only once.

samples_per_frame

Number of complete samples in each frame.

start_time

Like a lazy property, evaluated only once.

thread_ids

Like a lazy property, evaluated only once.

warnings

dict of attributes that gave warnings.

Methods Summary

__call__()

Create a dict with file information.

Attributes Documentation

attr_names = ('format', 'edv', 'number_of_frames', 'thread_ids', 'number_of_framesets', '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.

decodable

Whether decoding the first frame worked.

edv

Extended data version (False if legacy).

errors

dict of attributes that raised errors.

format

The file format.

frame0

First frame from the file.

frame_rate

Number of frames per unit time.

header0

Like a lazy property, evaluated only once.

Can be used as a decorator.

It replaces itself with the evaluation of the function, i.e., it is not a data descriptor.

Any errors encountered during the evaluation are stored in the instances errors dict.

Parameters:
attrstr or callable, optional

If a string, assumes we will get that attribute from needs. If a callable, it will be called with the instance as its argument to calculate the value (i.e., it will behave like a property). If attr is not given, its is set after the fact by applying the instance to a function (i.e., using it as a decorator), or by defining it as an attribute of a class.

needsstr or tuple of str

The attributes that need to be present to get or calculate attr. If attr is a string, this should be where the attribute should be gotten from (e.g., ‘header0’ or ‘_parent’); if not given, the attribute will simply be set to default.

defaultvalue, optional

The value to return if the needs are not met. Default: None.

docstr, optional

Docstring of the descriptor. If not given will be taken from attr if a function, otherwise constructed. (Hard to access from within python, but useful for sphinx documentation.)

missingstr, optional

If the value could be calculated or retrieved, but is None, then add this string to the missing attribute of the instance. Used, e.g., for Mark 5B to give a helpful message if bps is not found on the file reader instance.

copybool

Whether the copy the value if it is retrieved. This can be useful, e.g., if the value is expected to be a dict and an independent copy should be made.

missing

dict of missing attributes.

number_of_frames

Total number of frames.

number_of_framesets

Like a lazy property, evaluated only once.

Can be used as a decorator.

It replaces itself with the evaluation of the function, i.e., it is not a data descriptor.

Any errors encountered during the evaluation are stored in the instances errors dict.

Parameters:
attrstr or callable, optional

If a string, assumes we will get that attribute from needs. If a callable, it will be called with the instance as its argument to calculate the value (i.e., it will behave like a property). If attr is not given, its is set after the fact by applying the instance to a function (i.e., using it as a decorator), or by defining it as an attribute of a class.

needsstr or tuple of str

The attributes that need to be present to get or calculate attr. If attr is a string, this should be where the attribute should be gotten from (e.g., ‘header0’ or ‘_parent’); if not given, the attribute will simply be set to default.

defaultvalue, optional

The value to return if the needs are not met. Default: None.

docstr, optional

Docstring of the descriptor. If not given will be taken from attr if a function, otherwise constructed. (Hard to access from within python, but useful for sphinx documentation.)

missingstr, optional

If the value could be calculated or retrieved, but is None, then add this string to the missing attribute of the instance. Used, e.g., for Mark 5B to give a helpful message if bps is not found on the file reader instance.

copybool

Whether the copy the value if it is retrieved. This can be useful, e.g., if the value is expected to be a dict and an independent copy should be made.

readable

Whether the file is readable and decodable.

sample_rate

Rate of complete samples per unit time.

sample_shape

Like a lazy property, evaluated only once.

Can be used as a decorator.

It replaces itself with the evaluation of the function, i.e., it is not a data descriptor.

Any errors encountered during the evaluation are stored in the instances errors dict.

Parameters:
attrstr or callable, optional

If a string, assumes we will get that attribute from needs. If a callable, it will be called with the instance as its argument to calculate the value (i.e., it will behave like a property). If attr is not given, its is set after the fact by applying the instance to a function (i.e., using it as a decorator), or by defining it as an attribute of a class.

needsstr or tuple of str

The attributes that need to be present to get or calculate attr. If attr is a string, this should be where the attribute should be gotten from (e.g., ‘header0’ or ‘_parent’); if not given, the attribute will simply be set to default.

defaultvalue, optional

The value to return if the needs are not met. Default: None.

docstr, optional

Docstring of the descriptor. If not given will be taken from attr if a function, otherwise constructed. (Hard to access from within python, but useful for sphinx documentation.)

missingstr, optional

If the value could be calculated or retrieved, but is None, then add this string to the missing attribute of the instance. Used, e.g., for Mark 5B to give a helpful message if bps is not found on the file reader instance.

copybool

Whether the copy the value if it is retrieved. This can be useful, e.g., if the value is expected to be a dict and an independent copy should be made.

samples_per_frame

Number of complete samples in each frame.

start_time

Like a lazy property, evaluated only once.

Can be used as a decorator.

It replaces itself with the evaluation of the function, i.e., it is not a data descriptor.

Any errors encountered during the evaluation are stored in the instances errors dict.

Parameters:
attrstr or callable, optional

If a string, assumes we will get that attribute from needs. If a callable, it will be called with the instance as its argument to calculate the value (i.e., it will behave like a property). If attr is not given, its is set after the fact by applying the instance to a function (i.e., using it as a decorator), or by defining it as an attribute of a class.

needsstr or tuple of str

The attributes that need to be present to get or calculate attr. If attr is a string, this should be where the attribute should be gotten from (e.g., ‘header0’ or ‘_parent’); if not given, the attribute will simply be set to default.

defaultvalue, optional

The value to return if the needs are not met. Default: None.

docstr, optional

Docstring of the descriptor. If not given will be taken from attr if a function, otherwise constructed. (Hard to access from within python, but useful for sphinx documentation.)

missingstr, optional

If the value could be calculated or retrieved, but is None, then add this string to the missing attribute of the instance. Used, e.g., for Mark 5B to give a helpful message if bps is not found on the file reader instance.

copybool

Whether the copy the value if it is retrieved. This can be useful, e.g., if the value is expected to be a dict and an independent copy should be made.

thread_ids

Like a lazy property, evaluated only once.

Can be used as a decorator.

It replaces itself with the evaluation of the function, i.e., it is not a data descriptor.

Any errors encountered during the evaluation are stored in the instances errors dict.

Parameters:
attrstr or callable, optional

If a string, assumes we will get that attribute from needs. If a callable, it will be called with the instance as its argument to calculate the value (i.e., it will behave like a property). If attr is not given, its is set after the fact by applying the instance to a function (i.e., using it as a decorator), or by defining it as an attribute of a class.

needsstr or tuple of str

The attributes that need to be present to get or calculate attr. If attr is a string, this should be where the attribute should be gotten from (e.g., ‘header0’ or ‘_parent’); if not given, the attribute will simply be set to default.

defaultvalue, optional

The value to return if the needs are not met. Default: None.

docstr, optional

Docstring of the descriptor. If not given will be taken from attr if a function, otherwise constructed. (Hard to access from within python, but useful for sphinx documentation.)

missingstr, optional

If the value could be calculated or retrieved, but is None, then add this string to the missing attribute of the instance. Used, e.g., for Mark 5B to give a helpful message if bps is not found on the file reader instance.

copybool

Whether the copy the value if it is retrieved. This can be useful, e.g., if the value is expected to be a dict and an independent copy should be made.

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.