How to use the sarpy.io.complex.sicd_elements.base._IntegerDescriptor 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 / complex / sicd_elements / ImageData.py View on Github external
# descriptors
    PixelType = _StringEnumDescriptor(
        'PixelType', _PIXEL_TYPE_VALUES, _required, strict=True,
        docstring="The PixelType attribute which specifies the interpretation of the file data.")  # type: str
    AmpTable = _FloatArrayDescriptor(
        'AmpTable', _collections_tags, _required, strict=DEFAULT_STRICT,
        minimum_length=256, maximum_length=256,
        docstring="The amplitude look-up table. This is required if "
                  "`PixelType == 'AMP8I_PHS8I'`")  # type: numpy.ndarray
    NumRows = _IntegerDescriptor(
        'NumRows', _required, strict=True,
        docstring='The number of Rows in the product. May include zero rows.')  # type: int
    NumCols = _IntegerDescriptor(
        'NumCols', _required, strict=True,
        docstring='The number of Columns in the product. May include zero rows.')  # type: int
    FirstRow = _IntegerDescriptor(
        'FirstRow', _required, strict=DEFAULT_STRICT,
        docstring='Global row index of the first row in the product. '
                  'Equal to 0 in full image product.')  # type: int
    FirstCol = _IntegerDescriptor(
        'FirstCol', _required, strict=DEFAULT_STRICT,
        docstring='Global column index of the first column in the product. '
                  'Equal to 0 in full image product.')  # type: int
    FullImage = _SerializableDescriptor(
        'FullImage', FullImageType, _required, strict=DEFAULT_STRICT,
        docstring='Original full image product.')  # type: FullImageType
    SCPPixel = _SerializableDescriptor(
        'SCPPixel', RowColType, _required, strict=DEFAULT_STRICT,
        docstring='Scene Center Point pixel global row and column index. Should be located near the '
                  'center of the full image.')  # type: RowColType
    ValidData = _SerializableArrayDescriptor(
        'ValidData', RowColArrayElement, _collections_tags, _required, strict=DEFAULT_STRICT, minimum_length=3,
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / Display.py View on Github external
'SharpnessEnhancement', SharpnessEnhancementType, _required, strict=DEFAULT_STRICT,
        docstring='Sharpness enhancement.')  # type: SharpnessEnhancementType
    ColorSpaceTransform = _SerializableDescriptor(
        'ColorSpaceTransform', ColorSpaceTransformType, _required, strict=DEFAULT_STRICT,
        docstring='Color space transform.')  # type: ColorSpaceTransformType
    DynamicRangeAdjustment = _SerializableDescriptor(
        'DynamicRangeAdjustment', DynamicRangeAdjustmentType, _required, strict=DEFAULT_STRICT,
        docstring='Specifies the recommended ELT DRA overrides.')  # type: DynamicRangeAdjustmentType
    TonalTransferCurve = _SerializableDescriptor(
        'TonalTransferCurve', NewLookupTableType, _required, strict=DEFAULT_STRICT,
        docstring="The 1-D LUT element uses one or more 1-D LUTs to stretch or compress tone data "
                  "in valorous regions within a digital image's dynamic range. 1-D LUT can be "
                  "implemented using a Tonal Transfer Curve (TTC). There are 12 families of TTCs "
                  "- Range = [0, 11]. There are 64 members for each "
                  "family - Range=[0, 63].")  # type: NewLookupTableType
    band = _IntegerDescriptor(
        'band', _required, strict=DEFAULT_STRICT,
        docstring='The image band to which this applies.')

    def __init__(self, GeometricTransform=None, SharpnessEnhancement=None,
                 ColorSpaceTransform=None, DynamicRangeAdjustment=None, band=1, **kwargs):
        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
        if '_xml_ns_key' in kwargs:
            self._xml_ns_key = kwargs['_xml_ns_key']
        self.GeometricTransform = GeometricTransform
        self.SharpnessEnhancement = SharpnessEnhancement
        self.ColorSpaceTransform = ColorSpaceTransform
        self.DynamicRangeAdjustment = DynamicRangeAdjustment
        self.band = band
        super(InteractiveProcessingType, self).__init__(**kwargs)
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / Compression.py View on Github external
__author__ = "Thomas McCullough"


class J2KSubtype(Serializable):
    """
    The Jpeg 2000 subtype.
    """
    _fields = ('NumWaveletLevels', 'NumBands', 'LayerInfo')
    _required = ('NumWaveletLevels', 'NumBands')
    _collections_tags = {'LayerInfo': {'array': True, 'child_tag': 'Bitrate', 'size_attribute': 'numLayers'}}
    _numeric_format = {'LayerInfo': '0.16G'}
    # Descriptor
    NumWaveletLevels = _IntegerDescriptor(
        'NumWaveletLevels', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: int
    NumBands = _IntegerDescriptor(
        'NumBands', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: int
    LayerInfo = _FloatArrayDescriptor(
        'LayerInfo', _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='Original Layer Information. This is an array of bit rate target associated with each '
                  'layer. It may happen that the bit rate was not achieved due to data characteristics. '
                  '**Note -** for JPEG 2000 numerically loss-less quality, the bit rate for the final layer is '
                  'an expected value, based on performance.')  # type: Union[None, numpy.ndarray]

    def __init__(self, NumWaveletLevels=None, NumBands=None, LayerInfo=None, **kwargs):
        """

        Parameters
        ----------
        NumWaveletLevels : int
        NumBands : int
github ngageoint / sarpy / sarpy / io / product / sidd1_elements / Display.py View on Github external
self.XMin = XMin
        super(MonitorCompensationAppliedType, self).__init__(**kwargs)


class DRAHistogramOverridesType(Serializable):
    """
    Dynamic range adjustment overide parameters.
    """
    _fields = ('ClipMin', 'ClipMax')
    _required = ('ClipMin', 'ClipMax')
    # Descriptor
    ClipMin = _IntegerDescriptor(
        'ClipMin', _required, strict=DEFAULT_STRICT,
        docstring='Suggested override for the lower end-point of the display histogram in the '
                  'ELT DRA application. Referred to as Pmin in SIPS documentation.')  # type: int
    ClipMax = _IntegerDescriptor(
        'ClipMax', _required, strict=DEFAULT_STRICT,
        docstring='Suggested override for the upper end-point of the display histogram in the '
                  'ELT DRA application. Referred to as Pmax in SIPS documentation.')  # type: int

    def __init__(self, ClipMin=None, ClipMax=None, **kwargs):
        """

        Parameters
        ----------
        ClipMin : int
        ClipMax : int
        kwargs
        """

        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
github ngageoint / sarpy / sarpy / io / phase_history / cphd1_elements / CPHD.py View on Github external
class CPHDHeader(CPHDHeaderBase):
    _fields = (
        'XML_BLOCK_SIZE', 'XML_BLOCK_BYTE_OFFSET', 'SUPPORT_BLOCK_SIZE', 'SUPPORT_BLOCK_BYTE_OFFSET',
        'PVP_BLOCK_SIZE', 'PVP_BLOCK_BYTE_OFFSET', 'SIGNAL_BLOCK_SIZE', 'SIGNAL_BLOCK_BYTE_OFFSET',
        'CLASSIFICATION', 'RELEASE_INFO')
    _required = (
        'XML_BLOCK_SIZE', 'XML_BLOCK_BYTE_OFFSET', 'PVP_BLOCK_SIZE', 'PVP_BLOCK_BYTE_OFFSET',
        'SIGNAL_BLOCK_SIZE', 'SIGNAL_BLOCK_BYTE_OFFSET', 'CLASSIFICATION', 'RELEASE_INFO')
    # descriptor
    XML_BLOCK_SIZE = _IntegerDescriptor(
        'XML_BLOCK_SIZE', _required, strict=True,
        docstring='ize of the XML instance that describes the product in bytes. '
                  'Size does NOT include the 2 bytes of the section terminator.')  # type: int
    XML_BLOCK_BYTE_OFFSET = _IntegerDescriptor(
        'XML_BLOCK_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the XML block in bytes.')  # type: int
    SUPPORT_BLOCK_SIZE = _IntegerDescriptor(
        'SUPPORT_BLOCK_SIZE', _required, strict=True,
        docstring='Size of the Support block in bytes. Note - If the Support block is omitted, this '
                  'is not included.')  # type: int
    SUPPORT_BLOCK_BYTE_OFFSET = _IntegerDescriptor(
        'SUPPORT_BLOCK_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the Support block in bytes. Note - If the Support '
                  'block is omitted, this is not included.')  # type: int
    PVP_BLOCK_SIZE = _IntegerDescriptor(
        'PVP_BLOCK_SIZE', _required, strict=True,
        docstring='Size of the PVP block in bytes.')  # type: int
    PVP_BLOCK_BYTE_OFFSET = _IntegerDescriptor(
        'PVP_BLOCK_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the PVP block in bytes.')  # type: int
github ngageoint / sarpy / sarpy / io / phase_history / cphd0_3_elements / CPHD.py View on Github external
'XML_DATA_SIZE', _required, strict=True,
        docstring='Size of the XML Metadata in bytes. Does not include the 2 bytes '
                  'of the section terminator.')  # type: int
    XML_BYTE_OFFSET = _IntegerDescriptor(
        'XML_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the XML Metadata in bytes.')  # type: int
    VB_DATA_SIZE = _IntegerDescriptor(
        'VB_DATA_SIZE', _required, strict=True,
        docstring='Size of the Vector Based Metadata in bytes.')  # type: int
    VB_BYTE_OFFSET = _IntegerDescriptor(
        'VB_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the Vector Based Metadata in bytes.')  # type: int
    CPHD_DATA_SIZE = _IntegerDescriptor(
        'CPHD_DATA_SIZE', _required, strict=True,
        docstring='Size of the Compensated PHD arrays in bytes.')  # type: int
    CPHD_BYTE_OFFSET = _IntegerDescriptor(
        'CPHD_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the CPHD data in bytes.')  # type: int
    CLASSIFICATION = _StringDescriptor(
        'CLASSIFICATION', _required, strict=True, default_value='UNCLASSIFIED',
        docstring='Product classification information that is the human-readable banner.')  # type: str
    RELEASE_INFO = _StringDescriptor(
        'RELEASE_INFO', _required, strict=True, default_value='UNRESTRICTED',
        docstring='Product release information.')  # type: str

    def __init__(self, XML_DATA_SIZE=None, XML_BYTE_OFFSET=None,
                 VB_DATA_SIZE=None, VB_BYTE_OFFSET=None,
                 CPHD_DATA_SIZE=None, CPHD_BYTE_OFFSET=None,
                 CLASSIFICATION='UNCLASSIFIED', RELEASE_INFO='UNRESTRICTED'):
        self.XML_DATA_SIZE = XML_DATA_SIZE
        self.XML_BYTE_OFFSET = XML_BYTE_OFFSET
        self.VB_DATA_SIZE = VB_DATA_SIZE
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / ProductCreation.py View on Github external
'nonICmarkings', 'classifiedBy', 'compilationReason', 'derivativelyClassifiedBy',
        'classificationReason', 'nonUSControls', 'derivedFrom', 'declassDate',
        'declassEvent', 'declassException', 'typeOfExemptedSource', 'dateOfExemptedSource',
        'SecurityExtensions')
    _required = ('DESVersion', 'createDate', 'classification', 'ownerProducer')
    _collections_tags = {'SecurityExtensions': {'array': False, 'child_tag': 'SecurityExtension'}}
    _set_as_attribute = (
        'DESVersion', 'resourceElement', 'createDate', 'compliesWith',
        'classification', 'ownerProducer', 'SCIcontrols', 'SARIdentifier',
        'disseminationControls', 'FGIsourceOpen', 'FGIsourceProtected', 'releasableTo',
        'nonICmarkings', 'classifiedBy', 'compilationReason', 'derivativelyClassifiedBy',
        'classificationReason', 'nonUSControls', 'derivedFrom', 'declassDate',
        'declassEvent', 'declassException', 'typeOfExemptedSource', 'dateOfExemptedSource')
    _child_xml_ns_key = {key: 'ism' for key in _fields if key != 'SecurityExtensions'}
    # Descriptor
    DESVersion = _IntegerDescriptor(
        'DESVersion', _required, strict=DEFAULT_STRICT, default_value=13,
        docstring='The version number of the DES. Should there be multiple specified in an instance document '
                  'the one at the root node is the one that will apply to the entire document.')  # type: int
    createDate = _StringDescriptor(
        'createDate', _required, strict=DEFAULT_STRICT,
        docstring='This should be a date of format :code:`YYYY-MM-DD`, but this is not checked.')  # type: str
    compliesWith = _StringDescriptor(
        'compliesWith', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: Union[None, str]
    classification = _StringEnumDescriptor(
        'classification', ('U', 'C', 'R', 'S', 'TS'), _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str
    ownerProducer = _StringDescriptor(
        'ownerProducer', _required, strict=DEFAULT_STRICT,  # default_value='USA',
        docstring='')  # type: str
    SCIcontrols = _StringDescriptor(
github ngageoint / sarpy / sarpy / io / phase_history / cphd0_3_elements / CPHD.py View on Github external
_CPHD_SPECIFICATION_DATE = '2011-04-15T00:00:00Z'
_CPHD_SPECIFICATION_NAMESPACE = 'urn:CPHD:0.3'


#########
# CPHD header object

class CPHDHeader(CPHDHeaderBase):
    _fields = (
        'XML_DATA_SIZE', 'XML_BYTE_OFFSET', 'VB_DATA_SIZE', 'VB_BYTE_OFFSET',
        'CPHD_DATA_SIZE', 'CPHD_BYTE_OFFSET', 'CLASSIFICATION', 'RELEASE_INFO')
    _required = (
        'XML_DATA_SIZE', 'XML_BYTE_OFFSET', 'VB_DATA_SIZE', 'VB_BYTE_OFFSET',
        'CPHD_DATA_SIZE', 'CPHD_BYTE_OFFSET')
    # descriptor
    XML_DATA_SIZE = _IntegerDescriptor(
        'XML_DATA_SIZE', _required, strict=True,
        docstring='Size of the XML Metadata in bytes. Does not include the 2 bytes '
                  'of the section terminator.')  # type: int
    XML_BYTE_OFFSET = _IntegerDescriptor(
        'XML_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the XML Metadata in bytes.')  # type: int
    VB_DATA_SIZE = _IntegerDescriptor(
        'VB_DATA_SIZE', _required, strict=True,
        docstring='Size of the Vector Based Metadata in bytes.')  # type: int
    VB_BYTE_OFFSET = _IntegerDescriptor(
        'VB_BYTE_OFFSET', _required, strict=True,
        docstring='Offset to the first byte of the Vector Based Metadata in bytes.')  # type: int
    CPHD_DATA_SIZE = _IntegerDescriptor(
        'CPHD_DATA_SIZE', _required, strict=True,
        docstring='Size of the Compensated PHD arrays in bytes.')  # type: int
    CPHD_BYTE_OFFSET = _IntegerDescriptor(
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / Display.py View on Github external
_ParametersDescriptor, ParametersCollection, SerializableArray, _SerializableArrayDescriptor


__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"


#########
# NonInteractiveProcessing

class BandLUTType(NewLookupTableType):
    _fields = ('Predefined', 'Custom', 'k')
    _required = ('k', )
    _set_as_attribute = ('k', )
    # Descriptor
    k = _IntegerDescriptor(
        'k', _required, strict=DEFAULT_STRICT, bounds=(1, 2**32), default_value=1,
        docstring='The array index.')

    def __init__(self, Predefined=None, Custom=None, k=None, **kwargs):
        """

        Parameters
        ----------
        Predefined : sarpy.io.product.sidd2_elements.blocks.PredefinedLookupType
        Custom : sarpy.io.product.sidd2_elements.blocks.CustomLookupType
        k : int
        kwargs
        """

        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
github ngageoint / sarpy / sarpy / io / phase_history / cphd0_3_elements / Channel.py View on Github external
class ParametersType(Serializable):
    """
    Channel dependent parameters.
    """

    _fields = (
        'SRP_Index', 'NomTOARateSF', 'FxCtrNom', 'BWSavedNom', 'TOASavedNom',
        'TxAnt_Index', 'RcvAnt_Index', 'TWAnt_Index')
    _required = (
        'SRP_Index', 'NomTOARateSF', 'FxCtrNom', 'BWSavedNom', 'TOASavedNom')
    _numeric_format = {
        'NomTOARateSF': '0.16G', 'FxCtrNom': '0.16G', 'BWSavedNom': '0.16G',
        'TOASavedNom': '0.16G'}
    # descriptors
    SRP_Index = _IntegerDescriptor(
        'SRP_Index', _required, strict=DEFAULT_STRICT,
        docstring='Index to identify the SRP position function used for the '
                  'channel.')  # type: int
    NomTOARateSF = _FloatDescriptor(
        'NomTOARateSF', _required, strict=DEFAULT_STRICT,
        docstring='Scale factor to indicate the fraction of the Doppler spectrum '
                  'that is clear.')  # type: float
    FxCtrNom = _FloatDescriptor(
        'FxCtrNom', _required, strict=DEFAULT_STRICT,
        docstring='Nominal center transmit frequency associated with the channel (Hz). '
                  'For DomainType = TOA, FxCtrNom is the center frequency for all '
                  'vectors.')  # type: float
    BWSavedNom = _FloatDescriptor(
        'BWSavedNom', _required, strict=DEFAULT_STRICT,
        docstring='Nominal transmit bandwidth associated with the channel (Hz). '
                  'For DomainType = TOA, BWSavedNom is the bandwidth saved for all '