The main NITF header object (sarpy.io.general.nitf_elements.nitf_head)

The main NITF header definitions.

class sarpy.io.general.nitf_elements.nitf_head.ImageSegmentsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the image subheader and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.GraphicsSegmentsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the graphics subheader and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.TextSegmentsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the text subheader size and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.DataExtensionsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the data extension subheader and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.ReservedExtensionsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the reserved extension subheader and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.NITFHeader(**kwargs)

Bases: NITFElement

The main NITF file header for NITF version 2.1 - see standards document Joint BIIF Profile (JBP) for more information.

CLEVEL: int

Complexity Level. This field shall contain the complexity level required to interpret fully all components of the file. Valid entries are assigned in accordance with complexity levels established in Table A-10. Default value is 0.

Type:

int

STYPE: str

Standard Type. Standard type or capability. A BCS-A character string BF01 which indicates that this file is formatted using ISO/IEC IS 12087-5. NITF02.10 is intended to be registered as a profile of ISO/IEC IS 12087-5. Default value is BF01.

Type:

str

OSTAID: str

Originating Station ID. This field shall contain the identification code or name of the originating organization, system, station, or product. It shall not be filled with BCS spaces

Type:

str

FDT: str

File Date and Time. This field shall contain the time (UTC) of the files origination in the format YYYYMMDDhhmmss.

Type:

str

FTITLE: str

File Title. This field shall contain the title of the file.

Type:

str

Security: NITFSecurityTags

The image security tags.

Type:

NITFSecurityTags

FSCOP: int

File Copy Number. This field shall contain the copy number of the file. Default value is 0.

Type:

int

FSCPYS: int

File Number of Copies. This field shall contain the total number of copies of the file. Default value is 0.

Type:

int

ENCRYP: str

Encryption. Takes values in {'0'}. Default value is 0.

Type:

str

FBKGC: bytes

File Background Color. This field shall contain the three color components of the file background in the order Red, Green, Blue.

Type:

bytes

ONAME: str

Originator Name. This field shall contain a valid name for the operator who originated the file.

Type:

str

OPHONE: str

Originator Phone Number. This field shall contain a valid phone number for the operator who originated the file.

Type:

str

FL: int

The size in bytes of the entire file. Default value is 0.

Type:

int

ImageSegments: ImageSegmentsType

The image segment basic information.

Type:

ImageSegmentsType

GraphicsSegments: GraphicsSegmentsType

The graphics segment basic information.

Type:

GraphicsSegmentsType

TextSegments: TextSegmentsType

The text segment basic information.

Type:

TextSegmentsType

DataExtensions: DataExtensionsType

The data extension basic information.

Type:

DataExtensionsType

ReservedExtensions: ReservedExtensionsType

The reserved extension basic information.

Type:

ReservedExtensionsType

UserHeader: UserHeaderType

User defined header.

Type:

UserHeaderType

ExtendedHeader: UserHeaderType

Extended subheader - TRE list.

Type:

UserHeaderType

property FHDR

File Profile Name. This field shall contain the character string uniquely denoting that the file is formatted using NITF. Always NITF.

Type:

str

property FVER

File Version. This field shall contain a BCS-A character string uniquely denoting the version. Always 02.10.

Type:

str

property NUMX

Reserved for future use. Always 0.

Type:

int

property HL

The length of this header object in bytes.

Type:

int

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) – the header string to scrape

  • start (int) – the beginning location in the string

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.SymbolSegmentsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the symbol subheader and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.LabelSegmentsType(subhead_sizes=None, item_sizes=None, **kwargs)

Bases: _ItemArrayHeaders

This holds the label subheader and item sizes.

subhead_sizes

the subheader sizes

Type:

numpy.ndarray

item_sizes

the item size

Type:

numpy.ndarray

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) –

  • start (int) –

Return type:

_ItemArrayHeaders

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

class sarpy.io.general.nitf_elements.nitf_head.NITFHeader0(**kwargs)

Bases: NITFElement

The main NITF file header for NITF version 2.0 - see standards document MIL-STD-2500A for more information.

CLEVEL: int

Complexity Level. This field shall contain the complexity level required to interpret fully all components of the file. Valid entries are assigned in accordance with complexity levels established in Table A-10. Default value is 0.

Type:

int

STYPE: str

Standard Type. Standard type or capability. A BCS-A character string BF01 which indicates that this file is formatted using ISO/IEC IS 12087-5. NITF02.10 is intended to be registered as a profile of ISO/IEC IS 12087-5. Default value is BF01.

Type:

str

OSTAID: str

Originating Station ID. This field shall contain the identification code or name of the originating organization, system, station, or product. It shall not be filled with BCS spaces

Type:

str

FDT: str

File Date and Time. This field shall contain the time (UTC) of the files origination in the format YYYYMMDDhhmmss.

Type:

str

FTITLE: str

File Title. This field shall contain the title of the file.

Type:

str

Security: NITFSecurityTags0

The image security tags.

Type:

NITFSecurityTags0

FSCOP: str

File Copy Number. This field shall contain the copy number of the file. Default value is :code:` 0`.

Type:

str

FSCPYS: str

File Number of Copies. This field shall contain the total number of copies of the file. Default value is :code:` 0`.

Type:

str

ENCRYP: str

Encryption. Takes values in {'0'}. Default value is 0.

Type:

str

ONAME: str

Originator Name. This field shall contain a valid name for the operator who originated the file.

Type:

str

OPHONE: str

Originator Phone Number. This field shall contain a valid phone number for the operator who originated the file.

Type:

str

FL: int

The size in bytes of the entire file. Default value is 0.

Type:

int

ImageSegments: ImageSegmentsType

The image segment basic information.

Type:

ImageSegmentsType

SymbolSegments: SymbolSegmentsType

The symbols segment basic information.

Type:

SymbolSegmentsType

LabelSegments: LabelSegmentsType

The labels segment basic information.

Type:

LabelSegmentsType

TextSegments: TextSegmentsType

The text segment basic information.

Type:

TextSegmentsType

DataExtensions: DataExtensionsType

The data extension basic information.

Type:

DataExtensionsType

ReservedExtensions: ReservedExtensionsType

The reserved extension basic information.

Type:

ReservedExtensionsType

UserHeader: UserHeaderType

User defined header.

Type:

UserHeaderType

ExtendedHeader: UserHeaderType

Extended subheader - TRE list.

Type:

UserHeaderType

classmethod from_bytes(value, start)
Parameters:
  • value (bytes|str) – the header string to scrape

  • start (int) – the beginning location in the string

get_bytes_length()

Get the length of the serialized bytes array

Return type:

int

classmethod minimum_length()

The minimum size in bytes that takes to write this header element.

Return type:

int

to_bytes()

Write the object to a properly packed str.

Return type:

bytes

to_json()

Serialize element to a json representation. This is intended to allow a simple presentation of the element.

Return type:

dict

property FHDR

File Profile Name. This field shall contain the character string uniquely denoting that the file is formatted using NITF. Always NITF.

Type:

str

property FVER

File Version. This field shall contain a BCS-A character string uniquely denoting the version, should generally be 02.00 or 01.10.

Type:

str

property HL

The length of this header object in bytes.

Type:

int