VDIFPayload¶
-
class
baseband.vdif.
VDIFPayload
(words, header=None, 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.
- header
VDIFHeader
If given, used to infer the number of channels, bps, and whether the data are complex.
- nchanint, optional
Number of channels, used if
header
is not given. Default: 1.- bpsint, optional
Bits per elementary sample, used if
header
is not given. Default: 2.- complex_databool, optional
Whether the data are complex, used if
header
is not given. Default:False
.
- words
Attributes Summary
Full decoded payload.
Numeric type of the decoded data array.
Size of the payload in bytes.
Number of dimensions of the decoded data array.
Shape of the decoded data array.
Total number of component samples in the decoded data array.
Methods Summary
fromdata
(data[, header, bps, edv])Encode data as payload, using header information.
fromfile
(fh, header)Read payload from filehandle and decode it into data.
tofile
(self, 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, header=None, bps=2, edv=None)[source] [edit on github]¶ Encode data as payload, using header information.
- Parameters
- data
ndarray
Values to be encoded.
- header
VDIFHeader
, optional If given, used to infer the encoding, and to verify the number of channels and whether the data are complex.
- bpsint, optional
Bits per elementary sample, used if
header
is not given. Default: 2.- edvint, optional
Should be given if
header
is not given and the payload is encoded as Mark 5 data (i.e.,edv=0xab
).
- data
-
classmethod
fromfile
(fh, header)[source] [edit on github]¶ Read payload from filehandle and decode it into data.
- Parameters
- fhfilehandle
To read data from.
- header
VDIFHeader
Used to infer the payload size, number of channels, bits per sample, and whether the data are complex.
-
tofile
(self, fh) [edit on github]¶ Write payload to filehandle.