The NITF data extension header (sarpy.io.general.nitf_elements.des)

The data extension header element definition.

class sarpy.io.general.nitf_elements.des.XMLDESSubheader(**kwargs)

Bases: NITFElement

The standard XML Data Extension user header used in SICD and SIDD, described in SICD standard 2014-09-30, Volume II, page 29

DESSHFT: str

XML File Type. Data in this field shall be representative of the XML File Type. Examples XSD, XML, DTD, XSL, XSLT. Default value is XML.

Type:

str

DESSHDT: str

Date and Time. This field shall contain the time (UTC) of the XML files origination in the format YYYY-MM-DDThh:mm:ssZ.

Type:

str

DESSHRP: str

Responsible Party - Organization Identifier. Identification of the organization responsible for the content of the DES.

Type:

str

DESSHSI: str

Specification Identifier. Name of the specification used for the XML data content.

Type:

str

DESSHSV: str

Specification Version. Version or edition of the specification.

Type:

str

DESSHSD: str

Specification Date. Version or edition date for the specification in the format YYYY-MM-DDThh:mm:ssZ.

Type:

str

DESSHTN: str

Target Namespace. Identification of the target namespace, if any, designated within the XML data content.

Type:

str

DESSHLPG: str

Location - Polygon. Five-point boundary enclosing the area applicable to the DES, expressed as the closed set of coordinates of the polygon (last point replicates first point). NOTE This is only an approximate reference so specifying the coordinate reference system is unnecessary. Recorded as paired latitude and longitude values in decimal degrees with no separator. Each latitude and longitude value includes an explicit + or -. The precision for recording the values in the subheader is dictated by the field size constraint.

Type:

str

DESSHLPT: str

Location - Point. Single geographic point applicable to the DES.

Type:

str

DESSHLI: str

Location - Identifier. Identifier used to represent a geographic area. An alphanumeric value identifying an instance in the designated namespace. When this field is recorded with other than the default value, the Location Identifier Namespace URI shall also be recorded.

Type:

str

DESSHLIN: str

Location Identifier Namespace URI. URI for the Namespace where the Location Identifier is described.

Type:

str

DESSHABS: str

Abstract. Brief narrative summary of the content of the DES.

Type:

str

property DESSHL

User defined subheader length

Type:

int

property DESCRC

Cyclic redundancy check code, or 99999 when CRC not calculated/used.

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.des.DESUserHeader(data=None, **kwargs)

Bases: Unstructured

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.des.DataExtensionHeader(**kwargs)

Bases: NITFElement

The data extension subheader - see standards document Joint BIIF Profile (JBP) for more information.

DE: str

File part type. Takes values in {'DE'}. Default value is DE.

Type:

str

DESVER: int

Version of the Data Definition. This field shall contain the alphanumeric version number of the use of the tag. The version number is assigned as part of the registration process. Default value is 1.

Type:

int

Security: NITFSecurityTags

The security tags.

Type:

NITFSecurityTags

property DESID

Unique DES Type Identifier. This field shall contain a valid alphanumeric identifier properly registered with the ISMC.

Type:

str

property DESOFLW

DES Overflowed Header Type. This field shall be populated if DESID = “TRE_OVERFLOW”.

Its presence indicates that the DES contains a TRE that would not fit in the file header or segment subheader where it would ordinarily be located. Its value indicates the segment type to which the enclosed TRE is relevant. If populated, must be one of {"XHD", "IXSHD", "SXSHD", "TXSHD", "UDHD", "UDID"}.

Type:

None|str

property DESITEM

DES Data Item Overflowed. This field shall be present if DESOFLW is present. It shall contain the number of the data item in the file, of the type indicated in DESOFLW to which the TRE in the segment apply.

Type:

None|int

property UserHeader: DESUserHeader | XMLDESSubheader

The DES user header.

Type:

DESUserHeader

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.des.DataExtensionHeader0(**kwargs)

Bases: NITFElement

The data extension subheader - see standards document Joint BIIF Profile (JBP) for more information.

DE: str

File part type. Takes values in {'DE'}. Default value is DE.

Type:

str

DESVER: int

Version of the Data Definition. This field shall contain the alphanumeric version number of the use of the tag. The version number is assigned as part of the registration process. Default value is 1.

Type:

int

Security: NITFSecurityTags0

The security tags.

Type:

NITFSecurityTags0

property DESTAG

Unique DES Type Identifier. This field shall contain a valid alphanumeric identifier properly registered with the ISMC.

Type:

str

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 DESOFLW

DES Overflowed Header Type. This field shall be populated if DESTAG in [‘TRE_OVERFLOW’, ‘Registered Extensions’, ‘Controlled Extensions’].

Its presence indicates that the DES contains a TRE that would not fit in the file header or segment subheader where it would ordinarily be located. Its value indicates the segment type to which the enclosed TRE is relevant. If populated, must be one of {"XHD", "IXSHD", "SXSHD", "TXSHD", "UDHD", "UDID"}.

Type:

None|str

property DESITEM

DES Data Item Overflowed. This field shall be present if DESOFLW is present. It shall contain the number of the data item in the file, of the type indicated in DESOFLW to which the TRE in the segment apply.

Type:

None|int

property UserHeader: DESUserHeader | XMLDESSubheader

The DES user header.

Type:

DESUserHeader