Mark5BPayload

class baseband.mark5b.payload.Mark5BPayload(words, nchan=1, bps=2, complex_data=False)[source] [edit on github]

Bases: baseband.vlbi_base.payload.VLBIPayloadBase

Container for decoding and encoding VDIF payloads.

Parameters:

words : ndarray

Array containg LSB unsigned words (with the right size) that encode the payload.

nchan : int, optional

Number of channels. Default: 1.

bps : int, optional

Bits per elementary sample. Default: 2.

Attributes Summary

data Full decoded payload.
dtype Numeric type of the decoded data array.
nbytes Size of the payload in bytes.
ndim Number of dimensions of the decoded data array.
shape Shape of the decoded data array.
size Total number of component samples in the decoded data array.

Methods Summary

fromdata(data[, bps]) Encode data as payload, using a given number of bits per sample.
fromfile(fh, *args, **kwargs) Read payload from filehandle and decode it into data.
tofile(fh) Write payload to filehandle.

Attributes Documentation

data

Full decoded payload.

dtype

Numeric type of the decoded data array.

nbytes

Size of the payload in bytes.

ndim

Number of dimensions of the decoded data array.

shape

Shape of the decoded data array.

size

Total number of component samples in the decoded data array.

Methods Documentation

classmethod fromdata(data, bps=2)[source] [edit on github]

Encode data as payload, using a given number of bits per sample.

It is assumed that the last dimension is the number of channels.

classmethod fromfile(fh, *args, **kwargs) [edit on github]

Read payload from filehandle and decode it into data.

Parameters:

fh : filehandle

From which data is read.

payload_nbytes : int

Number of bytes to read (default: as given in cls._nbytes).

Any other (keyword) arguments are passed on to the class initialiser.

tofile(fh) [edit on github]

Write payload to filehandle.