sarkit.verification.SicdConsistency.from_file

static SicdConsistency.from_file(file, schema=None)

Create a SicdConsistency object from a file

Parameters:
filefile object

SICD NITF or SICD XML file to check

schemastr, optional

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

Returns:
SicdConsistency

The initialized consistency checker object

See also

from_parts

Examples

Use from_file to check an XML file:

>>> import sarkit.verification as skver

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

Use from_file to check a SICD NITF file:

>>> with file.open("rb") as f:
...     con = skver.SicdConsistency.from_file(f)
>>> con.check()  # open file only used for construction
>>> bool(con.passes())
True
>>> bool(con.failures())
False