sarkit.cphd.Reader

class Reader(file)

Read a CPHD file

A Reader object can be used as a context manager in a with statement. Attributes, but not methods, can be safely accessed outside of the context manager’s context.

Parameters:
filefile object

CPHD file to read

Attributes:
metadataMetadata

CPHD metadata

Methods

done()

Indicates to the reader that the user is done with it

read_channel(channel_identifier, *[, ...])

Read signal and pvp data from a CPHD file channel

read_pvps(channel_identifier, *[, ...])

Read pvp data from a CPHD file

read_signal(channel_identifier, *[, ...])

Read signal data from a CPHD file

read_support_array(sa_identifier[, masked, out])

Read SupportArray

See also

Writer

Examples

>>> import sarkit.cphd as skcphd
>>> with file.open("rb") as f, skcphd.Reader(f) as r:
...     ch_id = r.metadata.xmltree.findtext("{*}Data/{*}Channel/{*}Identifier")
...     sig, pvp = r.read_channel(ch_id)
...     sa_id = r.metadata.xmltree.findtext("{*}Data/{*}SupportArray/{*}Identifier")
...     sa = r.read_support_array(sa_id)