sarkit.verification.CrsdConsistency

class CrsdConsistency(crsd_xml, *, file_type_header=None, kvp_list=None, ppps=None, pvps=None, support_arrays=None, schema_override=None, file=None)

Check CRSD file structure and metadata for internal consistency

CrsdConsistency objects should be instantiated using from_file or from_parts.

Parameters:
crsd_xmllxml.etree.Element or lxml.etree.ElementTree

CRSD XML

file_type_headerstr, optional

File type header from the first line of the file

kvp_listdict of {strstr}, optional

Key-Value pair list of header fields

pppsdict of {strndarray}, optional

Per-Pulse-Parameters keyed by transmit sequence identifier

pvpsdict of {strndarray}, optional

Per-Vector-Parameters keyed by channel identifier

support_arraysdict of {strndarray}, optional

Support arrays keyed by Support Array ID

schema_overridepath-like object, optional

Path to XML Schema. If None, tries to find a version-specific schema

filefile object, optional

CRSD file; when specified, portions of the file not specified in other parameters may be read

Methods

add_cli_args(parser)

Add CLI args used by run_cli to an argparser

all()

Returns all results.

assert_iac_matches_ecf(iac_coord, ecf_coord)

Asserts that the IAC and ECF coordinates are a matched set

assert_symmetric_positive_semidefinite(...)

Assert argument is a symmetric, positive-semidefinite matrix

check([func_name, allow_prefix, ignore_patterns])

Run checks.

failures([omit_passed_sub])

Returns failure results.

from_file(file[, schema, thorough])

Create a CrsdConsistency object from a file

from_parts(crsd_xml[, file_type_header, ...])

Create a CrsdConsistency object from assorted parts

iac_to_ecf(iac_coord)

Converts ImageAreaCoordinates to ECF

need([details])

Context manager for scoping 'Error' level checks

passes()

Returns passed checks that are not wholly No-Op.

precondition([details])

Context manager for scoping conditional ('No-Op' level) checks

print_result(*[, include_passed_asserts, ...])

Print results to stdout.

run_cli(config)

Run checks and print results using args from add_cli_args

skips([include_partial])

Returns passed checks that are No-Op.

verify_imagearea_polygon(polygon_node)

Verify that an image area polygon is reasonable

want([details])

Context manager for scoping 'Warning' level checks

Notes

The following checks are available:

check_against_schema

The XML matches the schema.

check_ampsf_pvp

AmpSF PVP is positive

check_ant_gain_phase

Pattern Gain and Phase are zero at 0, 0

check_ant_gp_extent

Antenna GainPhase array does not go outside [-1, 1]

check_ant_gp_nan

Antenna GainPhase array contains no NaN outside of NODATA

check_ant_gp_size

Antenna GainPhase array is at least 2x2 in size

check_ant_pol_ref

AntPolRef is mathematically sound

check_block_order

Data blocks are in the correct order and do not overlap

check_channel_imagearea_polygon

Check channel ImageArea Polygon

check_channel_signal_data

Signal array samples are valid and consistent with SIGNAL PVP.

check_classification_and_release_info

Asserts that the Classification and ReleaseInfo fields are the same in header KVP list and the xml.

check_compressed_signal_block

Metadata properly indicates signal arrays are stored in compressed format

check_dfic0_ficrate

DFIC0 and FICRate match

check_dwell_array_coverage

DwellTimeArrays cover SARImage ImageArea

check_end_of_file_at_last_block

Last block is at the end of the file.

check_error_cov_bistatic

Covariance matrices are mathematically sound for Bistatic

check_error_cov_single_sensor

Covariance matrices are mathematically sound for TxSensor, RcvSensor or Monostatic

check_error_mono_bistatic

The correct SARImage ErrorParameters branch is used

check_eventname

Transmit and receive event names are the same for monostatic SAR

check_extendedarea_contains_imagearea

Extended image area contains the image area.

check_f0ref

F0Ref matches reference vector RefFreq PVP

check_file_type_header

File type header is consistent with the XML.

check_frcvfixed

FrcvFixed boolean matches PVPs

check_frcvminmax

FrcvMin and FrcvMax are sane and match the PVPs

check_fx12_ppp

FX1 less than FX2

check_fxfreq0

FxFreq0 PPP is positive

check_fxrate

FxRate PPP is zero when TxWFType is XM

check_fxresponseindex

FxResponseIndex PPP refers to an extant row of the FxResponseArray

check_geoinfo_polygons

GeoInfo polygons are simple polygons in clockwise order.

check_global_frcvminmax

Global FrcvMin and FrcvMax match Channels

check_global_fxminmax

Global FxMin and FxMax match TxSequences

check_global_rcvstarttime12

Global RcvStartTime1 and RcvStartTime2 match Channels

check_global_txtime12

Global TxTime1 and TxTime2 match TxSequences

check_header_kvp_list

Asserts that the required keys are in the header KVP list.

check_iacp

IACPs are reasonable

check_imagegrid

SceneCoordinates/ImageGrid is consistent with ImageArea

check_inst_osr

Receive oversample of instantaneous bandwidth

check_maxxmbw

Check that the oversample ratio of each XMArray is sufficient

check_ns_fxr

Check that each FxResponseArray has at least 3 columns

check_numacfs

ACFs are properly counted

check_numapats

APATs are properly counted

check_numapcs

APCs are properly counted

check_numbytesppp

NumBytesPPP matches PPP data structure

check_numbytespvp

NumBytesPVP matches PVP data structure

check_numcodtimes

CODTime polynomials are properly counted

check_numcrsdchannels

Channels are properly counted

check_numdwelltimes

DwellTime polynomials are properly counted

check_numsupportarrays

SupportArrays are properly counted

check_numtxsequences

Transmit sequences are properly counted

check_pad_before_binary_blocks

Pad before binary blocks is null bytes

check_phix0_intfrac

PhiX0 PPP is properly formatted as int-frac

check_post_header_section_terminator_and_pad

Section terminator ends the header

check_post_xml_section_terminator

Section terminator is after the XML

check_ppp_block_size_and_packing

PPP block is correctly sized and packed

check_ppp_min_offset

Minimum offset of any PPP is zero

check_ppp_unique_names

Names of PPPs are all unique

check_pvp_block_size_and_packing

PVP block is correctly sized and packed

check_pvp_min_offset

Minimum offset of any PVP is zero

check_pvp_unique_names

Names of PVPs are all unique

check_rcv_acxy

RcvACX and RcvACY PVPs are orthonormal

check_rcveb

RcvEB composed of valid direction cosines

check_rcvpolarization

Check the RcvPolarization with respect to HV

check_rcvposveltime

RcvPos, RcvVel, RcvStart seem normal

check_rcvrefpoint

RcvRefPoint IAC maps to ECF

check_rcvstart

RcvStart PVP is increasing and properly formatted as int-frac

check_rcvstart12

RcvStartTime1 and RcvStartTime2 are sane and match the PVPs

check_rcvstart_overlap

RcvStart, Fs, and NumSamples do not describe overlapping receive windows

check_rcvstart_sample

RcvStart is an integer multiple of sample periods after the first in the channel

check_ref_pulse_index

RefPulseIndex refers to an extant pulse

check_ref_rad_intensity

TxRefRadIntensity matches the PPP

check_reffreqfixed

RefFreqFixed boolean matches PVP

check_refgeom

The ReferenceGeometry parameters are consistent with the other metadata

check_refphi0_intfrac

RefPhi0 PVP is properly formatted as int-frac

check_reftxid

RefTxId equal to reference channel’s transmit pulse sequence

check_refvectorindex

RefVectorIndex refers to an appropriate extant vector

check_refvectorpulseindex

RefVectorPulseIndex is sane and matches PPP

check_sartxpolarization

Check the SARImage TxPolarization with respect to HV

check_scene_extendedarea_polygon

Check SceneCoordinates/ExtendedArea/Polygon

check_scene_hae_axes

HAE uIAX and uIAY are orthonormal in ECF and IAZ is upward

check_scene_iarp

IARP is consistent and near Earth’s surface

check_scene_imagearea_polygon

Check SceneCoordinates/ImageArea/Polygon

check_scene_planar_axes

Planar uIAX and uIAY are orthonormal and IAZ is upward

check_segment_list

Segments are within the grid

check_sensorname

Transmit and receive sensor names are the same for monostatic SAR

check_signal_block_size_and_packing

Signal block is correctly sized and packed

check_signal_pvp

SIGNAL PVP is in range

check_signalnormal

SignalNormal boolean matches PVP

check_support_array_bytes_per_element

Support array bytes per element matches the element type

check_support_array_nodata

NODATA entries are the correct length for the ElementFormat

check_support_block_size_and_packing

Support block is correctly sized and packed

check_tx_acxy

TxACX and TxACY PPPs are orthonormal

check_tx_frequency_band

FxC, FxBW and FxBWFixed match the PPPs

check_txeb

TxEB composed of valid direction cosines

check_txmt_minmax

TXmtMin and TXmtMax match the PPPs

check_txoverlap

TxTime and TXmt do not lead to overlap

check_txpolarization

Check the TxPolarization with respect to HV

check_txposveltime

TxPos, TxVel, TxTime seem normal

check_txpulseindex_pvp

TxPulseIndex refers to an extant pulse or the ‘no pulse’ value

check_txrefpoint

TxRefPoint IAC maps to ECF

check_txtime

TxTime PPP is increasing and properly formatted as int-frac

check_txtime12

TxTime1 and TxTime2 match the PPPs

check_xm_id

XMId is appropriate

check_xm_pulse_length

Each TXmt covers enough XM samples

check_xmindex_ppp_presence

XMIndex PPP is present if and only if TxWFType is not LFM

check_xmindex_value

XMIndex PPP refers to an extant row in the XMArray