How to use the sarpy.io.complex.sicd_elements.base._StringEnumDescriptor 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 / product / sidd2_elements / blocks.py View on Github external
class FilterKernelType(Serializable):
    """
    The filter kernel parameters. Provides the specifics for **either** a predefined or custom
    filter kernel.
    """

    _fields = ('Predefined', 'Custom')
    _required = ()
    _choice = ({'required': True, 'collection': ('Predefined', 'Custom')}, )
    # Descriptor
    Predefined = _SerializableDescriptor(
        'Predefined', PredefinedFilterType, _required, strict=DEFAULT_STRICT,
        docstring='')  # type: PredefinedFilterType
    Custom = _StringEnumDescriptor(
        'Custom', ('GENERAL', 'FILTER BANK'), _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str

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

        Parameters
        ----------
        Predefined : None|PredefinedFilterType
        Custom : None|str
        kwargs
        """

        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
        if '_xml_ns_key' in kwargs:
github ngageoint / sarpy / sarpy / io / phase_history / cphd1_elements / Data.py View on Github external
class DataType(Serializable):
    """
    Parameters that describe binary data components contained in the product.
    """

    _fields = (
        'SignalArrayFormat', 'NumBytesPVP', 'NumCPHDChannels',
        'SignalCompressionID', 'Channels', 'NumSupportArrays', 'SupportArrays')
    _required = ('SignalArrayFormat', 'NumBytesPVP', 'Channels')
    _collections_tags = {
        'Channels': {'array': False, 'child_tag': 'Channel'},
        'SupportArrays': {'array': False, 'child_tag': 'SupportArray'}}
    # descriptors
    SignalArrayFormat = _StringEnumDescriptor(
        'SignalArrayFormat', ('CI2', 'CI4', 'CF8'), _required, strict=DEFAULT_STRICT,
        docstring='Signal Array sample binary format of the CPHD signal arrays in standard '
                  '(i.e. uncompressed) format, where `CI2` denotes a 1 byte signed integer '
                  "parameter, 2's complement format, and 2 Bytes Per Sample; `CI4` denotes "
                  "a 2 byte signed integer parameter, 2's complement format, and "
                  "4 Bytes Per Sample; `CF8` denotes a 4 byte floating point parameter, and "
                  "8 Bytes Per Sample.")  # type: str
    NumBytesPVP = _IntegerDescriptor(
        'NumBytesPVP', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Number of bytes per set of Per Vector Parameters, where there is '
                  'one set of PVPs for each CPHD signal vector')  # type: int
    SignalCompressionID = _StringDescriptor(
        'SignalCompressionID', _required, strict=DEFAULT_STRICT,
        docstring='Parameter that indicates the signal arrays are in compressed format. Value '
                  'identifies the method of decompression. Parameter included if and only if '
                  'the signal arrays are in compressed format.')  # type: str
github ngageoint / sarpy / sarpy / io / complex / sicd_elements / SCPCOA.py View on Github external
_SIDE_OF_TRACK_VALUES = ('L', 'R')
    # descriptors
    SCPTime = _FloatDescriptor(
        'SCPTime', _required, strict=DEFAULT_STRICT,
        docstring='*Center Of Aperture time for the SCP (t_COA_SCP)*, relative to collection '
                  'start in seconds.')  # type: float
    ARPPos = _SerializableDescriptor(
        'ARPPos', XYZType, _required, strict=DEFAULT_STRICT,
        docstring='Aperture position at *t_COA_SCP* in ECF coordinates.')  # type: XYZType
    ARPVel = _SerializableDescriptor(
        'ARPVel', XYZType, _required, strict=DEFAULT_STRICT,
        docstring='ARP Velocity at *t_COA_SCP* in ECF coordinates.')  # type: XYZType
    ARPAcc = _SerializableDescriptor(
        'ARPAcc', XYZType, _required, strict=DEFAULT_STRICT,
        docstring='ARP Acceleration at *t_COA_SCP* in ECF coordinates.')  # type: XYZType
    SideOfTrack = _StringEnumDescriptor(
        'SideOfTrack', _SIDE_OF_TRACK_VALUES, _required, strict=DEFAULT_STRICT,
        docstring='Side of track.')  # type: str
    SlantRange = _FloatDescriptor(
        'SlantRange', _required, strict=DEFAULT_STRICT,
        docstring='Slant range from the aperture to the *SCP* in meters.')  # type: float
    GroundRange = _FloatDescriptor(
        'GroundRange', _required, strict=DEFAULT_STRICT,
        docstring='Ground Range from the aperture nadir to the *SCP*. Distance measured along spherical earth model '
                  'passing through the *SCP* in meters.')  # type: float
    DopplerConeAng = _FloatDescriptor(
        'DopplerConeAng', _required, strict=DEFAULT_STRICT,
        docstring='The Doppler Cone Angle to SCP at *t_COA_SCP* in degrees.')  # type: float
    GrazeAng = _FloatDescriptor(
        'GrazeAng', _required, strict=DEFAULT_STRICT, bounds=(0., 90.),
        docstring='Grazing Angle between the SCP *Line of Sight (LOS)* and *Earth Tangent Plane (ETP)*.')  # type: float
    IncidenceAng = _FloatDescriptor(
github ngageoint / sarpy / sarpy / io / complex / sicd_elements / Radiometric.py View on Github external
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"


# noinspection PyPep8Naming
class NoiseLevelType_(Serializable):
    """
    Noise level structure.
    """

    _fields = ('NoiseLevelType', 'NoisePoly')
    _required = _fields
    # class variables
    _NOISE_LEVEL_TYPE_VALUES = ('ABSOLUTE', 'RELATIVE')
    # descriptors
    NoiseLevelType = _StringEnumDescriptor(
        'NoiseLevelType', _NOISE_LEVEL_TYPE_VALUES, _required, strict=DEFAULT_STRICT,
        docstring='Indicates that the noise power polynomial yields either absolute power level or power '
                  'level relative to the *SCP* pixel location.')  # type: str
    NoisePoly = _SerializableDescriptor(
        'NoisePoly', Poly2DType, _required, strict=DEFAULT_STRICT,
        docstring='Polynomial coefficients that yield thermal noise power *(in dB)* in a pixel as a function of '
                  'image row coordinate *(variable 1)* and column coordinate *(variable 2)*.')  # type: Poly2DType

    def __init__(self, NoiseLevelType=None, NoisePoly=None, **kwargs):
        """

        Parameters
        ----------
        NoiseLevelType : str
        NoisePoly : Poly2DType|numpy.ndarray|list|tuple
        kwargs : dict
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / Display.py View on Github external
if '_xml_ns_key' in kwargs:
            self._xml_ns_key = kwargs['_xml_ns_key']
        self.AntiAlias = AntiAlias
        self.Interpolation = Interpolation
        super(ScalingType, self).__init__(**kwargs)


class OrientationType(Serializable):
    """
    Parameters describing the default orientation of the product.
    """

    _fields = ('ShadowDirection', )
    _required = _fields
    # Descriptor
    ShadowDirection = _StringEnumDescriptor(
        'ShadowDirection', ('UP', 'DOWN', 'LEFT', 'RIGHT', 'ARBITRARY'), _required,
        strict=DEFAULT_STRICT, default_value='DOWN',
        docstring='Describes the shadow direction relative to the '
                  'pixels in the file.')  # type: str

    def __init__(self, ShadowDirection='DOWN', **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.ShadowDirection = ShadowDirection
        super(OrientationType, self).__init__(**kwargs)


class GeometricTransformType(Serializable):
    """
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / DigitalElevationData.py View on Github external
"""
    _fields = (
        'CoordinateSystemType', 'GeodeticDatum', 'ReferenceEllipsoid',
        'VerticalDatum', 'SoundingDatum', 'FalseOrigin', 'UTMGridZoneNumber')
    _required = (
        'CoordinateSystemType', 'GeodeticDatum', 'ReferenceEllipsoid',
        'VerticalDatum', 'SoundingDatum', 'FalseOrigin')
    # Descriptor
    CoordinateSystemType = _StringEnumDescriptor(
        'CoordinateSystemType', ('GGS', 'UTM'), _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str
    GeodeticDatum = _StringEnumDescriptor(
        'GeodeticDatum', ('World Geodetic System 1984', ), _required, strict=DEFAULT_STRICT,
        default_value='World Geodetic System 1984',
        docstring='')  # type: str
    ReferenceEllipsoid = _StringEnumDescriptor(
        'ReferenceEllipsoid', ('World Geodetic System 1984', ), _required, strict=DEFAULT_STRICT,
        default_value='World Geodetic System 1984',
        docstring='')  # type: str
    VerticalDatum = _StringEnumDescriptor(
        'VerticalDatum', ('Mean Sea Level', ), _required, strict=DEFAULT_STRICT,
        default_value='Mean Sea Level',
        docstring='')  # type: str
    SoundingDatum = _StringEnumDescriptor(
        'SoundingDatum', ('Mean Sea Level', ), _required, strict=DEFAULT_STRICT,
        default_value='Mean Sea Level',
        docstring='')  # type: str
    FalseOrigin = _IntegerDescriptor(
        'FalseOrigin', _required, strict=DEFAULT_STRICT,
        docstring='Z values false origin.')  # type: int
    UTMGridZoneNumber = _IntegerDescriptor(
        'UTMGridZoneNumber', _required, strict=DEFAULT_STRICT,
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / DigitalElevationData.py View on Github external
class GeopositioningType(Serializable):
    """
    Describes the absolute coordinate system to which the data is referenced.
    """
    _fields = (
        'CoordinateSystemType', 'GeodeticDatum', 'ReferenceEllipsoid',
        'VerticalDatum', 'SoundingDatum', 'FalseOrigin', 'UTMGridZoneNumber')
    _required = (
        'CoordinateSystemType', 'GeodeticDatum', 'ReferenceEllipsoid',
        'VerticalDatum', 'SoundingDatum', 'FalseOrigin')
    # Descriptor
    CoordinateSystemType = _StringEnumDescriptor(
        'CoordinateSystemType', ('GGS', 'UTM'), _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str
    GeodeticDatum = _StringEnumDescriptor(
        'GeodeticDatum', ('World Geodetic System 1984', ), _required, strict=DEFAULT_STRICT,
        default_value='World Geodetic System 1984',
        docstring='')  # type: str
    ReferenceEllipsoid = _StringEnumDescriptor(
        'ReferenceEllipsoid', ('World Geodetic System 1984', ), _required, strict=DEFAULT_STRICT,
        default_value='World Geodetic System 1984',
        docstring='')  # type: str
    VerticalDatum = _StringEnumDescriptor(
        'VerticalDatum', ('Mean Sea Level', ), _required, strict=DEFAULT_STRICT,
        default_value='Mean Sea Level',
        docstring='')  # type: str
    SoundingDatum = _StringEnumDescriptor(
        'SoundingDatum', ('Mean Sea Level', ), _required, strict=DEFAULT_STRICT,
        default_value='Mean Sea Level',
        docstring='')  # type: str
    FalseOrigin = _IntegerDescriptor(
github ngageoint / sarpy / sarpy / io / product / sidd1_elements / Display.py View on Github external
'PixelType', 'RemapInformation', 'MagnificationMethod', 'DecimationMethod',
        'DRAHistogramOverrides', 'MonitorCompensationApplied', 'DisplayExtensions')
    _required = ('PixelType', )
    _collections_tags = {
        'DisplayExtensions': {'array': False, 'child_tag': 'DisplayExtension'}}
    # Descriptors
    PixelType = _StringEnumDescriptor(
        'PixelType', ('MONO8I', 'MONO8LU', 'MONO16I', 'RGBL8U', 'RGB24I'),
        _required, strict=DEFAULT_STRICT,
        docstring='Enumeration of the pixel type. Definition in '
                  'Design and Exploitation document.')  # type: str
    RemapInformation = _SerializableDescriptor(
        'RemapInformation', RemapChoiceType, _required, strict=DEFAULT_STRICT,
        docstring='Information regarding the encoding of the pixel data. '
                  'Used for 8-bit pixel types.')  # type: Union[None, RemapChoiceType]
    MagnificationMethod = _StringEnumDescriptor(
        'MagnificationMethod', ('NEAREST_NEIGHBOR', 'BILINEAR', 'LAGRANGE'),
        _required, strict=DEFAULT_STRICT,
        docstring='Recommended ELT magnification method for this data.')  # type: Union[None, str]
    DecimationMethod = _StringEnumDescriptor(
        'DecimationMethod', ('NEAREST_NEIGHBOR', 'BILINEAR', 'BRIGHTEST_PIXEL', 'LAGRANGE'),
        _required, strict=DEFAULT_STRICT,
        docstring='Recommended ELT decimation method for this data. Also used as default for '
                  'reduced resolution dataset generation (if applicable).')  # type: Union[None, str]
    DRAHistogramOverrides = _SerializableDescriptor(
        'DRAHistogramOverrides', DRAHistogramOverridesType, _required, strict=DEFAULT_STRICT,
        docstring='Recommended ELT DRA overrides.')  # type: Union[None, DRAHistogramOverridesType]
    MonitorCompensationApplied = _SerializableDescriptor(
        'MonitorCompensationApplied', MonitorCompensationAppliedType, _required, strict=DEFAULT_STRICT,
        docstring='Describes monitor compensation that may have been applied to the product '
                  'during processing.')  # type: Union[None, MonitorCompensationAppliedType]
    DisplayExtensions = _ParametersDescriptor(
github ngageoint / sarpy / sarpy / io / phase_history / cphd1_elements / Global.py View on Github external
self._xml_ns_key = kwargs['_xml_ns_key']
        self.TECV = TECV
        self.F2Height = F2Height
        super(IonoParametersType, self).__init__(**kwargs)


class GlobalType(Serializable):
    """
    The Global type definition.
    """

    _fields = (
        'DomainType', 'SGN', 'Timeline', 'FxBand', 'TOASwath', 'TropoParameters', 'IonoParameters')
    _required = ('DomainType', 'SGN', 'Timeline', 'FxBand', 'TOASwath')
    # descriptors
    DomainType = _StringEnumDescriptor(
        'DomainType', ('FX', 'TOA'), _required, strict=DEFAULT_STRICT,
        docstring='Indicates the domain represented by the sample dimension of the '
                  'CPHD signal array(s), where "FX" denotes Transmit Frequency, and '
                  '"TOA" denotes Difference in Time of Arrival')  # type: str
    SGN = _IntegerEnumDescriptor(
        'SGN', (-1, 1), _required, strict=DEFAULT_STRICT,
        docstring='Phase SGN applied to compute target signal phase as a function of '
                  r'target :math:`\Delta TOA^{TGT}`. Target phase in cycles. '
                  r'For simple phase model :math:`Phase(fx) = SGN \times fx \times \Delta TOA^{TGT}` '
                  r'In TOA domain, phase of the mainlobe peak '
                  r':math:`Phase(\Delta TOA^{TGT}) = SGN \times fx_C \times \Delta TOA^{TGT}`'
                  '.')  # type: int
    Timeline = _SerializableDescriptor(
        'Timeline', TimelineType, _required, strict=DEFAULT_STRICT,
        docstring='Parameters that describe the collection times for the data contained '
                  'in the product')  # type: TimelineType
github ngageoint / sarpy / sarpy / io / product / sidd2_elements / DigitalElevationData.py View on Github external
_required = (
        'CoordinateSystemType', 'GeodeticDatum', 'ReferenceEllipsoid',
        'VerticalDatum', 'SoundingDatum', 'FalseOrigin')
    # Descriptor
    CoordinateSystemType = _StringEnumDescriptor(
        'CoordinateSystemType', ('GGS', 'UTM'), _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str
    GeodeticDatum = _StringEnumDescriptor(
        'GeodeticDatum', ('World Geodetic System 1984', ), _required, strict=DEFAULT_STRICT,
        default_value='World Geodetic System 1984',
        docstring='')  # type: str
    ReferenceEllipsoid = _StringEnumDescriptor(
        'ReferenceEllipsoid', ('World Geodetic System 1984', ), _required, strict=DEFAULT_STRICT,
        default_value='World Geodetic System 1984',
        docstring='')  # type: str
    VerticalDatum = _StringEnumDescriptor(
        'VerticalDatum', ('Mean Sea Level', ), _required, strict=DEFAULT_STRICT,
        default_value='Mean Sea Level',
        docstring='')  # type: str
    SoundingDatum = _StringEnumDescriptor(
        'SoundingDatum', ('Mean Sea Level', ), _required, strict=DEFAULT_STRICT,
        default_value='Mean Sea Level',
        docstring='')  # type: str
    FalseOrigin = _IntegerDescriptor(
        'FalseOrigin', _required, strict=DEFAULT_STRICT,
        docstring='Z values false origin.')  # type: int
    UTMGridZoneNumber = _IntegerDescriptor(
        'UTMGridZoneNumber', _required, strict=DEFAULT_STRICT,
        docstring='Gride zone number, required for UTM, not include for GCS. '
                  '**Values -** `+001` to `+060` (northern hemisphere) and `-001` to `-060` '
                  '(southern hemisphere)')  # type: int