sarkit.verification.SiddConsistency
- class SiddConsistency(xml_trees, schema_override=None, file=None)
Check SIDD file structure and metadata for internal consistency
SiddConsistencyobjects should be instantiated usingfrom_fileorfrom_parts.- Parameters:
- xml_trees
lxml.etree.Elementorlxml.etree.ElementTree SIDD XML
- schema_override
path-like object, optional Path to XML Schema. If None, tries to find a version-specific schema
- file
file object, optional SIDD NITF file; when specified, NITF headers are extracted during object instantiation
- xml_trees
Methods
add_cli_args(parser)Add CLI args used by
run_clito an argparserall()Returns all results.
check([func_name, allow_prefix, ignore_patterns])Run checks.
failures([omit_passed_sub])Returns failure results.
from_file(file[, schema])Create a SiddConsistency object from a file
from_parts(xml_trees[, schema])Create a SiddConsistency object from assorted parts
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.
want([details])Context manager for scoping 'Warning' level checks
Notes
The following checks are available:
check_against_schemaThe XML matches the schema.
check_datetime_fields_are_utcDatetime fields should be followed by Z to indicate UTC.
check_display_antialias_filter_operationDisplay/…/(RRDS|Scaling)/AntiAlias/Operation is set correctly.
check_display_auto_dra_parametersDisplay/InteractiveProcessing/DynamicRangeAdjustment/DRAParameters included if AlgorithmType = AUTO.
check_display_dra_bandstatssourceDisplay/InteractiveProcessing/DynamicRangeAdjustment/BandStatsSource is a valid band index.
check_display_interpolation_filter_operationDisplay/…/(RRDS|Scaling)/Interpolation/Operation is set correctly.
check_display_none_dra_overridesDisplay/InteractiveProcessing/DynamicRangeAdjustment/DRAOverrides excluded if AlgorithmType = NONE.
check_display_numbandsDisplay/NumBands is consistent with Display/PixelType.
check_display_processing_bandsDisplay/[Non]InteractiveProcessing nodes are present for each band.
check_display_valid_dra_overridesDisplay/InteractiveProcessing/DynamicRangeAdjustment/DRAOverrides ∈ [0.0, 2047.0]
check_display_valid_dra_parametersDisplay/InteractiveProcessing/DynamicRangeAdjustment/DRAParameters: 0.0 <= min <= max <= 1.0
check_expfeatures_geometryExploitationFeatures geometry is consistent with Measurement parameters
check_geodata_image_cornersImage Corners are consistent with Measurement element.
check_measurement_productplane_unit_vectorsMeasurement/PlaneProjection/ProductPlane/(Row|Col)UnitVectors are unit-length and orthogonal
check_measurement_validdataMeasurement/ValidData is a simple convex polygon with vertices in clockwise order
check_nitf_des_headersDES Subheader fields match spec
check_nitf_display_levelsImage segments have reasonable display and attachment levels
check_nitf_image_segment_orderImage Segment categories must be in order
check_nitf_image_segmentationNITF Image Subheaders match SIDD segmentation algorithm
check_nitf_image_subheadersImage Subheader fields match SIDD XML
check_nitf_sidd_image_segmentsCheck relationships between segments of a single image
check_sidd_versionSIDD XMLs have same namespace