nitf header dump utility (sarpy.utils.nitf_utils)

A utility for dumping a NITF header to the console. Contributed by Austin Lan of L3/Harris.

To dump NITF header information to a text file from the command-line

>>> python -m sarpy.utils.nitf_utils <path to nitf file>

For a basic help on the command-line, check

>>> python -m sarpy.utils.nitf_utils --help
sarpy.utils.nitf_utils.print_nitf(file_name, dest=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)

Worker function to dump the NITF header and various subheader details to the provided destination.

Parameters:
  • file_name (str|BinaryIO) –

  • dest (TextIO) –

sarpy.utils.nitf_utils.dump_nitf_file(file_name, dest, over_write=True)

Utility to dump the NITF header and various subheader details to a configurable destination.

Parameters:
  • file_name (str|BinaryIO) – The path to or file-like object containing a NITF 2.1 or 2.0 file.

  • dest (str) – ‘stdout’, ‘string’, ‘default’ (will use file_name+’.header_dump.txt’), or the path to an output file.

  • over_write (bool) – If True, then overwrite the destination file, otherwise append to the file.

Returns:

There is only a return value if dest==’string’.

Return type:

None|str