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
CrsdConsistencyobjects should be instantiated usingfrom_fileorfrom_parts.- Parameters:
- crsd_xml
lxml.etree.Elementorlxml.etree.ElementTree CRSD XML
- file_type_header
str, optional File type header from the first line of the file
- kvp_list
dictof {strstr}, optional Key-Value pair list of header fields
- ppps
dictof {strndarray}, optional Per-Pulse-Parameters keyed by transmit sequence identifier
- pvps
dictof {strndarray}, optional Per-Vector-Parameters keyed by channel identifier
- support_arrays
dictof {strndarray}, optional Support arrays keyed by Support Array ID
- schema_override
path-like object, optional Path to XML Schema. If None, tries to find a version-specific schema
- file
file object, optional CRSD file; when specified, portions of the file not specified in other parameters may be read
- crsd_xml
Methods
add_cli_args(parser)Add CLI args used by
run_clito an argparserall()Returns all results.
assert_iac_matches_ecf(iac_coord, ecf_coord)Asserts that the IAC and ECF coordinates are a matched set
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_argsskips([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_schemaThe XML matches the schema.
check_ampsf_pvpAmpSF PVP is positive
check_ant_gain_phasePattern Gain and Phase are zero at 0, 0
check_ant_gp_extentAntenna GainPhase array does not go outside [-1, 1]
check_ant_gp_nanAntenna GainPhase array contains no NaN outside of NODATA
check_ant_gp_sizeAntenna GainPhase array is at least 2x2 in size
check_ant_pol_refAntPolRef is mathematically sound
check_block_orderData blocks are in the correct order and do not overlap
check_channel_imagearea_polygonCheck channel ImageArea Polygon
check_channel_signal_dataSignal array samples are valid and consistent with SIGNAL PVP.
check_classification_and_release_infoAsserts that the Classification and ReleaseInfo fields are the same in header KVP list and the xml.
check_compressed_signal_blockMetadata properly indicates signal arrays are stored in compressed format
check_dfic0_ficrateDFIC0 and FICRate match
check_dwell_array_coverageDwellTimeArrays cover SARImage ImageArea
check_end_of_file_at_last_blockLast block is at the end of the file.
check_error_cov_bistaticCovariance matrices are mathematically sound for Bistatic
check_error_cov_single_sensorCovariance matrices are mathematically sound for TxSensor, RcvSensor or Monostatic
check_error_mono_bistaticThe correct SARImage ErrorParameters branch is used
check_eventnameTransmit and receive event names are the same for monostatic SAR
check_extendedarea_contains_imageareaExtended image area contains the image area.
check_f0refF0Ref matches reference vector RefFreq PVP
check_file_type_headerFile type header is consistent with the XML.
check_frcvfixedFrcvFixed boolean matches PVPs
check_frcvminmaxFrcvMin and FrcvMax are sane and match the PVPs
check_fx12_pppFX1 less than FX2
check_fxfreq0FxFreq0 PPP is positive
check_fxrateFxRate PPP is zero when TxWFType is XM
check_fxresponseindexFxResponseIndex PPP refers to an extant row of the FxResponseArray
check_geoinfo_polygonsGeoInfo polygons are simple polygons in clockwise order.
check_global_frcvminmaxGlobal FrcvMin and FrcvMax match Channels
check_global_fxminmaxGlobal FxMin and FxMax match TxSequences
check_global_rcvstarttime12Global RcvStartTime1 and RcvStartTime2 match Channels
check_global_txtime12Global TxTime1 and TxTime2 match TxSequences
check_header_kvp_listAsserts that the required keys are in the header KVP list.
check_iacpIACPs are reasonable
check_imagegridSceneCoordinates/ImageGrid is consistent with ImageArea
check_inst_osrReceive oversample of instantaneous bandwidth
check_maxxmbwCheck that the oversample ratio of each XMArray is sufficient
check_ns_fxrCheck that each FxResponseArray has at least 3 columns
check_numacfsACFs are properly counted
check_numapatsAPATs are properly counted
check_numapcsAPCs are properly counted
check_numbytespppNumBytesPPP matches PPP data structure
check_numbytespvpNumBytesPVP matches PVP data structure
check_numcodtimesCODTime polynomials are properly counted
check_numcrsdchannelsChannels are properly counted
check_numdwelltimesDwellTime polynomials are properly counted
check_numsupportarraysSupportArrays are properly counted
check_numtxsequencesTransmit sequences are properly counted
check_pad_before_binary_blocksPad before binary blocks is null bytes
check_phix0_intfracPhiX0 PPP is properly formatted as int-frac
check_post_header_section_terminator_and_padSection terminator ends the header
check_post_xml_section_terminatorSection terminator is after the XML
check_ppp_block_size_and_packingPPP block is correctly sized and packed
check_ppp_min_offsetMinimum offset of any PPP is zero
check_ppp_unique_namesNames of PPPs are all unique
check_pvp_block_size_and_packingPVP block is correctly sized and packed
check_pvp_min_offsetMinimum offset of any PVP is zero
check_pvp_unique_namesNames of PVPs are all unique
check_rcv_acxyRcvACX and RcvACY PVPs are orthonormal
check_rcvebRcvEB composed of valid direction cosines
check_rcvpolarizationCheck the RcvPolarization with respect to HV
check_rcvposveltimeRcvPos, RcvVel, RcvStart seem normal
check_rcvrefpointRcvRefPoint IAC maps to ECF
check_rcvstartRcvStart PVP is increasing and properly formatted as int-frac
check_rcvstart12RcvStartTime1 and RcvStartTime2 are sane and match the PVPs
check_rcvstart_overlapRcvStart, Fs, and NumSamples do not describe overlapping receive windows
check_rcvstart_sampleRcvStart is an integer multiple of sample periods after the first in the channel
check_ref_pulse_indexRefPulseIndex refers to an extant pulse
check_ref_rad_intensityTxRefRadIntensity matches the PPP
check_reffreqfixedRefFreqFixed boolean matches PVP
check_refgeomThe ReferenceGeometry parameters are consistent with the other metadata
check_refphi0_intfracRefPhi0 PVP is properly formatted as int-frac
check_reftxidRefTxId equal to reference channel’s transmit pulse sequence
check_refvectorindexRefVectorIndex refers to an appropriate extant vector
check_refvectorpulseindexRefVectorPulseIndex is sane and matches PPP
check_sartxpolarizationCheck the SARImage TxPolarization with respect to HV
check_scene_extendedarea_polygonCheck SceneCoordinates/ExtendedArea/Polygon
check_scene_hae_axesHAE uIAX and uIAY are orthonormal in ECF and IAZ is upward
check_scene_iarpIARP is consistent and near Earth’s surface
check_scene_imagearea_polygonCheck SceneCoordinates/ImageArea/Polygon
check_scene_planar_axesPlanar uIAX and uIAY are orthonormal and IAZ is upward
check_segment_listSegments are within the grid
check_sensornameTransmit and receive sensor names are the same for monostatic SAR
check_signal_block_size_and_packingSignal block is correctly sized and packed
check_signal_pvpSIGNAL PVP is in range
check_signalnormalSignalNormal boolean matches PVP
check_support_array_bytes_per_elementSupport array bytes per element matches the element type
check_support_array_nodataNODATA entries are the correct length for the ElementFormat
check_support_block_size_and_packingSupport block is correctly sized and packed
check_tx_acxyTxACX and TxACY PPPs are orthonormal
check_tx_frequency_bandFxC, FxBW and FxBWFixed match the PPPs
check_txebTxEB composed of valid direction cosines
check_txmt_minmaxTXmtMin and TXmtMax match the PPPs
check_txoverlapTxTime and TXmt do not lead to overlap
check_txpolarizationCheck the TxPolarization with respect to HV
check_txposveltimeTxPos, TxVel, TxTime seem normal
check_txpulseindex_pvpTxPulseIndex refers to an extant pulse or the ‘no pulse’ value
check_txrefpointTxRefPoint IAC maps to ECF
check_txtimeTxTime PPP is increasing and properly formatted as int-frac
check_txtime12TxTime1 and TxTime2 match the PPPs
check_xm_idXMId is appropriate
check_xm_pulse_lengthEach TXmt covers enough XM samples
check_xmindex_ppp_presenceXMIndex PPP is present if and only if TxWFType is not LFM
check_xmindex_valueXMIndex PPP refers to an extant row in the XMArray