How to use the sarpy.io.general.nitf_elements.base._StringDescriptor function in sarpy

To help you get started, we’ve selected a few sarpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngageoint / sarpy / sarpy / io / general / nitf_elements / des.py View on Github external
DESSHDT = _StringDescriptor(
        'DESSHDT', True, 20, default_value='',
        docstring='Date and Time. This field shall contain the time (UTC) of the XML files '
                  'origination in the format :code:`YYYY-MM-DDThh:mm:ssZ`.')  # type: str
    DESSHRP = _StringDescriptor(
        'DESSHRP', True, 40, default_value='',
        docstring='Responsible Party – Organization Identifier. Identification of the '
                  'organization responsible for the content of the DES.')  # type: str
    DESSHSI = _StringDescriptor(
        'DESSHSI', True, 60, default_value='',
        docstring='Specification Identifier. Name of the specification used for the '
                  'XML data content.')  # type: str
    DESSHSV = _StringDescriptor(
        'DESSHSV', True, 10, default_value='',
        docstring='Specification Version. Version or edition of the specification.')  # type: str
    DESSHSD = _StringDescriptor(
        'DESSHSD', True, 20, default_value='',
        docstring='Specification Date. Version or edition date for the specification '
                  'in the format :code:`YYYY-MM-DDThh:mm:ssZ`.')  # type: str
    DESSHTN = _StringDescriptor(
        'DESSHTN', True, 120, default_value='',
        docstring='Target Namespace. Identification of the target namespace, if any, '
                  'designated within the XML data content.')  # type: str
    DESSHLPG = _StringDescriptor(
        'DESSHLPG', True, 125, default_value='',
        docstring='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.\n'
                  'Recorded as paired latitude and longitude values in decimal degrees with '
                  'no separator. Each latitude and longitude value includes an explicit :code:`+` '
                  'or :code:`-`.\n'
github ngageoint / sarpy / sarpy / io / general / nitf_elements / des.py View on Github external
_ordering = (
        'DESSHL', 'DESCRC', 'DESSHFT', 'DESSHDT',
        'DESSHRP', 'DESSHSI', 'DESSHSV', 'DESSHSD',
        'DESSHTN', 'DESSHLPG', 'DESSHLPT', 'DESSHLI',
        'DESSHLIN', 'DESSHABS')
    _lengths = {
        'DESSHL': 4, 'DESCRC': 5, 'DESSHFT': 8, 'DESSHDT': 20,
        'DESSHRP': 40, 'DESSHSI': 60, 'DESSHSV': 10,
        'DESSHSD': 20, 'DESSHTN': 120, 'DESSHLPG': 125,
        'DESSHLPT': 25, 'DESSHLI': 20, 'DESSHLIN': 120,
        'DESSHABS': 200}
    DESSHFT = _StringDescriptor(
        'DESSHFT', True, 8, default_value='XML',
        docstring='XML File Type. Data in this field shall be representative of the XML File Type. '
                  'Examples :code:`XSD, XML, DTD, XSL, XSLT`.')  # type: str
    DESSHDT = _StringDescriptor(
        'DESSHDT', True, 20, default_value='',
        docstring='Date and Time. This field shall contain the time (UTC) of the XML files '
                  'origination in the format :code:`YYYY-MM-DDThh:mm:ssZ`.')  # type: str
    DESSHRP = _StringDescriptor(
        'DESSHRP', True, 40, default_value='',
        docstring='Responsible Party – Organization Identifier. Identification of the '
                  'organization responsible for the content of the DES.')  # type: str
    DESSHSI = _StringDescriptor(
        'DESSHSI', True, 60, default_value='',
        docstring='Specification Identifier. Name of the specification used for the '
                  'XML data content.')  # type: str
    DESSHSV = _StringDescriptor(
        'DESSHSV', True, 10, default_value='',
        docstring='Specification Version. Version or edition of the specification.')  # type: str
    DESSHSD = _StringDescriptor(
        'DESSHSD', True, 20, default_value='',
github ngageoint / sarpy / sarpy / io / general / nitf_elements / res.py View on Github external
class RESUserHeader(Unstructured):
    _size_len = 4


class ReservedExtensionHeader(NITFElement):
    """
    The reserved extension subheader - see standards document MIL-STD-2500C for more
    information.
    """

    _ordering = ('RE', 'RESID', 'RESVER', 'Security', 'UserHeader')
    _lengths = {'RE': 2, 'RESID': 25, 'RESVER': 2}
    RE = _StringEnumDescriptor(
        'RE', True, 2, {'RE', }, default_value='RE',
        docstring='File part type.')  # type: str
    RESID = _StringDescriptor(
        'RESID', True, 25, default_value='',
        docstring='Unique RES Type Identifier. This field shall contain a valid alphanumeric '
                  'identifier properly registered with the ISMC.')  # type: str
    RESVER = _IntegerDescriptor(
        'RESVER', True, 2, default_value=1,
        docstring='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.')  # type: int
    Security = _NITFElementDescriptor(
        'Security', True, NITFSecurityTags, default_args={},
        docstring='The security tags.')  # type: NITFSecurityTags

    def __init__(self, **kwargs):
        self._RESID = None
        self._UserHeader = None
        super(ReservedExtensionHeader, self).__init__(**kwargs)
github ngageoint / sarpy / sarpy / io / general / nitf_elements / security.py View on Github external
DGDT = _StringDescriptor(
        'DGDT', True, 8, default_value='',
        docstring='Downgrade Date. This field shall indicate the date on which this element is to be downgraded '
                  'if the value in Declassification Type is :code:`GD`.')  # type: str
    CLTX = _StringDescriptor(
        'CLTX', True, 43, default_value='',
        docstring='Classification Text. This field shall be used to provide additional information about '
                  'classification to include identification of a declassification or downgrading event if the '
                  'values in Declassification Type are DE or GE. It may also be used to identify multiple '
                  'classification sources and/or any other special handling rules. '
                  'Values are user defined free text.')  # type: str
    CAPT = _StringEnumDescriptor(
        'CAPT', True, 1, {'', 'O', 'D', 'M'}, default_value='',
        docstring='Classification Authority Type. This field shall indicate the type of authority '
                  'used to classify this element.')  # type: str
    CAUT = _StringDescriptor(
        'CAUT', True, 40, default_value='',
        docstring='Classification Authority. This field shall identify the classification authority '
                  'for this element dependent upon the value in Classification Authority Type. Values are user '
                  'defined free text which should contain the following information: original classification '
                  'authority name and position or personal identifier if the value in Classification Authority '
                  'Type is O; title of the document or security classification guide used to classify this element '
                  'if the value in Classification Authority Type is D; and Derive-Multiple if the classification '
                  'was derived from multiple sources. In the latter case, the originator will maintain a record '
                  'of the sources used in accordance with existing security directives. One of the multiple '
                  'sources may also be identified in Classification Text if desired')  # type: str
    CRSN = _StringEnumDescriptor(
        'CRSN', True, 1, {'', 'A', 'B', 'C', 'D', 'E', 'F', 'G'}, default_value='',
        docstring='Classification Reason. This field shall contain values indicating the reason for '
                  'classifying the graphic. Valid values are A to G. These correspond to the reasons for '
                  'original classification per E.O. 12958, Section 1.5.(a) to (g).')  # type: str
    SRDT = _StringDescriptor(
github ngageoint / sarpy / sarpy / io / general / nitf_elements / graphics.py View on Github external
'SY', 'SID', 'SNAME', 'Security', 'ENCRYP', 'SFMT',
        'SSTRUCT', 'SDLVL', 'SALVL', 'SLOC', 'SBND1',
        'SCOLOR', 'SBND2', 'SRES2', 'UserHeader')
    _lengths = {
        'SY': '2s', 'SID': '10s', 'SNAME': '20s', 'ENCRYP': '1d',
        'SFMT': '1s', 'SSTRUCT': '13d', 'SDLVL': '3d', 'SALVL': '3d',
        'SLOC': 10, 'SBND1': 10, 'SCOLOR': 1, 'SBND2': 10,
        'SRES2': 2}
    SY = _StringEnumDescriptor(
        'SY', True, 2, {'SY', }, default_value='SY',
        docstring='File part type.')  # type: str
    SID = _StringDescriptor(
        'SID', True, 10, default_value='',
        docstring='Graphic Identifier. This field shall contain a valid alphanumeric identification code '
                  'associated with the graphic. The valid codes are determined by the application.')  # type: str
    SNAME = _StringDescriptor(
        'SNAME', True, 20, default_value='',
        docstring='Graphic name. This field shall contain an alphanumeric name for the graphic.')  # type: str
    Security = _NITFElementDescriptor(
        'Security', True, NITFSecurityTags, default_args={},
        docstring='The security tags.')  # type: NITFSecurityTags
    ENCRYP = _StringEnumDescriptor(
        'ENCRYP', True, 1, {'0'}, default_value='0',
        docstring='Encryption.')  # type: str
    SFMT = _StringDescriptor(
        'SFMT', True, 1, default_value='C',
        docstring='Graphic Type. This field shall contain a valid indicator of the '
                  'representation type of the graphic.')  # type: str
    SSTRUCT = _IntegerDescriptor(
        'SSTRUCT', True, 13, default_value=0,
        docstring='Reserved for Future Use.')  # type: int
    SDLVL = _IntegerDescriptor(
github ngageoint / sarpy / sarpy / io / general / nitf_elements / des.py View on Github external
'designated within the XML data content.')  # type: str
    DESSHLPG = _StringDescriptor(
        'DESSHLPG', True, 125, default_value='',
        docstring='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.\n'
                  'Recorded as paired latitude and longitude values in decimal degrees with '
                  'no separator. Each latitude and longitude value includes an explicit :code:`+` '
                  'or :code:`-`.\n'
                  'The precision for recording the values in the subheader is dictated by the field '
                  'size constraint.')  # type: str
    DESSHLPT = _StringDescriptor(
        'DESSHLPT', True, 25, default_value='',
        docstring='Location – Point. Single geographic point applicable to the DES.')  # type: str
    DESSHLI = _StringDescriptor(
        'DESSHLI', True, 20, default_value='',
        docstring='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 = _StringDescriptor(
        'DESSHLIN', True, 120, default_value='',
        docstring='Location Identifier Namespace URI. URI for the Namespace where the Location '
                  'Identifier is described.')  # type: str
    DESSHABS = _StringDescriptor(
        'DESSHABS', True, 200, default_value='',
        docstring='Abstract. Brief narrative summary of the content of the DES.')  # type: str

    def __init__(self, **kwargs):
        self._DESSHL = 773
        self._DESCRC = 99999
github ngageoint / sarpy / sarpy / io / general / nitf_elements / image.py View on Github external
class ImageBand(NITFElement):
    """
    Single image band, part of the image bands collection
    """
    _ordering = ('IREPBAND', 'ISUBCAT', 'IFC', 'IMFLT', 'LUTD')
    _lengths = {'IREPBAND': 2, 'ISUBCAT': 6, 'IFC': 1, 'IMFLT': 3}
    IREPBAND = _StringDescriptor(
        'IREPBAND', True, 2, default_value='',
        docstring='Representation. This field shall contain a valid indicator of the processing '
                  'required to display the nth band of the image with regard to the general image type '
                  'as recorded in the `IREP` field. The significance of each band in the image can be '
                  'derived from the combination of the `ICAT`, and `ISUBCAT` fields. Valid values of '
                  'the `IREPBAND` field depend on the value of '
                  'the `IREP` field.')  # type: str
    ISUBCAT = _StringDescriptor(
        'ISUBCAT', True, 6, default_value='',
        docstring='Subcategory. The purpose of this field is to provide the significance of the band '
                  'of the image with regard to the specific category (`ICAT` field) '
                  'of the overall image.')  # type: str
    IFC = _StringEnumDescriptor(
        'IFC', True, 1, {'N', }, default_value='N',
        docstring=' Image Filter Condition.')  # type: str
    IMFLT = _StringDescriptor(
        'IMFLT', True, 3, default_value='',
        docstring='Standard Image Filter Code. This field is reserved '
                  'for future use.')  # type: str

    def __init__(self, **kwargs):
        self._LUTD = None
        super(ImageBand, self).__init__(**kwargs)
github ngageoint / sarpy / sarpy / io / general / nitf_elements / graphics.py View on Github external
'SY', True, 2, {'SY', }, default_value='SY',
        docstring='File part type.')  # type: str
    SID = _StringDescriptor(
        'SID', True, 10, default_value='',
        docstring='Graphic Identifier. This field shall contain a valid alphanumeric identification code '
                  'associated with the graphic. The valid codes are determined by the application.')  # type: str
    SNAME = _StringDescriptor(
        'SNAME', True, 20, default_value='',
        docstring='Graphic name. This field shall contain an alphanumeric name for the graphic.')  # type: str
    Security = _NITFElementDescriptor(
        'Security', True, NITFSecurityTags, default_args={},
        docstring='The security tags.')  # type: NITFSecurityTags
    ENCRYP = _StringEnumDescriptor(
        'ENCRYP', True, 1, {'0'}, default_value='0',
        docstring='Encryption.')  # type: str
    SFMT = _StringDescriptor(
        'SFMT', True, 1, default_value='C',
        docstring='Graphic Type. This field shall contain a valid indicator of the '
                  'representation type of the graphic.')  # type: str
    SSTRUCT = _IntegerDescriptor(
        'SSTRUCT', True, 13, default_value=0,
        docstring='Reserved for Future Use.')  # type: int
    SDLVL = _IntegerDescriptor(
        'SDLVL', True, 3, default_value=1,
        docstring='Graphic Display Level. This field shall contain a valid value that indicates '
                  'the graphic display level of the graphic relative to other displayed file '
                  'components in a composite display. The valid values are :code:`1-999`. '
                  'The display level of each displayable file component (image or graphic) '
                  'within a file shall be unique.')  # type: int
    SALVL = _IntegerDescriptor(
        'SALVL', True, 3, default_value=0,
        docstring='Graphic Attachment Level. This field shall contain a valid value '
github ngageoint / sarpy / sarpy / io / general / nitf_elements / image.py View on Github external
'calculation); it is intended to support general user appreciation for the image location (e.g., '
                  'cataloguing). The representation of the image corner locations is specified in the `ICORDS` field. '
                  'The locations of the four corners of the (significant) image data shall be given in image '
                  'coordinate order: (0,0), (0, MaxCol), (MaxRow, MaxCol), (MaxRow, 0). MaxCol and MaxRow shall be '
                  'determined from the values contained, respectively, in the `NCOLS` field '
                  'and the `NROWS` field.')  # type: str
    Comments = _NITFElementDescriptor(
        'Comments', True, ImageComments, default_args={},
        docstring='The image comments.')  # type: ImageComments
    Bands = _NITFElementDescriptor(
        'Bands', True, ImageBands, default_args={},
        docstring='The image bands.')  # type: ImageBands
    ISYNC = _IntegerDescriptor(
        'ISYNC', True, 1, default_value=0,
        docstring='Image Sync code. This field is reserved for future use. ')  # type: int
    IMODE = _StringDescriptor(
        'IMODE', True, 1, default_value='P',
        docstring='Image Mode. This field shall indicate how the Image Pixels are '
                  'stored in the NITF file.')  # type: str
    NBPR = _IntegerDescriptor(
        'NBPR', True, 4, default_value=1,
        docstring='Number of Blocks Per Row. This field shall contain the number of image blocks in a row of '
                  'blocks (paragraph 5.4.2.2) in the horizontal direction. If the image consists of only a '
                  'single block, this field shall contain the value one.')  # type: int
    NBPC = _IntegerDescriptor(
        'NBPC', True, 4, default_value=1,
        docstring='Number of Blocks Per Column. This field shall contain the number of image blocks in a column '
                  'of blocks (paragraph 5.4.2.2) in the vertical direction. If the image consists of only a '
                  'single block, this field shall contain the value one.')  # type: int
    NPPBH = _IntegerDescriptor(
        'NPPBH', True, 4, default_value=0,
        docstring='Number of Pixels Per Block Horizontal. This field shall contain the number of pixels horizontally '
github ngageoint / sarpy / sarpy / io / general / nitf_elements / security.py View on Github external
'CLAS': 1, 'CLSY': 2, 'CODE': 11, 'CTLH': 2,
        'REL': 20, 'DCTP': 2, 'DCDT': 8, 'DCXM': 4,
        'DG': 1, 'DGDT': 8, 'CLTX': 43, 'CAPT': 1,
        'CAUT': 40, 'CRSN': 1, 'SRDT': 8, 'CTLN': 15}
    CLAS = _StringEnumDescriptor(
        'CLAS', True, 1, {'U', 'R', 'C', 'S', 'T'}, default_value='U',
        docstring='The classification level.')  # type: str
    CLSY = _StringDescriptor(
        'CLSY', True, 2, default_value='',
        docstring='Security Classification System. This field shall contain valid values '
                  'indicating the national or multinational security system used to classify this element. '
                  'Country Codes per FIPS PUB 10-4 shall be used to indicate national security systems. '
                  'The designator :code:`XN` is for classified data generated by a component using NATO security '
                  'system marking guidance. This code is outside the FIPS 10-4 document listing, and was '
                  'selected to not duplicate existing codes.')  # type: str
    CODE = _StringDescriptor(
        'CODE', True, 11, default_value='',
        docstring='Codewords. This field shall contain a valid indicator of the security '
                  'compartments associated. Valid values include one or more of the digraphs found '
                  'in table A-4. Multiple entries shall be separated by a single ECS spaces (0x20). '
                  'The selection of a relevant set of codewords is application '
                  'specific.')  # type: str
    CTLH = _StringDescriptor(
        'CTLH', True, 2, default_value='',
        docstring='Control and Handling. This field shall contain valid additional security control '
                  'and/or handling instructions (caveats) associated with this element.')  # type: str
    REL = _StringDescriptor(
        'REL', True, 20, default_value='',
        docstring='Releasing Instructions. This field shall contain a valid list of country and/or '
                  'multilateral entity codes to which countries and/or multilateral entities this element'
                  'is authorized for release. Valid items in the list are one or more country codes as '
                  'found in FIPS PUB 10-4 and/or codes identifying multilateral entities.')  # type: str