GUPPIFileWriter

class baseband.guppi.base.GUPPIFileWriter(fh_raw)[source] [edit on github]

Bases: baseband.vlbi_base.base.VLBIFileBase

Simple writer/mapper for GUPPI files.

Adds write_frame and memmap_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 : GUPPIHeader

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: GUPPIFrame

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:

data : ndarray or GUPPIFrame

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 GUPPI frame.

header : GUPPIHeader

Can instead give keyword arguments to construct a header. Ignored if data is a GUPPIFrame instance.

**kwargs

If header is not given, these are used to initialize one.