VLBI Base

Routines on which the readers and writers for specific VLBI formats are based.

Reference/API

baseband.vlbi_base Package

baseband.vlbi_base.header Module

Base definitions for VLBI Headers, used for VDIF and Mark 5B.

Defines a header class VLBIHeaderBase that can be used to hold the words corresponding to a frame header, providing access to the values encoded in via a dict-like interface. Definitions for headers are constructed using the HeaderParser class.

Functions

make_parser(word_index, bit_index, bit_length)

Construct a function that converts specific bits from a header.

make_setter(word_index, bit_index, bit_length)

Construct a function that uses a value to set specific bits in a header.

get_default(word_index, bit_index, bit_length)

Return the default value from a header keyword.

Classes

fixedvalue(fget[, doc, lazy])

Property that is fixed for all instances of a class.

ParserDict(method[, name, doc])

Create a lazily evaluated dictionary of parsers, setters, or defaults.

HeaderParser(*args, **kwargs)

Parser & setter for VLBI header keywords.

VLBIHeaderBase(words[, verify])

Base class for all VLBI headers.

Class Inheritance Diagram

Inheritance diagram of baseband.vlbi_base.header.fixedvalue, baseband.vlbi_base.header.ParserDict, baseband.vlbi_base.header.HeaderParser, baseband.vlbi_base.header.VLBIHeaderBase

baseband.vlbi_base.payload Module

Base definitions for VLBI payloads, used for VDIF and Mark 5B.

Defines a payload class VLBIPayloadBase that can be used to hold the words corresponding to a frame payload, providing access to the values encoded in it as a numpy array.

Classes

VLBIPayloadBase(words[, sample_shape, bps, …])

Container for decoding and encoding VLBI payloads.

Class Inheritance Diagram

Inheritance diagram of baseband.vlbi_base.payload.VLBIPayloadBase

baseband.vlbi_base.frame Module

Base definitions for VLBI frames, used for VDIF and Mark 5B.

Defines a frame class VLBIFrameBase that can be used to hold a header and a payload, providing access to the values encoded in both.

Classes

VLBIFrameBase(header, payload[, valid, verify])

Representation of a VLBI data frame, consisting of a header and payload.

Class Inheritance Diagram

Inheritance diagram of baseband.vlbi_base.frame.VLBIFrameBase

baseband.vlbi_base.base Module

Functions

make_opener(fmt, classes[, doc, append_doc])

Create a baseband file opener.

Classes

HeaderNotFoundError

Error in finding a header in a stream.

VLBIFileBase(fh_raw)

VLBI file wrapper, used to add frame methods to a binary data file.

VLBIFileReaderBase(fh_raw)

VLBI wrapped file reader base class.

VLBIStreamBase(fh_raw, header0, sample_rate, …)

VLBI file wrapper, allowing access as a stream of data.

VLBIStreamReaderBase(fh_raw, header0, …)

VLBIStreamWriterBase(fh_raw, header0, …)

Class Inheritance Diagram

Inheritance diagram of baseband.vlbi_base.base.HeaderNotFoundError, baseband.vlbi_base.base.VLBIFileBase, baseband.vlbi_base.base.VLBIFileReaderBase, baseband.vlbi_base.base.VLBIStreamBase, baseband.vlbi_base.base.VLBIStreamReaderBase, baseband.vlbi_base.base.VLBIStreamWriterBase

baseband.vlbi_base.file_info Module

Provide a base class for “info” properties.

Loosely based on DataInfo.

Classes

info_item(attr[, needs, default, doc, …])

Like a lazy property, evaluated only once.

VLBIInfoMeta(name, bases, dct)

VLBIInfoBase([parent])

Container providing a standardized interface to file information.

VLBIFileReaderInfo([parent])

Standardized information on file readers.

VLBIStreamReaderInfo([parent])

Standardized information on stream readers.

Class Inheritance Diagram

Inheritance diagram of baseband.vlbi_base.file_info.info_item, baseband.vlbi_base.file_info.VLBIInfoMeta, baseband.vlbi_base.file_info.VLBIInfoBase, baseband.vlbi_base.file_info.VLBIFileReaderInfo, baseband.vlbi_base.file_info.VLBIStreamReaderInfo

baseband.vlbi_base.encoding Module

Encoders and decoders for generic VLBI data formats.

Functions

encode_1bit_base(values)

Generic encoder for data stored using one bit.

encode_2bit_base(values)

Generic encoder for data stored using two bits.

encode_4bit_base(values)

Generic encoder for data stored using four bits.

decode_8bit(words)

Generic decoder for data stored using 8 bits.

encode_8bit(values)

Encode 8 bit VDIF data.

Variables

OPTIMAL_2BIT_HIGH

Optimal high value for a 2-bit digitizer for which the low value is 1.

TWO_BIT_1_SIGMA

Optimal level between low and high for the above OPTIMAL_2BIT_HIGH.

FOUR_BIT_1_SIGMA

Scaling for four-bit encoding that makes it look like 2 bit.

EIGHT_BIT_1_SIGMA

Scaling for eight-bit encoding that makes it look like 2 bit.

decoder_levels

Levels for data encoded with different numbers of bits..

baseband.vlbi_base.utils Module

Functions

lcm(a, b)

Calculate the least common multiple of a and b.

bcd_decode(value)

bcd_encode(value)

byte_array(pattern)

Convert the pattern to a byte array.

Classes

CRC(polynomial)

Cyclic Redundancy Check.

CRCStack(polynomial)

Cyclic Redundancy Check for a bitstream.

Class Inheritance Diagram

Inheritance diagram of baseband.vlbi_base.utils.CRC, baseband.vlbi_base.utils.CRCStack