コード例 #1
0
class FxBandType(Serializable, Arrayable):
    """
    Parameters that describe the FX frequency limits for the signal array(s)
    contained in the product.
    """

    _fields = ('FxMin', 'FxMax')
    _required = _fields
    _numeric_format = {fld: '0.16G' for fld in _fields}
    # descriptors
    FxMin = _FloatDescriptor(
        'FxMin',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Minimum fx value for any signal vector in the product in '
        'Hz.')  # type: float
    FxMax = _FloatDescriptor(
        'FxMax',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Maximum fx value for any signal vector in the product in '
        'Hz.')  # type: float

    def __init__(self, FxMin=None, FxMax=None, **kwargs):
        """

        Parameters
        ----------
        FxMin : float
        FxMax : float
        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.FxMin = FxMin
        self.FxMax = FxMax
        super(FxBandType, self).__init__(**kwargs)

    def get_array(self, dtype=numpy.float64):
        return numpy.array([self.FxMin, self.FxMax], dtype=dtype)

    @classmethod
    def from_array(cls, array):
        # type: (Union[numpy.ndarray, list, tuple]) -> FxBandType
        if array is None:
            return None
        if isinstance(array, (numpy.ndarray, list, tuple)):
            if len(array) < 2:
                raise ValueError(
                    'Expected array to be of length 2, and received {}'.format(
                        array))
            return cls(FxMin=array[0], FxMax=array[1])
        raise ValueError(
            'Expected array to be numpy.ndarray, list, or tuple, got {}'.
            format(type(array)))
コード例 #2
0
ファイル: Channel.py プロジェクト: johnhhenderson/sarpy
class NoiseLevelType(Serializable):
    """
    Thermal noise level for the reference signal vector.
    """

    _fields = ('PNRef', 'BNRef', 'FxNoiseProfile')
    _required = ('PNRef', 'BNRef')
    _collections_tags = {
        'FxNoiseProfile': {
            'array': True,
            'child_tag': 'Point'
        }
    }
    _numeric_format = {'PNRef': '0.16G', 'BNRef': '0.16G'}
    # descriptors
    PNRef = _FloatDescriptor(
        'PNRef',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Noise power level for thermal noise.')  # type: float
    BNRef = _FloatDescriptor(
        'BNRef',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 1),
        docstring='Noise Equivalent BW for noise signal. Bandwidth BN is '
        'expressed relative to the sample bandwidth.')  # type: float
    FxNoiseProfile = _SerializableArrayDescriptor(
        'FxNoiseProfile',
        FxPNPointType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        minimum_length=2,
        array_extension=FxNoiseProfileType,
        docstring=
        'FX Domain Noise Level Profile. Power level for thermal noise (PN) vs. FX '
        'frequency values.'
    )  # type: Union[None, FxNoiseProfileType, List[FxPNPointType]]

    def __init__(self, PNRef=None, BNRef=None, FxNoiseProfile=None, **kwargs):
        """

        Parameters
        ----------
        PNRef : float
        BNRef : float
        FxNoiseProfile : FxNoiseProfileType|List[FxPNPointType]
        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.PNRef = PNRef
        self.BNRef = BNRef
        self.FxNoiseProfile = FxNoiseProfile
        super(NoiseLevelType, self).__init__(**kwargs)
コード例 #3
0
class IonoParametersType(Serializable):
    """
    Parameters used to compute propagation effects due to the ionosphere.
    """

    _fields = ('TECV', 'F2Height')
    _required = ('TECV', )
    _numeric_format = {fld: '0.16G' for fld in _fields}
    # descriptor
    TECV = _FloatDescriptor(
        'TECV', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Total Electron Content (TEC) integrated along TECU the Vertical (V), '
                  r'in units where :math:`1 TECU = 10^{16} e^{-}/m^{2}`')  # type: float
    F2Height = _FloatDescriptor(
        'F2Height', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='The F2 height of the ionosphere, in '
                  'meters.')  # type: Union[None, float]

    def __init__(self, TECV=None, F2Height=None, **kwargs):
        """

        Parameters
        ----------
        TECV : float
        F2Height : None|float
        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.TECV = TECV
        self.F2Height = F2Height
        super(IonoParametersType, self).__init__(**kwargs)
コード例 #4
0
class TOASwathType(Serializable, Arrayable):
    """
    Parameters that describe the time-of-arrival (TOA) swath limits for the signal
    array(s) contained in the product.
    """

    _fields = ('TOAMin', 'TOAMax')
    _required = _fields
    _numeric_format = {fld: '0.16G' for fld in _fields}
    # descriptors
    TOAMin = _FloatDescriptor(
        'TOAMin',
        _required,
        strict=DEFAULT_STRICT,
        docstring=r'Minimum :math:`\Delta TOA` value for any signal vector in '
        'the product, in seconds.')  # type: float
    TOAMax = _FloatDescriptor(
        'TOAMax',
        _required,
        strict=DEFAULT_STRICT,
        docstring=r'Maximum :math:`\Delta TOA` value for any signal vector in '
        'the product, in seconds.')  # type: float

    def __init__(self, TOAMin=None, TOAMax=None, **kwargs):
        """

        Parameters
        ----------
        TOAMin : float
        TOAMax : float
        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.TOAMin = TOAMin
        self.TOAMax = TOAMax
        super(TOASwathType, self).__init__(**kwargs)

    def get_array(self, dtype=numpy.float64):
        return numpy.array([self.TOAMin, self.TOAMax], dtype=dtype)

    @classmethod
    def from_array(cls, array):
        # type: (Union[numpy.ndarray, list, tuple]) -> TOASwathType
        if array is None:
            return None
        if isinstance(array, (numpy.ndarray, list, tuple)):
            if len(array) < 2:
                raise ValueError(
                    'Expected array to be of length 2, and received {}'.format(
                        array))
            return cls(TOAMin=array[0], TOAMax=array[1])
        raise ValueError(
            'Expected array to be numpy.ndarray, list, or tuple, got {}'.
            format(type(array)))
コード例 #5
0
class GeographicCoordinatesType(Serializable):
    """
    Describes the Local Geographic Coordinate system linking row/column to the absolute
    geographic coordinate (lat/lon).
    """

    _fields = ('LongitudeDensity', 'LatitudeDensity', 'ReferenceOrigin')
    _required = ('LongitudeDensity', 'LatitudeDensity', 'ReferenceOrigin')
    _numeric_format = {'LongitudeDensity': '0.16G', 'LatitudeDensity': '0.16G'}
    # Descriptor
    LongitudeDensity = _FloatDescriptor(
        'LongitudeDensity',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Pixel ground spacing in E/W direction that is the number of pixels '
        'or element intervals in 360 degrees.')  # type: float
    LatitudeDensity = _FloatDescriptor(
        'LatitudeDensity',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Pixel ground spacing in N/S direction that is the number of pixels '
        'or element intervals in 360 degrees.')  # type: float
    ReferenceOrigin = _SerializableDescriptor(
        'ReferenceOrigin',
        LatLonType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Northwest corner Latitude/Longitude - product NW corner'
    )  # type: LatLonType

    def __init__(self,
                 LongitudeDensity=None,
                 LatitudeDensity=None,
                 ReferenceOrigin=None,
                 **kwargs):
        """

        Parameters
        ----------
        LongitudeDensity : float
        LatitudeDensity : float
        ReferenceOrigin : LatLonType|numpy.ndarray|list|tuple
        kwargs
        """

        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
        self.LongitudeDensity = LongitudeDensity
        self.LatitudeDensity = LatitudeDensity
        self.ReferenceOrigin = ReferenceOrigin
        super(GeographicCoordinatesType, self).__init__(**kwargs)
コード例 #6
0
class TimelineType(Serializable):
    """
    Parameters that describe the collection times for the data contained in the product.
    """

    _fields = ('CollectionStart', 'RcvCollectionStart', 'TxTime1', 'TxTime2')
    _required = ('CollectionStart', 'TxTime1', 'TxTime2')
    _numeric_format = {'TxTime1': '0.16G', 'TxTime2': '0.16G'}
    # descriptors
    CollectionStart = _DateTimeDescriptor(
        'CollectionStart', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us',
        docstring='Collection Start date and time (UTC). Time reference used for times '
                  'measured from collection start (i.e. slow time t = 0). For bistatic '
                  'collections, the time is the transmit platform collection '
                  'start time. The default display precision is microseconds, but this '
                  'does not that accuracy in value.')  # type: numpy.datetime64
    RcvCollectionStart = _DateTimeDescriptor(
        'RcvCollectionStart', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us',
        docstring='Receive only platform collection date and start time.')  # type: numpy.datetime64
    TxTime1 = _FloatDescriptor(
        'TxTime1', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Earliest TxTime value for any signal vector in the product. '
                  'Time relative to Collection Start in seconds.')  # type: float
    TxTime2 = _FloatDescriptor(
        'TxTime2', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Latest TxTime value for any signal vector in the product. '
                  'Time relative to Collection Start in seconds.')  # type: float

    def __init__(self, CollectionStart=None, RcvCollectionStart=None, TxTime1=None, TxTime2=None, **kwargs):
        """

        Parameters
        ----------
        CollectionStart : numpy.datetime64|datetime|date|str
        RcvCollectionStart : None|numpy.datetime64|datetime|date|str
        TxTime1 : float
        TxTime2 : float
        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.CollectionStart = CollectionStart
        self.RcvCollectionStart = RcvCollectionStart
        self.TxTime1 = TxTime1
        self.TxTime2 = TxTime2
        super(TimelineType, self).__init__(**kwargs)
コード例 #7
0
class TropoParametersType(Serializable):
    """
    Parameters used to compute the propagation delay due to the troposphere.
    """

    _fields = ('N0', 'RefHeight')
    _required = _fields
    _numeric_format = {'No': '0.16G'}
    # descriptors
    N0 = _FloatDescriptor(
        'N0', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Refractivity value of the troposphere for the imaged scene used '
                  'to form the product (dimensionless). Value at the IARP '
                  'location.')  # type: float
    RefHeight = _StringEnumDescriptor(
        'RefHeight', ('IARP', 'ZERO'), _required, strict=DEFAULT_STRICT,
        docstring='Reference Height for the `N0` value.')  # type: str

    def __init__(self, N0=None, RefHeight=None, **kwargs):
        """

        Parameters
        ----------
        N0 : float
        RefHeight : str
        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.N0 = N0
        self.RefHeight = RefHeight
        super(TropoParametersType, self).__init__(**kwargs)
コード例 #8
0
ファイル: Annotations.py プロジェクト: johnhhenderson/sarpy
class ParameterType(Serializable):
    """
    The parameter type.
    """

    _fields = ('ParameterName', 'Value')
    _required = _fields
    _numeric_format = {'Value': '0.16G'}
    # Descriptor
    ParameterName = _StringDescriptor(
        'ParameterName', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str
    Value = _FloatDescriptor(
        'Value', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: float

    def __init__(self, ParameterName=None, Value=None, **kwargs):
        """

        Parameters
        ----------
        ParameterName : str
        Value : float
        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.ParameterName = ParameterName
        self.Value = Value
        super(ParameterType, self).__init__(**kwargs)
コード例 #9
0
ファイル: Annotations.py プロジェクト: johnhhenderson/sarpy
class PrimeMeridianType(Serializable):
    """
    The prime meridian location.
    """

    _fields = ('Name', 'Longitude')
    _required = _fields
    _numeric_format = {'Longitude': '0.16G'}
    # Descriptor
    Name = _StringDescriptor(
        'Name', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: str
    Longitude = _FloatDescriptor(
        'Longitude', _required, strict=DEFAULT_STRICT,
        docstring='')  # type: float

    def __init__(self, Name=None, Longitude=None, **kwargs):
        """

        Parameters
        ----------
        Name : str
        Longitude : float
        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.Name = Name
        self.Longitude = Longitude
        super(PrimeMeridianType, self).__init__(**kwargs)
コード例 #10
0
ファイル: Annotations.py プロジェクト: nyulacska/sarpy
class SpheroidType(Serializable):
    """

    """
    _fields = ('SpheroidName', 'SemiMajorAxis', 'InverseFlattening')
    _required = _fields
    _numeric_format = {'SemiMajorAxis': '0.16G', 'InverseFlattening': '0.16G'}
    # Descriptor
    SpheroidName = _StringDescriptor('SpheroidName',
                                     _required,
                                     strict=DEFAULT_STRICT,
                                     docstring='')  # type: str
    SemiMajorAxis = _FloatDescriptor('SemiMajorAxis',
                                     _required,
                                     strict=DEFAULT_STRICT,
                                     docstring='')  # type: float
    InverseFlattening = _FloatDescriptor('InverseFlattening',
                                         _required,
                                         strict=DEFAULT_STRICT,
                                         docstring='')  # type: float

    def __init__(self,
                 SpheroidName=None,
                 SemiMajorAxis=None,
                 InverseFlattening=None,
                 **kwargs):
        """

        Parameters
        ----------
        SpheroidName : str
        SemiMajorAxis : float
        InverseFlattening : float
        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.SpheroidName = SpheroidName
        self.SemiMajorAxis = SemiMajorAxis
        self.InverseFlattening = InverseFlattening
        super(SpheroidType, self).__init__(**kwargs)
コード例 #11
0
ファイル: Measurement.py プロジェクト: johnhhenderson/sarpy
class CylindricalProjectionType(MeasurableProjectionType):
    """
    Cylindrical mapping of the pixel grid.
    """

    _fields = ('ReferencePoint', 'SampleSpacing', 'TimeCOAPoly',
               'StripmapDirection', 'CurvatureRadius')
    _required = ('ReferencePoint', 'SampleSpacing', 'TimeCOAPoly',
                 'StripmapDirection')
    _numeric_format = {'CurvatureRadius': '0.16G'}
    # Descriptor
    StripmapDirection = _SerializableDescriptor(
        'StripmapDirection',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Along stripmap direction.')  # type: XYZType
    CurvatureRadius = _FloatDescriptor(
        'CurvatureRadius',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Radius of Curvature defined at scene center.  If not present, the radius of '
        'curvature will be derived based upon the equations provided in the '
        'Design and Exploitation Document')  # type: Union[None, float]

    def __init__(self,
                 ReferencePoint=None,
                 SampleSpacing=None,
                 TimeCOAPoly=None,
                 StripmapDirection=None,
                 CurvatureRadius=None,
                 **kwargs):
        """

        Parameters
        ----------
        ReferencePoint : ReferencePointType
        SampleSpacing : RowColDoubleType|numpy.ndarray|list|tuple
        TimeCOAPoly : Poly2DType|numpy.ndarray|list|tuple
        StripmapDirection : XYZType|numpy.ndarray|list|tuple
        CurvatureRadius : None|float
        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']
        super(CylindricalProjectionType,
              self).__init__(ReferencePoint=ReferencePoint,
                             SampleSpacing=SampleSpacing,
                             TimeCOAPoly=TimeCOAPoly,
                             **kwargs)
        self.StripmapDirection = StripmapDirection
        self.CurvatureRadius = CurvatureRadius
コード例 #12
0
class BistaticRadarSensorType(Serializable):
    """
    Error statistics for a single radar platform.
    """

    _fields = ('ClockFreqSF', 'CollectionStartTime')
    _required = ('CollectionStartTime', )
    _numeric_format = {'ClockFreqSF': '0.16G', 'CollectionStartTime': '0.16G'}
    # descriptors
    ClockFreqSF = _FloatDescriptor(
        'ClockFreqSF',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Payload clock frequency scale factor standard deviation, '
        r'where :math:`SF = (\Delta f)/f_0`.')  # type: float
    CollectionStartTime = _FloatDescriptor(
        'CollectionStartTime',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Collection Start time error standard deviation, '
        'in seconds.')  # type: float

    def __init__(self, ClockFreqSF=None, CollectionStartTime=None, **kwargs):
        """

        Parameters
        ----------
        ClockFreqSF : float
        CollectionStartTime : float
        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.ClockFreqSF = ClockFreqSF
        self.CollectionStartTime = CollectionStartTime
        super(BistaticRadarSensorType, self).__init__(**kwargs)
コード例 #13
0
ファイル: Antenna.py プロジェクト: johnhhenderson/sarpy
class HPBWType(Serializable):
    """
    Half power beamwidth parameters.
    """

    _fields = ('DCX', 'DCY')
    _required = _fields
    _numeric_format = {'DCX': '0.16G', 'DCY': '0.16G'}
    # descriptors
    DCX = _FloatDescriptor(
        'DCX',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Half power beamwidth in the X-axis direction cosine '
        '(DCX).')  # type: float
    DCY = _FloatDescriptor(
        'DCY',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Half power beamwidth in the Y -axis direction cosine '
        '(DCY).')  # type: float

    def __init__(self, DCX=None, DCY=None, **kwargs):
        """

        Parameters
        ----------
        DCX : float
        DCY : float
        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.DCX = DCX
        self.DCY = DCY
        super(HPBWType, self).__init__(**kwargs)
コード例 #14
0
ファイル: Display.py プロジェクト: nyulacska/sarpy
class MonitorCompensationAppliedType(Serializable):
    """

    """
    _fields = ('Gamma', 'XMin')
    _required = ('Gamma', 'XMin')
    _numeric_format = {key: '0.16G' for key in _fields}
    # Descriptor
    Gamma = _FloatDescriptor(
        'Gamma',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Gamma value for monitor compensation pre-applied to the image.'
    )  # type: float
    XMin = _FloatDescriptor(
        'XMin',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Xmin value for monitor compensation pre-applied to the image.'
    )  # type: float

    def __init__(self, Gamma=None, XMin=None, **kwargs):
        """

        Parameters
        ----------
        Gamma : float
        XMin : float
        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.Gamma = Gamma
        self.XMin = XMin
        super(MonitorCompensationAppliedType, self).__init__(**kwargs)
コード例 #15
0
ファイル: Display.py プロジェクト: LordHui/sarpy
class DRAOverridesType(Serializable):
    """
    The dynamic range adjustment overrides.
    """
    _fields = ('Subtractor', 'Multiplier')
    _required = _fields
    _numeric_format = {key: '0.16G' for key in _fields}
    # Descriptor
    Subtractor = _FloatDescriptor(
        'Subtractor',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 2047),
        docstring='Subtractor value used to reduce haze in the image.'
    )  # type: float
    Multiplier = _FloatDescriptor(
        'Multiplier',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 2047),
        docstring='Multiplier value used to reduce haze in the image.'
    )  # type: float

    def __init__(self, Subtractor=None, Multiplier=None, **kwargs):
        """

        Parameters
        ----------
        Subtractor : float
        Multiplier : float
        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.Subtractor = Subtractor
        self.Multiplier = Multiplier
        super(DRAOverridesType, self).__init__(**kwargs)
コード例 #16
0
ファイル: Channel.py プロジェクト: johnhhenderson/sarpy
class FxPNPointType(Serializable):
    """
    Points that describe the noise profile.
    """

    _fields = ('Fx', 'PN')
    _required = _fields
    _numeric_format = {'FX': '0.16G', 'PN': '0.16G'}
    # descriptors
    Fx = _FloatDescriptor(
        'Fx',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Frequency value of this noise profile point, in Hz.'
    )  # type: float
    PN = _FloatDescriptor(
        'PN',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Power level of this noise profile point.')  # type: float

    def __init__(self, Fx=None, PN=None, **kwargs):
        """

        Parameters
        ----------
        Fx : float
        PN : float
        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.Fx = Fx
        self.PN = PN
        super(FxPNPointType, self).__init__(**kwargs)
コード例 #17
0
class IAYExtentType(Serializable):
    """
    Increasing sample index is in the +IAY direction.
    """

    _fields = ('SampleSpacing', 'FirstSample', 'NumSamples')
    _required = _fields
    _numeric_format = {'SampleSpacing': '0.16G'}
    # descriptors
    SampleSpacing = _FloatDescriptor(
        'SampleSpacing',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Sample spacing, in meters.')  # type: float
    FirstSample = _IntegerDescriptor(
        'FirstSample',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Index of the first sample.')  # type: int
    NumSamples = _IntegerDescriptor(
        'NumSamples',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(1, None),
        docstring='Number of samples.')  # type: int

    def __init__(self,
                 SampleSpacing=None,
                 FirstSample=None,
                 NumSamples=None,
                 **kwargs):
        """

        Parameters
        ----------
        SampleSpacing : float
        FirstSample : int
        NumSamples : int
        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.SampleSpacing = SampleSpacing
        self.FirstSample = FirstSample
        self.NumSamples = NumSamples
        super(IAYExtentType, self).__init__(**kwargs)
コード例 #18
0
ファイル: Antenna.py プロジェクト: nyulacska/sarpy
class GainPhaseArrayType(Serializable):
    """
    Parameters that identify 2-D sampled Gain & Phase patterns at single
    frequency value.
    """

    _fields = ('Freq', 'ArrayId', 'ElementId')
    _required = ('Freq', 'ArrayId')
    # descriptors
    Freq = _FloatDescriptor(
        'Freq',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Frequency value for which the sampled Array and Element '
        'pattern(s) are provided, in Hz.')  # type: float
    ArrayId = _StringDescriptor(
        'ArrayId',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Support array identifier of the sampled gain/phase of the array '
        'at ref Frequency.')  # type: str
    ElementId = _StringDescriptor(
        'ElementId',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Support array identifier of the sampled gain/phase of the element '
        'at ref frequency.')  # type: str

    def __init__(self, Freq=None, ArrayId=None, ElementId=None, **kwargs):
        """

        Parameters
        ----------
        Freq : float
        ArrayId : str
        ElementId : None|str
        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.Freq = Freq
        self.ArrayId = ArrayId
        self.ElementId = ElementId
        super(GainPhaseArrayType, self).__init__(**kwargs)
コード例 #19
0
ファイル: Channel.py プロジェクト: johnhhenderson/sarpy
class TOAExtendedType(Serializable):
    """
    The time-of-arrival (TOA) extended swath information.
    """

    _fields = ('TOAExtSaved', 'LFMEclipse')
    _required = ('TOAExtSaved', )
    _numeric_format = {'TOAExtSaved': '0.16G'}
    # descriptors
    TOAExtSaved = _FloatDescriptor(
        'TOAExtSaved',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'TOA extended swath saved that includes both full and partially '
        'eclipsed echoes.')  # type: float
    LFMEclipse = _SerializableDescriptor(
        'LFMEclipse',
        LFMEclipseType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Parameters that describe the FX domain signal content for partially '
        'eclipsed echoes when the collection is performed with a Linear '
        'FM waveform.')  # type: Union[None, LFMEclipseType]

    def __init__(self, TOAExtSaved=None, LFMEclipse=None, **kwargs):
        """

        Parameters
        ----------
        TOAExtSaved : float
        LFMEclipse : None|LFMEclipseType
        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.TOAExtSaved = TOAExtSaved
        self.LFMEclipse = LFMEclipse
        super(TOAExtendedType, self).__init__(**kwargs)
コード例 #20
0
ファイル: Channel.py プロジェクト: johnhhenderson/sarpy
class TgtRefLevelType(Serializable):
    """
    Signal level for an ideal point scatterer located at the SRP for reference
    signal vector.
    """

    _fields = ('PTRef', )
    _required = _fields
    _numeric_format = {'PTRef': '0.16G'}
    # descriptors
    PTRef = _FloatDescriptor(
        'PTRef',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'Target power level for a 1.0 square meter ideal point scatterer located '
        'at the SRP. For FX Domain signal arrays, PTRef is the signal level at '
        ':math:`fx = fx_C`. For TOA Domain, PTRef is the peak signal level at '
        r':math:`\Delta TOA = 0`, and :math:`Power = |Signal|^2`.'
    )  # type: float

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

        Parameters
        ----------
        PTRef : float
        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.PTRef = PTRef
        super(TgtRefLevelType, self).__init__(**kwargs)
コード例 #21
0
class LSType(Serializable, Arrayable):
    """
    Represents line and sample.
    """

    _fields = ('Line', 'Sample')
    _required = _fields
    _numeric_format = {'Line': '0.16G', 'Sample': '0.16G'}
    # Descriptor
    Line = _FloatDescriptor('Line',
                            _required,
                            strict=DEFAULT_STRICT,
                            docstring='The Line.')  # type: float
    Sample = _FloatDescriptor('Sample',
                              _required,
                              strict=DEFAULT_STRICT,
                              docstring='The Sample.')  # type: float

    def __init__(self, Line=None, Sample=None, **kwargs):
        """

        Parameters
        ----------
        Line : float
        Sample : float
        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.Line = Line
        self.Sample = Sample
        super(LSType, self).__init__(**kwargs)

    def get_array(self, dtype=numpy.float64):
        """
        Gets an array representation of the class instance.

        Parameters
        ----------
        dtype : str|numpy.dtype|numpy.number
            numpy data type of the return

        Returns
        -------
        numpy.ndarray
            array of the form [Line, Sample]
        """

        return numpy.array([self.Line, self.Sample], dtype=dtype)

    @classmethod
    def from_array(cls, array):
        """
        Construct from a iterable.

        Parameters
        ----------
        array : numpy.ndarray|list|tuple

        Returns
        -------
        LSType
        """

        if array is None:
            return None
        if isinstance(array, (numpy.ndarray, list, tuple)):
            if len(array) < 2:
                raise ValueError(
                    'Expected array to be of length 2, and received {}'.format(
                        array))
            return cls(Line=array[0], Sample=array[1])
        raise ValueError(
            'Expected array to be numpy.ndarray, list, or tuple, got {}'.
            format(type(array)))
コード例 #22
0
class XYType(Serializable, Arrayable):
    """
    A point in two-dimensional spatial coordinates.
    """

    _fields = ('X', 'Y')
    _required = _fields
    _numeric_format = {'X': '0.16G', 'Y': '0.16G'}
    # descriptors
    X = _FloatDescriptor(
        'X',
        _required,
        strict=True,
        docstring='The X attribute. Assumed to ECF or other, similar '
        'coordinates.')  # type: float
    Y = _FloatDescriptor(
        'Y',
        _required,
        strict=True,
        docstring='The Y attribute. Assumed to ECF or other, similar '
        'coordinates.')  # type: float

    def __init__(self, X=None, Y=None, **kwargs):
        """
        Parameters
        ----------
        X : float
        Y : float
        kwargs : dict
        """

        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.X, self.Y = X, Y
        super(XYType, self).__init__(**kwargs)

    @classmethod
    def from_array(cls, array):
        """
        Create from an array type entry.

        Parameters
        ----------
        array: numpy.ndarray|list|tuple
            assumed [X, Y]

        Returns
        -------
        XYType
        """

        if array is None:
            return None
        if isinstance(array, (numpy.ndarray, list, tuple)):
            if len(array) < 2:
                raise ValueError(
                    'Expected array to be of length 2, and received {}'.format(
                        array))
            return cls(X=array[0], Y=array[1])
        raise ValueError(
            'Expected array to be numpy.ndarray, list, or tuple, got {}'.
            format(type(array)))

    def get_array(self, dtype=numpy.float64):
        """
        Gets an array representation of the class instance.

        Parameters
        ----------
        dtype : str|numpy.dtype|numpy.number
            numpy data type of the return

        Returns
        -------
        numpy.ndarray
            array of the form [X,Y]
        """

        return numpy.array([self.X, self.Y], dtype=dtype)
コード例 #23
0
class ReferenceGeometryCore(Serializable):
    """
    The base reference geometry implementation.
    """

    _fields = ('SideOfTrack', 'SlantRange', 'GroundRange', 'DopplerConeAngle',
               'GrazeAngle', 'IncidenceAngle', 'AzimuthAngle')
    _required = _fields
    _numeric_format = {
        'SlantRange': '0.16G',
        'GroundRange': '0.16G',
        'DopplerConeAngle': '0.16G',
        'GrazeAngle': '0.16G',
        'IncidenceAngle': '0.16G',
        'AzimuthAngle': '0.16G'
    }
    # descriptors
    SideOfTrack = _StringEnumDescriptor(
        'SideOfTrack', ('L', 'R'),
        _required,
        strict=DEFAULT_STRICT,
        docstring='Side of Track parameter for the collection.')  # type: str
    SlantRange = _FloatDescriptor(
        'SlantRange',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Slant range from the ARP to the SRP.')  # type: float
    GroundRange = _FloatDescriptor(
        'GroundRange',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Ground range from the ARP to the SRP.')  # type: float
    DopplerConeAngle = _FloatDescriptor(
        'DopplerConeAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 180),
        docstring='Doppler Cone Angle between ARP velocity and deg SRP Line of '
        'Sight (LOS).')  # type: float
    GrazeAngle = _FloatDescriptor(
        'GrazeAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 90),
        docstring=
        'Grazing angle for the ARP to SRP LOS and the deg Earth Tangent '
        'Plane (ETP) at the SRP.')  # type: float
    IncidenceAngle = _FloatDescriptor(
        'IncidenceAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 90),
        docstring='Incidence angle for the ARP to SRP LOS and the Earth Tangent '
        'Plane (ETP) at the SRP.')  # type: float
    AzimuthAngle = _FloatDescriptor(
        'AzimuthAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 360),
        docstring='Angle from north to the line from the SRP to the ARP ETP '
        'Nadir (i.e. North to +GPX). Measured clockwise from North '
        'toward East.')  # type: float

    def __init__(self,
                 SideOfTrack=None,
                 SlantRange=None,
                 GroundRange=None,
                 DopplerConeAngle=None,
                 GrazeAngle=None,
                 IncidenceAngle=None,
                 AzimuthAngle=None,
                 **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.SideOfTrack = SideOfTrack
        self.SlantRange = SlantRange
        self.GroundRange = GroundRange
        self.DopplerConeAngle = DopplerConeAngle
        self.GrazeAngle = GrazeAngle
        self.IncidenceAngle = IncidenceAngle
        self.AzimuthAngle = AzimuthAngle
        super(ReferenceGeometryCore, self).__init__(**kwargs)

    @property
    def look(self):
        """
        int: An integer version of `SideOfTrack`:

            * None if `SideOfTrack` is not defined

            * -1 if SideOfTrack == 'R'

            * 1 if SideOftrack == 'L'
        """

        if self.SideOfTrack is None:
            return None
        return -1 if self.SideOfTrack == 'R' else 1
コード例 #24
0
class ReferenceGeometryType(Serializable):
    """
    Parameters that describe the collection geometry for the reference vector
    of the reference channel.
    """

    _fields = ('SRP', 'ReferenceTime', 'SRPCODTime', 'SRPDwellTime',
               'Monostatic', 'Bistatic')
    _required = ('SRP', 'ReferenceTime', 'SRPCODTime', 'SRPDwellTime')
    _choice = ({'required': True, 'collection': ('Monostatic', 'Bistatic')}, )
    _numeric_format = {'ReferenceTime': '0.16G', 'SRPCODTime': '0.16G'}
    # descriptors
    SRP = _SerializableDescriptor(
        'SRP',
        SRPType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='The SRP position for the reference vector of the reference '
        'channel.')  # type: SRPType
    ReferenceTime = _FloatDescriptor(
        'ReferenceTime',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Reference time for the selected reference vector, in '
        'seconds.')  # type: float
    SRPCODTime = _FloatDescriptor(
        'SRPCODTime',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='The COD Time for point on the reference surface, in '
        'seconds.')  # type: float
    SRPDwellTime = _FloatDescriptor('SRPDwellTime',
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    bounds=(0, None),
                                    docstring='')  # type: float
    Monostatic = _SerializableDescriptor(
        'Monostatic',
        MonostaticType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters for monstatic collection.'
    )  # type: Union[None, MonostaticType]
    Bistatic = _SerializableDescriptor(
        'Bistatic',
        BistaticType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters for bistatic collection.'
    )  # type: Union[None, BistaticType]

    def __init__(self,
                 SRP=None,
                 ReferenceTime=None,
                 SRPCODTime=None,
                 SRPDwellTime=None,
                 Monostatic=None,
                 Bistatic=None,
                 **kwargs):
        """

        Parameters
        ----------
        SRP : SRPType
        ReferenceTime : float
        SRPCODTime : float
        SRPDwellTime : float
        Monostatic : None|MonostaticType
        Bistatic : None|BistaticType
        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.SRP = SRP
        self.ReferenceTime = ReferenceTime
        self.SRPCODTime = SRPCODTime
        self.SRPDwellTime = SRPDwellTime
        self.Monostatic = Monostatic
        self.Bistatic = Bistatic
        super(ReferenceGeometryType, self).__init__(**kwargs)
コード例 #25
0
class BistaticType(Serializable):
    """

    """

    _fields = ('AzimuthAngle', 'AzimuthAngleRate', 'BistaticAngle',
               'BistaticAngleRate', 'GrazeAngle', 'TwistAngle', 'SlopeAngle',
               'LayoverAngle', 'TxPlatform', 'RcvPlatform')
    _required = _fields
    _numeric_format = {
        'AzimuthAngle': '0.16G',
        'AzimuthAngleRate': '0.16G',
        'BistaticAngle': '0.16G',
        'BistaticAngleRate': '0.16G',
        'GrazeAngle': '0.16G',
        'TwistAngle': '0.16G',
        'SlopeAngle': '0.16G',
        'LayoverAngle': '0.16G'
    }

    # descriptors
    AzimuthAngle = _FloatDescriptor(
        'AzimuthAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 360),
        docstring=
        'Angle from north to the projection of the Bistatic pointing vector '
        '(bP) into the ETP. Measured clockwise from +North toward '
        '+East.')  # type: float
    AzimuthAngleRate = _FloatDescriptor(
        'AzimuthAngleRate',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Instantaneous rate of change of the Azimuth Angle '
        ':math:`d(AZIM)/dt`.')  # type: float
    BistaticAngle = _FloatDescriptor(
        'BistaticAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 180),
        docstring=
        'Bistatic angle (Beta) between unit vector from SRP to transmit APC '
        '(uXmt) and the unit vector from the SRP to the receive '
        'APC (uRcv).')  # type: float
    BistaticAngleRate = _FloatDescriptor(
        'BistaticAngleRate',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Instantaneous rate of change of the bistatic angle '
        ':math:`d(Beta)/dt)`.')  # type: float
    GrazeAngle = _FloatDescriptor(
        'GrazeAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 90),
        docstring=
        'Angle between the bistatic pointing vector and the ETP at the '
        'SRP.')  # type: float
    TwistAngle = _FloatDescriptor(
        'TwistAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(-90, 90),
        docstring=
        'Angle between cross range in the ETP at the SRP and cross range '
        'in the instantaneous plane of maximum bistatic resolution. '
        'Note - For monostatic imaging, the plane of maximum resolution is '
        'the instantaneous slant plane.')  # type: float
    SlopeAngle = _FloatDescriptor(
        'SlopeAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 90),
        docstring=
        'Angle between the ETP normal and the normal to the instantaneous '
        'plane of maximum bistatic resolution.')  # type: float
    LayoverAngle = _FloatDescriptor(
        'LayoverAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 360),
        docstring=
        'Angle from north to the bistatic layover direction in the ETP. '
        'Measured clockwise from +North toward +East.')  # type: float
    TxPlatform = _SerializableDescriptor(
        'TxPlatform',
        BistaticTxRcvType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters that describe the Transmit platform.'
    )  # type: BistaticTxRcvType
    RcvPlatform = _SerializableDescriptor(
        'RcvPlatform',
        BistaticTxRcvType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters that describe the Receive platform.'
    )  # type: BistaticTxRcvType

    def __init__(self,
                 AzimuthAngle=None,
                 AzimuthAngleRate=None,
                 BistaticAngle=None,
                 BistaticAngleRate=None,
                 GrazeAngle=None,
                 TwistAngle=None,
                 SlopeAngle=None,
                 LayoverAngle=None,
                 TxPlatform=None,
                 RcvPlatform=None,
                 **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.AzimuthAngle = AzimuthAngle
        self.AzimuthAngleRate = AzimuthAngleRate
        self.BistaticAngle = BistaticAngle
        self.BistaticAngleRate = BistaticAngleRate
        self.GrazeAngle = GrazeAngle
        self.TwistAngle = TwistAngle
        self.SlopeAngle = SlopeAngle
        self.LayoverAngle = LayoverAngle
        self.TxPlatform = TxPlatform
        self.RcvPlatform = RcvPlatform
        super(BistaticType, self).__init__(**kwargs)
コード例 #26
0
class BistaticTxRcvType(ReferenceGeometryCore):
    """
    Parameters that describe the Transmit/Receive platforms.
    """

    _fields = ('Time', 'Pos', 'Vel', 'SideOfTrack', 'SlantRange',
               'GroundRange', 'DopplerConeAngle', 'GrazeAngle',
               'IncidenceAngle', 'AzimuthAngle')
    _required = _fields
    _numeric_format = {
        'Time': '0.16G',
        'SlantRange': '0.16G',
        'GroundRange': '0.16G',
        'DopplerConeAngle': '0.16G',
        'GrazeAngle': '0.16G',
        'IncidenceAngle': '0.16G',
        'AzimuthAngle': '0.16G'
    }
    # descriptors
    Time = _FloatDescriptor(
        'Time',
        _required,
        strict=DEFAULT_STRICT,
        docstring='The transmit or receive time for the vector.'
    )  # type: float
    Pos = _SerializableDescriptor(
        'Pos',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='APC position in ECF coordinates.')  # type: XYZType
    Vel = _SerializableDescriptor(
        'Vel',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='APC velocity in ECF coordinates.')  # type: XYZType

    def __init__(self,
                 Time=None,
                 Pos=None,
                 Vel=None,
                 SideOfTrack=None,
                 SlantRange=None,
                 GroundRange=None,
                 DopplerConeAngle=None,
                 GrazeAngle=None,
                 IncidenceAngle=None,
                 AzimuthAngle=None,
                 **kwargs):
        """

        Parameters
        ----------
        Time : float
        Pos : XYZType|numpy.ndarray|list|tuple
        Vel : XYZType|numpy.ndarray|list|tuple
        SideOfTrack : float
        SlantRange : float
        GroundRange : float
        DopplerConeAngle : float
        GrazeAngle : float
        IncidenceAngle : float
        AzimuthAngle : float
        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.Time = Time
        self.Pos = Pos
        self.Vel = Vel
        super(BistaticTxRcvType,
              self).__init__(SideOfTrack=SideOfTrack,
                             SlantRange=SlantRange,
                             GroundRange=GroundRange,
                             DopplerConeAngle=DopplerConeAngle,
                             GrazeAngle=GrazeAngle,
                             IncidenceAngle=IncidenceAngle,
                             AzimuthAngle=AzimuthAngle,
                             **kwargs)
コード例 #27
0
class MonostaticType(ReferenceGeometryCore):
    """
    Parameters for monostatic collection.
    """

    _fields = ('ARPPos', 'ARPVel', 'SideOfTrack', 'SlantRange', 'GroundRange',
               'DopplerConeAngle', 'GrazeAngle', 'IncidenceAngle',
               'AzimuthAngle', 'TwistAngle', 'SlopeAngle', 'LayoverAngle')
    _required = _fields
    _numeric_format = {
        'SlantRange': '0.16G',
        'GroundRange': '0.16G',
        'DopplerConeAngle': '0.16G',
        'GrazeAngle': '0.16G',
        'IncidenceAngle': '0.16G',
        'AzimuthAngle': '0.16G',
        'TwistAngle': '0.16G',
        'SlopeAngle': '0.16G',
        'LayoverAngle': '0.16G'
    }
    # descriptors
    ARPPos = _SerializableDescriptor(
        'ARPPos',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='ARP position in ECF coordinates.')  # type: XYZType
    ARPVel = _SerializableDescriptor(
        'ARPVel',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='ARP velocity in ECF coordinates.')  # type: XYZType
    TwistAngle = _FloatDescriptor(
        'TwistAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(-90, 90),
        docstring=
        'Twist angle between cross range in the ETP and cross range in '
        'the slant plane at the SRP.')  # type: float
    SlopeAngle = _FloatDescriptor(
        'SlopeAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 90),
        docstring=
        'Angle between the ETP normal (uUP) and the slant plane normal '
        '(uSPN) at the SRP.')  # type: float
    LayoverAngle = _FloatDescriptor(
        'LayoverAngle',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 360),
        docstring=
        'Angle from north to the layover direction in the ETP. Measured '
        'clockwise from +North toward +East.')  # type: float

    def __init__(self,
                 ARPPos=None,
                 ARPVel=None,
                 SideOfTrack=None,
                 SlantRange=None,
                 GroundRange=None,
                 DopplerConeAngle=None,
                 GrazeAngle=None,
                 IncidenceAngle=None,
                 AzimuthAngle=None,
                 TwistAngle=None,
                 SlopeAngle=None,
                 LayoverAngle=None,
                 **kwargs):
        """

        Parameters
        ----------
        ARPPos : XYZType|numpy.ndarray|list|tuple
        ARPVel : XYZType|numpy.ndarray|list|tuple
        SideOfTrack : float
        SlantRange : float
        GroundRange : float
        DopplerConeAngle : float
        GrazeAngle : float
        IncidenceAngle : float
        AzimuthAngle : float
        TwistAngle : float
        SlopeAngle : float
        LayoverAngle : float
        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.ARPPos = ARPPos
        self.ARPVel = ARPVel
        self.TwistAngle = TwistAngle
        self.SlopeAngle = SlopeAngle
        self.LayoverAngle = LayoverAngle
        super(MonostaticType, self).__init__(SideOfTrack=SideOfTrack,
                                             SlantRange=SlantRange,
                                             GroundRange=GroundRange,
                                             DopplerConeAngle=DopplerConeAngle,
                                             GrazeAngle=GrazeAngle,
                                             IncidenceAngle=IncidenceAngle,
                                             AzimuthAngle=AzimuthAngle,
                                             **kwargs)

    @property
    def MultipathGround(self):
        """
        float: The anticipated angle of multipath features on the ground in degrees.
        """

        if self.TwistAngle is None:
            return None
        else:
            return numpy.rad2deg(-numpy.arctan(
                numpy.tan(numpy.deg2rad(self.TwistAngle)) *
                numpy.sin(numpy.deg2rad(self.GrazeAngle))))

    @property
    def Multipath(self):
        """
        float: The anticipated angle of multipath features in degrees.
        """
        if self.MultipathGround is None:
            return None
        else:
            return numpy.mod(self.AzimuthAngle - 180 + self.MultipathGround,
                             360)

    @property
    def Shadow(self):
        """
        float: The anticipated angle of shadow features in degrees.
        """

        return numpy.mod(self.AzimuthAngle - 180, 360)
コード例 #28
0
ファイル: SupportArray.py プロジェクト: johnhhenderson/sarpy
class SupportArrayCore(Serializable):
    """
    The support array base case.
    """

    _fields = ('Identifier', 'ElementFormat', 'X0', 'Y0', 'XSS', 'YSS',
               'NODATA')
    _required = ('Identifier', 'ElementFormat', 'X0', 'Y0', 'XSS', 'YSS')
    _numeric_format = {
        'X0': '0.16G',
        'Y0': '0.16G',
        'XSS': '0.16G',
        'YSS': '0.16G'
    }
    # descriptors
    Identifier = _StringDescriptor(
        'Identifier',
        _required,
        strict=DEFAULT_STRICT,
        docstring='The support array identifier.')  # type: str
    ElementFormat = _StringDescriptor(
        'ElementFormat',
        _required,
        strict=DEFAULT_STRICT,
        docstring='The data element format.')  # type: str
    X0 = _FloatDescriptor('X0', _required, strict=DEFAULT_STRICT,
                          docstring='')  # type: float
    Y0 = _FloatDescriptor('Y0', _required, strict=DEFAULT_STRICT,
                          docstring='')  # type: float
    XSS = _FloatDescriptor('XSS',
                           _required,
                           strict=DEFAULT_STRICT,
                           bounds=(0, None),
                           docstring='')  # type: float
    YSS = _FloatDescriptor('YSS',
                           _required,
                           strict=DEFAULT_STRICT,
                           bounds=(0, None),
                           docstring='')  # type: float

    def __init__(self,
                 Identifier=None,
                 ElementFormat=None,
                 X0=None,
                 Y0=None,
                 XSS=None,
                 YSS=None,
                 NODATA=None,
                 **kwargs):
        """

        Parameters
        ----------
        Identifier : str
        ElementFormat : str
        X0 : float
        Y0 : float
        XSS : float
        YSS : float
        NODATA : None|str
        kwargs
        """

        self._NODATA = None
        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.Identifier = Identifier
        self.ElementFormat = ElementFormat
        self.X0 = X0
        self.Y0 = Y0
        self.XSS = XSS
        self.YSS = YSS
        self.NODATA = NODATA
        super(SupportArrayCore, self).__init__(**kwargs)

    @property
    def NODATA(self):
        """
        None|str: The no data hex string value.
        """

        return self._NODATA

    @NODATA.setter
    def NODATA(self, value):
        if value is None:
            self._NODATA = None
            return

        if isinstance(value, ElementTree.Element):
            value = _get_node_value(value)

        if isinstance(value, string_types):
            self._NODATA = value
        elif isinstance(value, bytes):
            self._NODATA = value.decode('utf-8')
        elif isinstance(value, int):
            raise NotImplementedError
        elif isinstance(value, float):
            raise NotImplementedError
        else:
            raise TypeError('Got unexpected type {}'.format(type(value)))

    def get_nodata_as_int(self):
        """
        Get the no data value as an integer value.

        Returns
        -------
        None|int
        """

        if self._NODATA is None:
            return None

        raise NotImplementedError

    def get_nodata_as_float(self):
        """
        Gets the no data value as a floating point value.

        Returns
        -------
        None|float
        """

        if self._NODATA is None:
            return None

        raise NotImplementedError

    def get_numpy_format(self):
        """
        Convert the element format to a numpy dtype (including endianness) and depth.

        Returns
        -------
        numpy.dtype, int
        """

        return homogeneous_dtype(self.ElementFormat, return_length=True)
コード例 #29
0
class ExploitationFeaturesProductType(Serializable):
    """
    Metadata regarding the product.
    """

    _fields = ('Resolution', 'Ellipticity', 'Polarizations', 'North',
               'Extensions')
    _required = ('Resolution', 'Ellipticity', 'Polarizations')
    _collections_tags = {
        'Polarizations': {
            'array': False,
            'child_tag': 'Polarization'
        },
        'Extensions': {
            'array': False,
            'child_tag': 'Extension'
        }
    }
    _numeric_format = {'Ellipticity': '0.16G', 'North': '0.16G'}
    # Descriptor
    Resolution = _SerializableDescriptor(
        'Resolution',
        RowColDoubleType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Uniformly-weighted resolution projected into the Earth Tangent '
        'Plane (ETP).')  # type: RowColDoubleType
    Ellipticity = _FloatDescriptor(
        'Ellipticity',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        "Ellipticity of the 2D-IPR at the ORP, measured in the *Earth Geodetic "
        "Tangent Plane (EGTP)*. Ellipticity is the ratio of the IPR ellipse's "
        "major axis to minor axis.")  # type: float
    Polarizations = _SerializableListDescriptor(
        'Polarizations',
        ProcTxRcvPolarizationType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Describes the processed transmit and receive polarizations for the '
        'product.')  # type: List[ProcTxRcvPolarizationType]
    North = _FloatModularDescriptor(
        'North',
        180.0,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Counter-clockwise angle from increasing row direction to north at the center '
        'of the image.')  # type: float
    Extensions = _ParametersDescriptor(
        'Extensions',
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Exploitation feature extension related to geometry for a '
        'single input image.')  # type: ParametersCollection

    def __init__(self,
                 Resolution=None,
                 Ellipticity=None,
                 Polarizations=None,
                 North=None,
                 Extensions=None,
                 **kwargs):
        """

        Parameters
        ----------
        Resolution : RowColDoubleType|numpy.ndarray|list|tuple
        Ellipticity : float
        Polarizations : List[ProcTxRcvPolarizationType]
        North : None|float
        Extensions : None|ParametersCollection|dict
        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.Resolution = Resolution
        self.Ellipticity = Ellipticity
        self.Polarizations = Polarizations
        self.North = North
        self.Extensions = Extensions
        super(ExploitationFeaturesProductType, self).__init__(**kwargs)

    @classmethod
    def from_sicd(cls, sicd):
        """
        Construct from a sicd element.

        Parameters
        ----------
        sicd : SICDType

        Returns
        -------
        ExploitationFeaturesProductType
        """

        if not isinstance(sicd, SICDType):
            raise TypeError('Requires SICDType instance, got type {}'.format(
                type(sicd)))

        row_ground, col_ground = sicd.get_ground_resolution()
        ellipticity = row_ground / col_ground if row_ground >= col_ground else col_ground / row_ground

        return cls(Resolution=(row_ground, col_ground),
                   Ellipticity=ellipticity,
                   Polarizations=[
                       ProcTxRcvPolarizationType.from_sicd_value(
                           sicd.ImageFormation.TxRcvPolarizationProc),
                   ])
コード例 #30
0
ファイル: Display.py プロジェクト: LordHui/sarpy
class DRAParametersType(Serializable):
    """
    The basic dynamic range adjustment parameters.
    """
    _fields = ('Pmin', 'Pmax', 'EminModifier', 'EmaxModifier')
    _required = _fields
    _numeric_format = {key: '0.16G' for key in _fields}
    # Descriptor
    Pmin = _FloatDescriptor(
        'Pmin',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 1),
        docstring=
        'DRA clip low point. This is the cumulative histogram percentage value '
        'that defines the lower end-point of the dynamic range to be displayed.'
    )  # type: float
    Pmax = _FloatDescriptor(
        'Pmax',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 1),
        docstring=
        'DRA clip high point. This is the cumulative histogram percentage value '
        'that defines the upper end-point of the dynamic range to be displayed.'
    )  # type: float
    EminModifier = _FloatDescriptor(
        'EminModifier',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 1),
        docstring=
        'The pixel value corresponding to the Pmin percentage point in the '
        'image histogram.')  # type: float
    EmaxModifier = _FloatDescriptor(
        'EmaxModifier',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, 1),
        docstring=
        'The pixel value corresponding to the Pmax percentage point in the '
        'image histogram.')  # type: float

    def __init__(self,
                 Pmin=None,
                 Pmax=None,
                 EminModifier=None,
                 EmaxModifier=None,
                 **kwargs):
        """

        Parameters
        ----------
        Pmin : float
        Pmax : float
        EminModifier : float
        EmaxModifier : float
        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.Pmin = Pmin
        self.Pmax = Pmax
        self.EminModifier = EminModifier
        self.EmaxModifier = EmaxModifier
        super(DRAParametersType, self).__init__(**kwargs)