HDF5StreamWriter

class baseband_tasks.io.hdf5.base.HDF5StreamWriter(fh_raw, header0=None, template=None, **kwargs)[source] [edit on github]

Bases: baseband_tasks.io.hdf5.base.HDF5StreamBase, baseband.base.base.StreamWriterBase

Attributes Summary

bps

Bits per elementary sample.

closed

complex_data

Whether the data are complex.

dtype

frequency

header0

First header of the file.

polarization

sample_rate

Number of complete samples per second.

sample_shape

Shape of a complete sample (possibly subset or squeezed).

samples_per_frame

Number of complete samples per frame.

shape

sideband

squeeze

Whether data arrays have dimensions with length unity removed.

start_time

Start time of the file.

time

Time of the sample pointer's current offset in file.

Methods Summary

close()

tell([unit])

Current offset in the file.

write(data[, valid])

Write data, buffering by frames as needed.

Attributes Documentation

bps

Bits per elementary sample.

Only available if the HDF5 payload is encoded.

closed
complex_data

Whether the data are complex.

dtype
frequency
header0

First header of the file.

polarization
sample_rate

Number of complete samples per second.

sample_shape

Shape of a complete sample (possibly subset or squeezed).

samples_per_frame

Number of complete samples per frame.

shape
sideband
squeeze

Whether data arrays have dimensions with length unity removed.

If True, data read out has such dimensions removed, and data passed in for writing has them inserted.

start_time

Start time of the file.

See also time for the time of the sample pointer’s current offset.

time

Time of the sample pointer’s current offset in file.

See also start_time for the start time of the file.

Methods Documentation

close() [edit on github]
tell(unit=None) [edit on github]

Current offset in the file.

Parameters
unitUnit or str, optional

Time unit the offset should be returned in. By default, no unit is used, i.e., an integer enumerating samples is returned. For the special string ‘time’, the absolute time is calculated.

Returns
offsetint, Quantity, or Time

Offset in current file (or time at current position).

write(data, valid=True) [edit on github]

Write data, buffering by frames as needed.

Parameters
datandarray

Piece of data to be written, with sample dimensions as given by sample_shape. This should be properly scaled to make best use of the dynamic range delivered by the encoding.

validbool, optional

Whether the current data are valid. Default: True.