sarkit.sidd.NitfReader

class NitfReader(file)

Read a SIDD NITF

A NitfReader object should be used as a context manager in a with statement. Attributes, but not methods, can be safely accessed outside of the context manager’s context.

Parameters:
filefile object

SIDD NITF file to read

Attributes:
metadataNitfMetadata

SIDD NITF metadata

jbpjbpy.Jbp

NITF file object

Methods

read_ded(*[, out])

Read Digital Elevation Data (DED)

read_image(image_number, *[, out])

Read the entire pixel array

read_legend(image_number, legend_number, *)

Read a legend

See also

NitfWriter

Examples

>>> import sarkit.sidd as sksidd
>>> with file.open("rb") as f, sksidd.NitfReader(f) as r:
...     img = r.read_image(0)

>>> print(r.metadata.images[0].xmltree.getroot().tag)
{urn:SIDD:3.0.0}SIDD

>>> print(r.metadata.file_header_part.ftitle)
sarkit example

>>> print(r.jbp["FileHeader"]["FTITLE"].value)
sarkit example