sarkit.cphd.Reader
- class Reader(file)
Read a CPHD file
A Reader object can be used as a context manager in a
withstatement. Attributes, but not methods, can be safely accessed outside of the context manager’s context.- Parameters:
- file
file object CPHD file to read
- file
- Attributes:
- metadata
Metadata CPHD metadata
- 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
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)