Verification (sarkit.verification)

Verification of SAR data in NGA standard formats.

Consistency Checking

Python Interface

CrsdConsistency(crsd_xml, *[, ...])

Check CRSD file structure and metadata for internal consistency

CphdConsistency(cphd_xml, *[, ...])

Check CPHD file structure and metadata for internal consistency

SicdConsistency(sicd_xml, *[, ...])

Check SICD file structure and metadata for internal consistency

SiddConsistency(xml_trees[, ...])

Check SIDD file structure and metadata for internal consistency

Consistency objects should be instantiated using from_parts when data components are available in memory or from_file when data has already been serialized into a standard format.

>>> import sarkit.verification as skver

>>> with open("data/example-cphd-1.1.0.xml", "r") as f:
...     con = skver.CphdConsistency.from_file(f)
>>> con.check()
>>> bool(con.passes())
True
>>> bool(con.failures())
False

>>> import lxml.etree
>>> cphd_xmltree = lxml.etree.parse("data/example-cphd-1.1.0.xml")
>>> con = skver.CphdConsistency.from_parts(cphd_xmltree)
>>> con.check()
>>> bool(con.passes())
True
>>> bool(con.failures())
False

Command-Line Interface

Each of the consistency checkers has a corresponding entry point:

$ cphdcheck /path/to/file
$ crsdcheck /path/to/file
$ sicdcheck /path/to/file
$ siddcheck /path/to/file

The command line flags for each are given below:

cphdcheck

Analyze a CPHD and display inconsistencies

usage: cphdcheck [-h] [--schema SCHEMA] [--thorough]
                 [--ignore PATTERN [PATTERN ...]] [-v]
                 [--array-limit ARRAY_LIMIT] [--color | --no-color]
                 file_name
file_name

CPHD or CPHD XML to check

-h, --help

show this help message and exit

--schema <schema>

Use a supplied schema file (attempts version-specific schema if omitted)

--thorough

Run checks that may seek/read through large portions of the file. Ignored when file_name is XML

--ignore <pattern>

Skip any check matching PATTERN at the beginning of its name. Can be specified more than once.

-v, --verbose

Increase verbosity (can be specified more than once >4 doesn’t help)

--array-limit <array_limit>

Number of array elements above which arrays are abbreviated

--color, --no-color

colorize output

crsdcheck

Analyze a CRSD and display inconsistencies

usage: crsdcheck [-h] [--schema SCHEMA] [--thorough]
                 [--ignore PATTERN [PATTERN ...]] [-v]
                 [--array-limit ARRAY_LIMIT] [--color | --no-color]
                 file_name
file_name

CRSD or CRSD XML to check

-h, --help

show this help message and exit

--schema <schema>

Use a supplied schema file (attempts version-specific schema if omitted)

--thorough

Run checks that may seek/read through large portions of the file. Ignored when file_name is XML

--ignore <pattern>

Skip any check matching PATTERN at the beginning of its name. Can be specified more than once.

-v, --verbose

Increase verbosity (can be specified more than once >4 doesn’t help)

--array-limit <array_limit>

Number of array elements above which arrays are abbreviated

--color, --no-color

colorize output

sicdcheck

Analyze a SICD and display inconsistencies

usage: sicdcheck [-h] [--schema SCHEMA] [--ignore PATTERN [PATTERN ...]] [-v]
                 [--array-limit ARRAY_LIMIT] [--color | --no-color]
                 file_name
file_name

SICD or SICD XML to check

-h, --help

show this help message and exit

--schema <schema>

Use a supplied schema file (attempts version-specific schema if omitted)

--ignore <pattern>

Skip any check matching PATTERN at the beginning of its name. Can be specified more than once.

-v, --verbose

Increase verbosity (can be specified more than once >4 doesn’t help)

--array-limit <array_limit>

Number of array elements above which arrays are abbreviated

--color, --no-color

colorize output

siddcheck

Analyze a SIDD and display inconsistencies

usage: siddcheck [-h] [--schema SCHEMA] [--ignore PATTERN [PATTERN ...]] [-v]
                 [--array-limit ARRAY_LIMIT] [--color | --no-color]
                 file_name
file_name

SIDD or SIDD XML to check

-h, --help

show this help message and exit

--schema <schema>

Use a supplied schema file

--ignore <pattern>

Skip any check matching PATTERN at the beginning of its name. Can be specified more than once.

-v, --verbose

Increase verbosity (can be specified more than once >4 doesn’t help)

--array-limit <array_limit>

Number of array elements above which arrays are abbreviated

--color, --no-color

colorize output