Compensated Phase History Data (sarkit.cphd)

Python reference implementations of the suite of NGA.STND.0068 standardization documents that define the Compensated Phase History Data (CPHD) format.

Supported Versions

Data Structure & File Format

FileHeaderPart(*[, additional_kvps])

CPHD header fields which are set per program specific Product Design Document

Metadata(*[, file_header_part])

Settable CPHD metadata

Reader(file)

Read a CPHD file

Writer(file, metadata)

Write a CPHD file

read_file_header(file)

Read a file header.

get_pvp_dtype(cphd_xmltree)

Get PVP dtype.

binary_format_string_to_dtype(format_string)

Return the numpy.dtype corresponding to a binary format string.

dtype_to_binary_format_string(dtype)

Return the binary format string corresponding to a numpy.dtype.

mask_support_array(array[, nodata_hex])

Apply a NODATA hex string to a support array to mask the array.

XML Metadata

XmlHelper(element_tree)

XmlHelper for CPHD

ElementWrapper(elem[, xsdhelper, ...])

ElementWrapper for CPHD that can set xsdhelper automatically.

XsdHelper(root_ns)

XsdHelper for CPHD

TxtType()

Transcoder for text (TXT) XML parameter types.

EnuType()

Transcoder for enumeration (ENU) XML parameter types.

BoolType()

Transcoder for boolean (BOOL) XML parameter types.

XdtType([force_utc])

Transcoder for XML dateTime (XDT) XML parameter types.

IntType()

Transcoder for integer (INT) XML parameter types.

DblType()

Transcoder for double-precision floating point (DBL) XML parameter types.

HexType()

Transcoder for HEX XML parameter types.

LineSampType([child_ns])

Transcoder for XML parameter types containing scalar Line and Sample components.

XyType([child_ns])

Transcoder for XML parameter types containing scalar X and Y components.

XyzType([child_ns])

Transcoder for XML parameter types containing scalar X, Y, and Z components.

LatLonType([child_ns])

Transcoder for XML parameter types containing scalar Lat and Lon components.

LatLonHaeType([child_ns])

Transcoder for XML parameter types containing scalar Lat, Lon, and HAE components.

PolyType(*[, child_ns])

Transcoder for one-dimensional polynomial (POLY) XML parameter types.

Poly2dType(*[, child_ns])

Transcoder for two-dimensional polynomial (2D_POLY) XML parameter types.

XyzPolyType([child_ns])

Transcoder for XYZ_POLY XML parameter types containing triplets of 1D polynomials.

PvpType()

Transcoder for per-vector parameter (PVP) XML parameter types.

AddedPvpType()

Transcoder for added per-vector parameter (APVP) XML parameter types.

ImageAreaCornerPointsType()

Transcoder for CPHD-like SceneCoordinates/ImageAreaCornerPoints XML parameter types.

ParameterType()

Transcoder for TXT XML parameter types with a required "name" attribute.

CPHD Signal Model

compute_t_ref(xmt, rcv, srp, txc, trc)

Compute the reference times for the given collection geometry parameters.

compute_t_ref_from_pvps(pvp_array)

Compute the reference times for each vector in a PVP array.

Scene Coordinates & Collection Geometry

Image Reference Surface

planar_ecf_to_iac(pt, iarp, uiax, uiay)

Convert from ECF coordinates to IAC coordinates for Surface Type = PLANAR

planar_iac_to_ecf(pt_iac, iarp, uiax, uiay)

Convert from IAC coordinates to ECF coordinates for Surface Type = PLANAR

hae_llh_to_iac(pt_llh, iarp_llh, uiax_ll, ...)

Convert from geodetic LLH coordinates to IAC coordinates for Surface Type = HAE

hae_iac_to_llh(pt_iac, iarp_llh, uiax_ll, ...)

Convert from IAC coordinates to geodetic LLH coordinates for Surface Type = HAE

Convenience functions that operate on parsed XML trees:

ecf_to_iac(cphd_xmltree, pt)

Convert from ECF coordinates to IAC coordinates

iac_to_ecf(cphd_xmltree, pt_iac)

Convert from IAC coordinates to ECF coordinates

llh_to_iac(cphd_xmltree, pt_llh)

Convert from geodetic LLH coordinates to IAC coordinates

iac_to_llh(cphd_xmltree, pt_iac)

Convert from IAC coordinates to geodetic LLH coordinates

Reference Geometry Parameters

compute_reference_geometry(cphd_xmltree, pvps)

Return a CPHD/ReferenceGeometry XML element containing parameters computed from other metadata.

Constants

VERSION_INFO

dict of {xml namespace: version-specific information}

DEFINED_HEADER_KEYS

set of KVP keys defined in the standard

SECTION_TERMINATOR

Two-byte sequence that marks the end of the file header

CLI Utilities

cphdinfo

Display information about CPHD files

usage: cphdinfo [-h] [--xml] [--channels] [--raw {XML,SUPPORT,PVP,SIGNAL}]
                filename
filename
-h, --help

show this help message and exit

--xml, -x

Extract XML formatted for display

--channels, -c

List channels

--raw {XML,SUPPORT,PVP,SIGNAL}

Extract raw bytes of a BLOCK

References

CPHD 1.0.1

[NGA.STND.0068-1_1.0.1_CPHD]

National Center for Geospatial Intelligence Standards, “Compensated Phase History Data (CPHD) Design & Implementation Description Document, Version 1.0.1”, 2018. https://nsgreg.nga.mil/doc/view?i=4638

[CPHD_schema_V1.0.1_2018_05_21.xsd]

National Center for Geospatial Intelligence Standards, “Compensated Phase History Data (CPHD) XML Schema, Version 1.0.1”, 2018. https://nsgreg.nga.mil/doc/view?i=4639

CPHD 1.1.0

[NGA.STND.0068-1_1.1.0_CPHD_2021-11-30]

National Center for Geospatial Intelligence Standards, “Compensated Phase History Data (CPHD) Design & Implementation Description Document, Version 1.1.0”, 2021. https://nsgreg.nga.mil/doc/view?i=5388

[CPHD_schema_V1.1.0_2021_11_30_FINAL.xsd]

National Center for Geospatial Intelligence Standards, “Compensated Phase History Data (CPHD) XML Schema, Version 1.1.0”, 2021. https://nsgreg.nga.mil/doc/view?i=5421