DADAFileWriter¶
-
class
baseband.dada.base.
DADAFileWriter
(fh_raw)[source] [edit on github]¶ Bases:
baseband.vlbi_base.base.VLBIFileBase
Simple writer/mapper for DADA files.
Adds
write_frame
andmemmap_frame
methods to the VLBI binary file wrapper. The latter allows one to encode data in pieces, writing to disk as needed.Methods Summary
close
()memmap_frame
([header])Get frame by writing the header to disk and mapping its payload. write_frame
(data[, header])Write a single frame (header plus payload). Methods Documentation
-
close
() [edit on github]¶
-
memmap_frame
(header=None, **kwargs)[source] [edit on github]¶ Get frame by writing the header to disk and mapping its payload.
The header is written to disk immediately, but the payload is mapped, so that it can be filled in pieces, by setting slices of the frame.
Parameters: header :
DADAHeader
Written to disk immediately. Can instead give keyword arguments to construct a header.
**kwargs
If
header
is not given, these are used to initialize one.Returns: frame:
DADAFrame
By assigning slices to data, the payload can be encoded piecewise.
-
write_frame
(data, header=None, **kwargs)[source] [edit on github]¶ Write a single frame (header plus payload).
Parameters: If an array, a
header
should be given, which will be used to get the information needed to encode the array, and to construct the DADA frame.header :
DADAHeader
Can instead give keyword arguments to construct a header. Ignored if
data
is aDADAFrame
instance.**kwargs
If
header
is not given, these are used to initialize one.
-