sarkit.verification.SiddConsistency

class SiddConsistency(xml_trees, schema_override=None, file=None)

Check SIDD file structure and metadata for internal consistency

SiddConsistency objects should be instantiated using from_file or from_parts.

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

SIDD XML

schema_overridepath-like object, optional

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

filefile object, optional

SIDD NITF file; when specified, NITF headers are extracted during object instantiation

Methods

add_cli_args(parser)

Add CLI args used by run_cli to an argparser

all()

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_args

skips([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_schema

The XML matches the schema.

check_datetime_fields_are_utc

Datetime fields should be followed by Z to indicate UTC.

check_display_antialias_filter_operation

Display/…/(RRDS|Scaling)/AntiAlias/Operation is set correctly.

check_display_auto_dra_parameters

Display/InteractiveProcessing/DynamicRangeAdjustment/DRAParameters included if AlgorithmType = AUTO.

check_display_dra_bandstatssource

Display/InteractiveProcessing/DynamicRangeAdjustment/BandStatsSource is a valid band index.

check_display_interpolation_filter_operation

Display/…/(RRDS|Scaling)/Interpolation/Operation is set correctly.

check_display_none_dra_overrides

Display/InteractiveProcessing/DynamicRangeAdjustment/DRAOverrides excluded if AlgorithmType = NONE.

check_display_numbands

Display/NumBands is consistent with Display/PixelType.

check_display_processing_bands

Display/[Non]InteractiveProcessing nodes are present for each band.

check_display_valid_dra_overrides

Display/InteractiveProcessing/DynamicRangeAdjustment/DRAOverrides ∈ [0.0, 2047.0]

check_display_valid_dra_parameters

Display/InteractiveProcessing/DynamicRangeAdjustment/DRAParameters: 0.0 <= min <= max <= 1.0

check_expfeatures_geometry

ExploitationFeatures geometry is consistent with Measurement parameters

check_geodata_image_corners

Image Corners are consistent with Measurement element.

check_measurement_productplane_unit_vectors

Measurement/PlaneProjection/ProductPlane/(Row|Col)UnitVectors are unit-length and orthogonal

check_measurement_validdata

Measurement/ValidData is a simple convex polygon with vertices in clockwise order

check_nitf_des_headers

DES Subheader fields match spec

check_nitf_display_levels

Image segments have reasonable display and attachment levels

check_nitf_image_segment_order

Image Segment categories must be in order

check_nitf_image_segmentation

NITF Image Subheaders match SIDD segmentation algorithm

check_nitf_image_subheaders

Image Subheader fields match SIDD XML

check_nitf_sidd_image_segments

Check relationships between segments of a single image

check_sidd_version

SIDD XMLs have same namespace