How to use the sarpy.io.general.nitf_elements.tres.tre_elements.TREExtension 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 / tres / registration.py View on Github external
def check_module(module_name):
        # import the module
        import_module(module_name)
        # fetch the module from the modules dict
        module = sys.modules[module_name]
        # check all classes of the module itself
        for element_name, element_type in inspect.getmembers(module, inspect.isclass):
            if issubclass(element_type, TREExtension) and element_type != TREExtension:
                register_tre(element_type, tre_id=element_name, replace=False)
        # walk down any subpackages
        path, fil = os.path.split(module.__file__)
        if not fil.startswith('__init__.py'):
            # there are no subpackages
            return
        for sub_module in pkgutil.walk_packages([path, ]):
            _, sub_module_name, _ = sub_module
            sub_name = "{}.{}".format(module_name, sub_module_name)
            check_module(sub_name)
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / CSCCGA.py View on Github external
class CSCCGAType(TREElement):
    def __init__(self, value):
        super(CSCCGAType, self).__init__()
        self.add_field('CCG_SOURCE', 's', 18, value)
        self.add_field('REG_SENSOR', 's', 6, value)
        self.add_field('ORIGIN_LINE', 'd', 7, value)
        self.add_field('ORIGIN_SAMPLE', 'd', 5, value)
        self.add_field('AS_CELL_SIZE', 'd', 7, value)
        self.add_field('CS_CELL_SIZE', 'd', 5, value)
        self.add_field('CCG_MAX_LINE', 'd', 7, value)
        self.add_field('CCG_MAX_SAMPLE', 'd', 5, value)


class CSCCGA(TREExtension):
    _tag_value = 'CSCCGA'
    _data_type = CSCCGAType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / CSPROA.py View on Github external
class CSPROAType(TREElement):
    def __init__(self, value):
        super(CSPROAType, self).__init__()
        self.add_field('RESERVED_0', 's', 12, value)
        self.add_field('RESERVED_1', 's', 12, value)
        self.add_field('RESERVED_2', 's', 12, value)
        self.add_field('RESERVED_3', 's', 12, value)
        self.add_field('RESERVED_4', 's', 12, value)
        self.add_field('RESERVED_5', 's', 12, value)
        self.add_field('RESERVED_6', 's', 12, value)
        self.add_field('RESERVED_7', 's', 12, value)
        self.add_field('RESERVED_8', 's', 12, value)
        self.add_field('BWC', 's', 12, value)


class CSPROA(TREExtension):
    _tag_value = 'CSPROA'
    _data_type = CSPROAType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / CLCTNB.py View on Github external
self.add_field('COUNTRY', 's', 2, value)
        self.add_field('SPONSOR', 's', 20, value)
        self.add_field('PERSONNEL', 's', 100, value)
        self.add_field('NUM_SITES', 'd', 1, value)
        self.add_loop('SITEs', self.NUM_SITES, SITE, value)
        self.add_field('SCLCTN_Z_OFF', 's', 3, value)
        self.add_field('SECURITY', 's', 7, value)
        self.add_field('SCG', 's', 15, value)
        self.add_field('FLIGHT_NUM', 's', 2, value)
        self.add_field('PASS_NUM', 's', 2, value)
        self.add_field('WX_STATION', 's', 20, value)
        self.add_field('WX_OVERVIEW', 's', 15, value)
        self.add_field('WX_FILE', 's', 30, value)


class CLCTNB(TREExtension):
    _tag_value = 'CLCTNB'
    _data_type = CLCTNBType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / BLOCKA.py View on Github external
def __init__(self, value):
        super(BLOCKAType, self).__init__()
        self.add_field('BLOCK_INSTANCE', 'd', 2, value)
        self.add_field('N_GRAY', 's', 5, value)
        self.add_field('L_LINES', 'd', 5, value)
        self.add_field('LAYOVER_ANGLE', 's', 3, value)
        self.add_field('SHADOW_ANGLE', 's', 3, value)
        self.add_field('RESERVED_001', 's', 16, value)
        self.add_field('FRLC_LOC', 's', 21, value)
        self.add_field('LRLC_LOC', 's', 21, value)
        self.add_field('LRFC_LOC', 's', 21, value)
        self.add_field('FRFC_LOC', 's', 21, value)
        self.add_field('RESERVED_002', 's', 5, value)


class BLOCKA(TREExtension):
    _tag_value = 'BLOCKA'
    _data_type = BLOCKAType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / PIAEVA.py View on Github external
# -*- coding: utf-8 -*-

from ..tre_elements import TREExtension, TREElement

__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"


class PIAEVAType(TREElement):
    def __init__(self, value):
        super(PIAEVAType, self).__init__()
        self.add_field('EVENTNAME', 's', 38, value)
        self.add_field('EVENTTYPE', 's', 8, value)


class PIAEVA(TREExtension):
    _tag_value = 'PIAEVA'
    _data_type = PIAEVAType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / ACFTA.py View on Github external
self.add_field('IMREQID', 's', 5, value)
        self.add_field('SCENE_SOURCE', 's', 1, value)
        self.add_field('MPLAN', 's', 2, value)
        self.add_field('ENTLOC', 's', 21, value)
        self.add_field('ENTALT', 's', 6, value)
        self.add_field('EXITLOC', 's', 21, value)
        self.add_field('EXITALT', 's', 6, value)
        self.add_field('TMAP', 's', 7, value)
        self.add_field('RCS', 's', 3, value)
        self.add_field('ROW_SPACING', 's', 7, value)
        self.add_field('COL_SPACING', 's', 7, value)
        self.add_field('SENSERIAL', 's', 4, value)
        self.add_field('ABSWVER', 's', 7, value)


class ACFTA_132(TREExtension):
    _tag_value = 'ACFTA'
    _data_type = ACFTA_132Type


class ACFTA_154Type(TREElement):
    def __init__(self, value):
        super(ACFTA_154Type, self).__init__()
        self.add_field('AC_MSN_ID', 's', 10, value)
        self.add_field('AC_TAIL_NO', 's', 10, value)
        self.add_field('SENSOR_ID', 's', 10, value)
        self.add_field('SCENE_SOURCE', 's', 1, value)
        self.add_field('SCNUM', 's', 6, value)
        self.add_field('PDATE', 's', 8, value)
        self.add_field('IMHOSTNO', 's', 6, value)
        self.add_field('IMREQID', 's', 5, value)
        self.add_field('MPLAN', 's', 3, value)
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / BNDPLB.py View on Github external
class PT(TREElement):
    def __init__(self, value):
        super(PT, self).__init__()
        self.add_field('LON', 'd', 15, value)
        self.add_field('LAT', 'd', 15, value)


class BNDPLBType(TREElement):
    def __init__(self, value):
        super(BNDPLBType, self).__init__()
        self.add_field('NUMPTS', 'd', 4, value)
        self.add_loop('PTs', self.NUMPTS, PT, value)


class BNDPLB(TREExtension):
    _tag_value = 'BNDPLB'
    _data_type = BNDPLBType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / PIAPEB.py View on Github external
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"


class PIAPEBType(TREElement):
    def __init__(self, value):
        super(PIAPEBType, self).__init__()
        self.add_field('LASTNME', 's', 28, value)
        self.add_field('FIRSTNME', 's', 28, value)
        self.add_field('MIDNME', 's', 28, value)
        self.add_field('DOB', 's', 8, value)
        self.add_field('ASSOCTRY', 's', 2, value)


class PIAPEB(TREExtension):
    _tag_value = 'PIAPEB'
    _data_type = PIAPEBType
github ngageoint / sarpy / sarpy / io / general / nitf_elements / tres / unclass / CSSHPA.py View on Github external
class CSSHPAType(TREElement):
    def __init__(self, value):
        super(CSSHPAType, self).__init__()
        self.add_field('SHAPE_USE', 's', 25, value)
        self.add_field('SHAPE_CLASS', 's', 10, value)
        if self.SHAPE_USE == 'CLOUD_SHAPES':
            self.add_field('CC_SOURCE', 's', 18, value)
        self.add_field('SHAPE1_NAME', 's', 3, value)
        self.add_field('SHAPE1_START', 'd', 6, value)
        self.add_field('SHAPE2_NAME', 's', 3, value)
        self.add_field('SHAPE2_START', 'd', 6, value)
        self.add_field('SHAPE3_NAME', 's', 3, value)
        self.add_field('SHAPE3_START', 'd', 6, value)


class CSSHPA(TREExtension):
    _tag_value = 'CSSHPA'
    _data_type = CSSHPAType