sarkit.sicd.NitfReader

class NitfReader(file)

Read a SICD NITF

A NitfReader object can 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

SICD NITF file to read

Attributes:
metadataNitfMetadata

SICD NITF metadata

jbpjbpy.Jbp

NITF file object

Methods

done()

Indicates to the reader that the user is done with it

read_image(*[, out])

Read the entire pixel array

read_sub_image([start_row, start_col, ...])

Read a 2D slice / sub-image from the file

See also

NitfWriter

Examples

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

>>> print(r.metadata.xmltree.getroot().tag)
{urn:SICD:1.4.0}SICD

>>> print(r.metadata.im_subheader_part.isorce)
this sensor

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