Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class CODE(TREElement):
def __init__(self, value):
super(CODE, self).__init__()
self.add_field('CODE_LEN', 'd', 1, value)
self.add_field('CODE', 's', self.CODE_LEN, value)
self.add_field('EQTYPE', 's', 1, value)
self.add_field('ESURN_LEN', 'd', 2, value)
self.add_field('ESURN', 's', self.ESURN_LEN, value)
self.add_field('DETAIL_LEN', 'd', 5, value)
if self.DETAIL_LEN > 0:
self.add_field('DETAIL_CMPR', 's', 1, value)
self.add_field('DETAIL', 's', self.DETAIL_LEN, value)
class CCINFAType(TREElement):
def __init__(self, value):
super(CCINFAType, self).__init__()
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class GEOLOBType(TREElement):
def __init__(self, value):
super(GEOLOBType, self).__init__()
self.add_field('ARV', 'd', 9, value)
self.add_field('BRV', 'd', 9, value)
self.add_field('LSO', 'd', 15, value)
self.add_field('PSO', 'd', 15, value)
class GEOLOB(TREExtension):
_tag_value = 'GEOLOB'
_data_type = GEOLOBType
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class CSEXRAType(TREElement):
def __init__(self, value):
super(CSEXRAType, self).__init__()
self.add_field('SENSOR', 's', 6, value)
self.add_field('TIME_FIRST_LINE_IMAGE', 'd', 12, value)
self.add_field('TIME_IMAGE_DURATION', 'd', 12, value)
self.add_field('MAX_GSD', 'd', 5, value)
self.add_field('ALONG_SCAN_GSD', 's', 5, value)
self.add_field('CROSS_SCAN_GSD', 's', 5, value)
self.add_field('GEO_MEAN_GSD', 's', 5, value)
self.add_field('A_S_VERT_GSD', 's', 5, value)
self.add_field('C_S_VERT_GSD', 's', 5, value)
self.add_field('GEO_MEAN_VERT_GSD', 's', 5, value)
self.add_field('GSD_BETA_ANGLE', 's', 5, value)
self.add_field('DYNAMIC_RANGE', 'd', 5, value)
self.add_field('NUM_LINES', 'd', 7, value)
self.add_field('NUM_SAMPLES', 'd', 5, value)
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class AIPBCAType(TREElement):
def __init__(self, value):
super(AIPBCAType, self).__init__()
self.add_field('PATCH_WIDTH', 'd', 5, value)
self.add_field('U_HAT_X', 's', 16, value)
self.add_field('U_HAT_Y', 's', 16, value)
self.add_field('U_HAT_Z', 's', 16, value)
self.add_field('V_HAT_X', 's', 16, value)
self.add_field('V_HAT_Y', 's', 16, value)
self.add_field('V_HAT_Z', 's', 16, value)
self.add_field('N_HAT_X', 's', 16, value)
self.add_field('N_HAT_Y', 's', 16, value)
self.add_field('N_HAT_Z', 's', 16, value)
self.add_field('DEP_ANGLE', 'd', 7, value)
self.add_field('CT_TRACK_RANGE', 'd', 10, value)
self.add_field('ETA_0', 's', 16, value)
self.add_field('ETA_1', 's', 16, value)
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__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
self.add_field('EXITALT', 's', 6, value)
self.add_field('TMAP', 's', 7, value)
self.add_field('ROW_SPACING', 's', 7, value)
self.add_field('COL_SPACING', 's', 7, value)
self.add_field('SENSERIAL', 's', 6, value)
self.add_field('ABSWVER', 's', 7, value)
self.add_field('PATCH_TOT', 's', 4, value)
self.add_field('MTI_TOT', 's', 3, value)
class ACFTA_154(TREExtension):
_tag_value = 'ACFTA'
_data_type = ACFTA_154Type
class ACFTA_199Type(TREElement):
def __init__(self, value):
super(ACFTA_199Type, self).__init__()
self.add_field('AC_MSN_ID', 's', 20, value)
self.add_field('AC_TAIL_NO', 's', 10, value)
self.add_field('AC_TO', 's', 12, value)
self.add_field('SENSOR_ID_TYPE', 's', 4, value)
self.add_field('SENSOR_ID', 's', 6, value)
self.add_field('SCENE_SOURCE', 'd', 1, value)
self.add_field('SCNUM', 'd', 6, value)
self.add_field('PDATE', 'd', 8, value)
self.add_field('IMHOSTNO', 'd', 6, value)
self.add_field('IMREQID', 'd', 5, value)
self.add_field('MPLAN', 'd', 3, value)
self.add_field('ENTLOC', 's', 25, value)
self.add_field('ENTELV', 's', 6, value)
self.add_field('ELVUNIT', 's', 1, value)
def to_dict(self):
"""
Create a dictionary representation of the object.
Returns
-------
dict
"""
out = OrderedDict()
for fld in self._field_ordering:
val = getattr(self, fld)
if val is None or isinstance(val, string_types) or isinstance(val, (int, bytes)):
out[fld] = val
elif isinstance(val, TREElement):
out[fld] = val.to_dict()
else:
raise TypeError('Unhandled type {}'.format(type(val)))
return out
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class GRD(TREElement):
def __init__(self, value):
super(GRD, self).__init__()
self.add_field('ZVL', 'd', 10, value)
self.add_field('BAD', 's', 10, value)
self.add_field('LOD', 'd', 12, value)
self.add_field('LAD', 'd', 12, value)
self.add_field('LSO', 'd', 11, value)
self.add_field('PSO', 'd', 11, value)
class GRDPSBType(TREElement):
def __init__(self, value):
super(GRDPSBType, self).__init__()
self.add_field('NUM_GRDS', 'd', 2, value)
self.add_loop('GRDs', self.NUM_GRDS, GRD, value)
# -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
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 ACVT(TREElement):
def __init__(self, value):
super(ACVT, self).__init__()
self.add_field('UNIAAV', 's', 3, value)
if self.UNIAAV != '':
self.add_field('AAV', 'd', 5, value)
self.add_field('UNIAPV', 's', 3, value)
if self.UNIAPV != '':
self.add_field('APV', 'd', 5, value)
self.add_field('NUMPTS', 'd', 3, value)
self.add_loop('PTs', self.NUMPTS, PT, value)
class ACCVTBType(TREElement):
def __init__(self, value):
super(ACCVTBType, self).__init__()
self.add_field('NUMACVT', 'd', 2, value)
class CODE(TREElement):
def __init__(self, value):
super(CODE, self).__init__()
self.add_field('CODE_LEN', 'd', 1, value)
self.add_field('CODE', 's', self.CODE_LEN, value)
self.add_field('EQTYPE', 's', 1, value)
self.add_field('ESURN_LEN', 'd', 2, value)
self.add_field('ESURN', 's', self.ESURN_LEN, value)
self.add_field('DETAIL_LEN', 'd', 5, value)
if self.DETAIL_LEN > 0:
self.add_field('DETAIL_CMPR', 's', 1, value)
self.add_field('DETAIL', 's', self.DETAIL_LEN, value)
class CCINFAType(TREElement):
def __init__(self, value):
super(CCINFAType, self).__init__()
self.add_field('NUMCODE', 'd', 3, value)
self.add_loop('CODEs', self.NUMCODE, CODE, value)
class CCINFA(TREExtension):
_tag_value = 'CCINFA'
_data_type = CCINFAType