Exemple #1
0
class UnmodeledType(Serializable):
    _fields = ('Xrow', 'Ycol', 'XrowYcol', 'UnmodeledDecorr')
    _required = ('Xrow', 'Ycol', 'XrowYcol')
    _numeric_format = {fld: '0.17G' for fld in ('Xrow', 'Ycol', 'XrowYcol')}
    Xrow = FloatDescriptor('Xrow', _required,
                           strict=DEFAULT_STRICT)  # type: float
    Ycol = FloatDescriptor('Ycol', _required,
                           strict=DEFAULT_STRICT)  # type: float
    XrowYcol = FloatDescriptor('XrowYcol', _required,
                               strict=DEFAULT_STRICT)  # type: float
    UnmodeledDecorr = SerializableDescriptor(
        'UnmodeledDecorr',
        UnmodeledDecorrType,
        _required,
        strict=DEFAULT_STRICT)  # type: Union[None, UnmodeledDecorrType]

    def __init__(self,
                 Xrow=None,
                 Ycol=None,
                 XrowYcol=None,
                 UnmodeledDecorr=None,
                 **kwargs):
        """

        Parameters
        ----------
        Xrow : float
        Ycol : float
        XrowYcol : float
        UnmodeledDecorr : None|UnmodeledDecorrType
        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.Xrow = Xrow
        self.Ycol = Ycol
        self.XrowYcol = XrowYcol
        self.UnmodeledDecorr = UnmodeledDecorr
        super(UnmodeledType, self).__init__(**kwargs)
Exemple #2
0
class TimelineType(Serializable):
    """
    Parameters that describe the collection times for the data contained in the product.
    """

    _fields = ('CollectionRefTime', 'RcvTime1', 'RcvTime2')
    _required = ('CollectionRefTime', 'RcvTime1', 'RcvTime2')
    _numeric_format = {'RcvTime1': FLOAT_FORMAT, 'RcvTime2': FLOAT_FORMAT}
    # descriptors
    CollectionRefTime = DateTimeDescriptor(
        'CollectionRefTime', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us',
        docstring='Collection Reference Time (t_CRT). Time reference used for all receive times'
                  ' and all transmit times. All times are specified in seconds relative to t_CRT'
                  ' (i.e., t_CRT is slow time t = 0).')  # type: numpy.datetime64
    RcvTime1 = FloatDescriptor(
        'RcvTime1', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Earliest RcvTime value for any signal vector in the product.'
                  ' Time relative to Collection Reference Time.')  # type: float
    RcvTime2 = FloatDescriptor(
        'RcvTime2', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Latest RcvTime value for any signal vector in the product.'
                  ' Time relative to Collection Reference Time.')  # type: float

    def __init__(self, CollectionRefTime=None, RcvTime1=None, RcvTime2=None, **kwargs):
        """

        Parameters
        ----------
        CollectionRefTime : numpy.datetime64|datetime|date|str
        RcvTime1 : float
        RcvTime2 : 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.CollectionRefTime = CollectionRefTime
        self.RcvTime1 = RcvTime1
        self.RcvTime2 = RcvTime2
        super(TimelineType, self).__init__(**kwargs)
Exemple #3
0
class NoiseLevelType(Serializable):
    """
    The thermal noise level information.
    """

    _fields = ('PNCRSD', 'BNCRSD')
    _required = _fields
    _numeric_format = {fld: '0.16G' for fld in _fields}
    # descriptors
    PNCRSD = FloatDescriptor(
        'PNCRSD',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Noise power level in fast time signal vector for f_IC(v,t) = f_0(v_CH_REF).'
    )  # type: float
    BNCRSD = FloatDescriptor(
        'BNCRSD',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Noise Equivalent BW for the noise signal. Bandwidth BN_CRSD is expressed relative'
        ' to the fast time sample rate for the channel (fs).')  # type:float

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

        Parameters
        ----------
        PNCRSD : float
        BNCRSD : 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.PNCRSD = PNCRSD
        self.BNCRSD = BNCRSD
        super(NoiseLevelType, self).__init__(**kwargs)
Exemple #4
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)
Exemple #5
0
class ReferencePointType(Serializable):
    """The reference point definition"""
    _fields = ('ECF', 'Line', 'Sample', 'name')
    _required = ('ECF', 'Line', 'Sample')
    _set_as_attribute = ('name', )
    _numeric_format = {'Line': FLOAT_FORMAT, 'Sample': FLOAT_FORMAT}
    # descriptors
    ECF = SerializableDescriptor(
        'ECF', XYZType, _required, strict=DEFAULT_STRICT,
        docstring='The geographical coordinates for the reference point.')  # type: XYZType
    Line = FloatDescriptor(
        'Line', _required, strict=DEFAULT_STRICT,
        docstring='The reference point line index.')  # type: float
    Sample = FloatDescriptor(
        'Sample', _required, strict=DEFAULT_STRICT,
        docstring='The reference point sample index.')  # type: float
    name = StringDescriptor(
        'name', _required, strict=DEFAULT_STRICT,
        docstring='The reference point name.')  # type: str

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

        Parameters
        ----------
        ECF : XYZType|numpy.ndarray|list|tuple
        Line : float
        Sample : float
        name : str
        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.ECF = ECF
        self.Line = Line
        self.Sample = Sample
        self.name = name
        super(ReferencePointType, self).__init__(**kwargs)
Exemple #6
0
class IonoParametersType(Serializable):
    """
    Parameters used to compute propagation effects due to the ionosphere.
    """

    _fields = ('TECV', 'F2Height')
    _required = ('TECV', )
    _numeric_format = {fld: FLOAT_FORMAT 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)
Exemple #7
0
class ReceiveSensorType(Serializable):
    """
    Receive sensor error statistics
    """

    _fields = ('RcvDelayBias', 'ClockFreqSF', 'RefTimeError')
    _required = ('RcvDelayBias', )
    _numeric_format = {'ClockFreqSF': FLOAT_FORMAT, 'RefTimeError': FLOAT_FORMAT}
    # descriptors
    RcvDelayBias = FloatDescriptor(
        'RcvDelayBias', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Receive path signal delay error bias that causes an error in the'
                  ' estimated signal time of arrival at the Receive APC')  # type: float
    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
    RefTimeError = FloatDescriptor(
        'RefTimeError', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Time error standard deviation, in seconds.')  # type: float

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

        Parameters
        ----------
        RcvDelayBias : float
        ClockFreqSF : None|float
        RefTimeError : 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.RcvDelayBias = RcvDelayBias
        self.ClockFreqSF = ClockFreqSF
        self.RefTimeError = RefTimeError
        super(ReceiveSensorType, self).__init__(**kwargs)
Exemple #8
0
class RadarSensorErrorType(Serializable):
    """Radar sensor error statistics."""
    _fields = ('RangeBias', 'ClockFreqSF', 'TransmitFreqSF', 'RangeBiasDecorr')
    _required = ('RangeBias', )
    _numeric_format = {'RangeBias': '0.16G', 'ClockFreqSF': '0.16G', 'TransmitFreqSF': '0.16G'}
    # descriptors
    RangeBias = FloatDescriptor(
        'RangeBias', _required, strict=DEFAULT_STRICT,
        docstring='Range bias error standard deviation.')  # type: float
    ClockFreqSF = FloatDescriptor(
        'ClockFreqSF', _required, strict=DEFAULT_STRICT,
        docstring='Payload clock frequency scale factor standard deviation, '
                  r'where :math:`SF = (\Delta f)/f_0`.')  # type: float
    TransmitFreqSF = FloatDescriptor(
        'TransmitFreqSF', _required, strict=DEFAULT_STRICT,
        docstring='Transmit frequency scale factor standard deviation, '
                  r'where :math:`SF = (\Delta f)/f_0`.')  # type: float
    RangeBiasDecorr = SerializableDescriptor(
        'RangeBiasDecorr', ErrorDecorrFuncType, _required, strict=DEFAULT_STRICT,
        docstring='Range bias decorrelation rate.')  # type: ErrorDecorrFuncType

    def __init__(self, RangeBias=None, ClockFreqSF=None, TransmitFreqSF=None, RangeBiasDecorr=None, **kwargs):
        """

        Parameters
        ----------
        RangeBias : float
        ClockFreqSF : float
        TransmitFreqSF : float
        RangeBiasDecorr : ErrorDecorrFuncType
        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.RangeBias, self.ClockFreqSF, self.TransmitFreqSF = RangeBias, ClockFreqSF, TransmitFreqSF
        self.RangeBiasDecorr = RangeBiasDecorr
        super(RadarSensorErrorType, self).__init__(**kwargs)
Exemple #9
0
class RMRefType(Serializable):
    """
    Range migration reference element of RMA type.
    """

    _fields = ('PosRef', 'VelRef', 'DopConeAngRef')
    _required = _fields
    _numeric_format = {
        'DopConeAngRef': FLOAT_FORMAT,
    }
    # descriptors
    PosRef = SerializableDescriptor(
        'PosRef',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Platform reference position in ECF coordinates used to establish '
        'the reference slant plane.')  # type: XYZType
    VelRef = SerializableDescriptor(
        'VelRef',
        XYZType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Platform reference velocity vector in ECF coordinates used to establish '
        'the reference slant plane.')  # type: XYZType
    DopConeAngRef = FloatDescriptor(
        'DopConeAngRef',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Reference Doppler Cone Angle in degrees.')  # type: float

    def __init__(self, PosRef=None, VelRef=None, DopConeAngRef=None, **kwargs):
        """

        Parameters
        ----------
        PosRef : XYZType|numpy.ndarray|list|tuple
        VelRef : XYZType|numpy.ndarray|list|tuple
        DopConeAngRef : 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.PosRef = PosRef
        self.VelRef = VelRef
        self.DopConeAngRef = DopConeAngRef
        super(RMRefType, self).__init__(**kwargs)
Exemple #10
0
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)
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)
Exemple #12
0
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)
Exemple #13
0
class DRAOverridesType(Serializable):
    """
    The dynamic range adjustment overrides.
    """
    _fields = ('Subtractor', 'Multiplier')
    _required = _fields
    _numeric_format = {key: FLOAT_FORMAT 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)
Exemple #14
0
class GainPhaseArrayType(Serializable):
    """
    Parameters that identify 2-D sampled Gain & Phase patterns at single
    frequency value.
    """

    _fields = ('Freq', 'ArrayId', 'ElementId')
    _required = ('Freq', 'ArrayId')
    _numeric_format = {'Freq', '0.16G'}
    # 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)
Exemple #15
0
class LocationType(Serializable):
    _fields = ('Lat', 'Lon', 'Name')
    _required = ('Lat', 'Lon')
    # descriptors
    Lat = FloatDescriptor(
        'Lat',
        _required,
        strict=DEFAULT_STRICT,
        docstring="General latitude of the data collection.")  # type: float
    Lon = FloatDescriptor(
        'Lon',
        _required,
        strict=DEFAULT_STRICT,
        docstring="General longitude of the data collection.")  # type: float
    Name = StringDescriptor('Name',
                            _required,
                            docstring="Common name of the collection location."
                            )  # type: Optional[str]

    def __init__(self, Lat=None, Lon=None, Name=None, **kwargs):
        """
        Parameters
        ----------
        Lat : float
        Lon : float
        Name : None|str
        kwargs
            Other keyword arguments
        """

        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.Lat = Lat
        self.Lon = Lon
        self.Name = Name
        super(LocationType, self).__init__(**kwargs)
Exemple #16
0
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)
Exemple #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)
Exemple #18
0
class SignalRefLevelType(Serializable):
    """
    The signal power level information.
    """

    _fields = ('PSCRSD', 'PRcvDensity')
    _required = _fields
    _numeric_format = {fld: FLOAT_FORMAT for fld in _fields}
    # descriptors
    PSCRSD = FloatDescriptor(
        'PSCRSD', _required, strict=DEFAULT_STRICT,
        docstring='Power level in the fast time signal vector for a CW tone at f = f_0_REF'
                  ' and for f_IC(v,t) = f_0_REF.')  # type: float
    PRcvDensity = FloatDescriptor(
        'PRcvDensity', _required, strict=DEFAULT_STRICT,
        docstring='Receive power density per unit area for a CW tone at f = f_0_REF that results in'
                  ' signal vector power PS_CRSD. Signal received from a far field source located'
                  ' along the receive antenna mainlobe boresight at t = trs(v_CH_REF).')  # type:float

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

        Parameters
        ----------
        PSCRSD : float
        PRcvDensity : 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.PSCRSD = PSCRSD
        self.PRcvDensity = PRcvDensity
        super(SignalRefLevelType, self).__init__(**kwargs)
Exemple #19
0
class TropoErrorType(Serializable):
    """Troposphere delay error statistics."""
    _fields = ('TropoRangeVertical', 'TropoRangeSlant', 'TropoRangeDecorr')
    _required = ()
    _numeric_format = {'TropoRangeVertical': '0.16G', 'TropoRangeSlant': '0.16G'}
    # descriptors
    TropoRangeVertical = FloatDescriptor(
        'TropoRangeVertical', _required, strict=DEFAULT_STRICT,
        docstring='Troposphere two-way delay error for normal incidence standard deviation. '
                  r'Expressed as a range error. :math:`(\Delta R) = (\Delta T) \cdot (c/2)`.')  # type: float
    TropoRangeSlant = FloatDescriptor(
        'TropoRangeSlant', _required, strict=DEFAULT_STRICT,
        docstring='Troposphere two-way delay error for the *SCP* line of sight at *COA* standard deviation. '
                  r'Expressed as a range error. :math:`(\Delta R) = (\Delta T) \cdot (c/2)`.')  # type: float
    TropoRangeDecorr = SerializableDescriptor(
        'TropoRangeDecorr', ErrorDecorrFuncType, _required, strict=DEFAULT_STRICT,
        docstring='Troposphere range error decorrelation function.')  # type: ErrorDecorrFuncType

    def __init__(self, TropoRangeVertical=None, TropoRangeSlant=None, TropoRangeDecorr=None, **kwargs):
        """

        Parameters
        ----------
        TropoRangeVertical : float
        TropoRangeSlant : float
        TropoRangeDecorr : ErrorDecorrFuncType
        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.TropoRangeVertical, self.TropoRangeSlant = TropoRangeVertical, TropoRangeSlant
        self.TropoRangeDecorr = TropoRangeDecorr
        super(TropoErrorType, self).__init__(**kwargs)
Exemple #20
0
class CompositeSCPErrorType(Serializable):
    """
    Composite error statistics for the Scene Center Point. Slant plane range *(Rg)*
    and azimuth *(Az)* error statistics. Slant plane defined at *SCP COA*.
    """
    _fields = ('Rg', 'Az', 'RgAz')
    _required = _fields
    _numeric_format = {key: '0.16G' for key in _fields}
    # descriptors
    Rg = FloatDescriptor(
        'Rg', _required, strict=DEFAULT_STRICT,
        docstring='Estimated range error standard deviation.')  # type: float
    Az = FloatDescriptor(
        'Az', _required, strict=DEFAULT_STRICT,
        docstring='Estimated azimuth error standard deviation.')  # type: float
    RgAz = FloatDescriptor(
        'RgAz', _required, strict=DEFAULT_STRICT,
        docstring='Estimated range and azimuth error correlation coefficient.')  # type: float

    def __init__(self, Rg=None, Az=None, RgAz=None, **kwargs):
        """

        Parameters
        ----------
        Rg : float
        Az : float
        RgAz : 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.Rg, self.Az, self.RgAz = Rg, Az, RgAz
        super(CompositeSCPErrorType, self).__init__(**kwargs)
Exemple #21
0
class TropoParametersType(Serializable):
    """
    Parameters used to compute the propagation delay due to the troposphere.
    """

    _fields = ('N0', 'RefHeight')
    _required = _fields
    _numeric_format = {'N0': FLOAT_FORMAT}
    # 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)
Exemple #22
0
class YDirectionType(Serializable):
    """The Y direction of the collect"""
    _fields = ('UVectECF', 'SampleSpacing', 'NumSamples', 'FirstSample')
    _required = _fields
    _numeric_format = {'SampleSpacing': FLOAT_FORMAT, }
    # descriptors
    UVectECF = UnitVectorDescriptor(
        'UVectECF', XYZType, _required, strict=DEFAULT_STRICT,
        docstring='The unit vector in the Y direction.')  # type: XYZType
    SampleSpacing = FloatDescriptor(
        'SampleSpacing', _required, strict=DEFAULT_STRICT,
        docstring='The collection sample spacing in the Y direction in meters.')  # type: float
    NumSamples = IntegerDescriptor(
        'NumSamples', _required, strict=DEFAULT_STRICT,
        docstring='The number of samples in the Y direction.')  # type: int
    FirstSample = IntegerDescriptor(
        'FirstSample', _required, strict=DEFAULT_STRICT,
        docstring='The first sample index.')  # type: int

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

        Parameters
        ----------
        UVectECF : XYZType|numpy.ndarray|list|tuple
        SampleSpacing : float
        NumSamples : int
        FirstSample : int
        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.UVectECF = UVectECF
        self.SampleSpacing = SampleSpacing
        self.NumSamples = NumSamples
        self.FirstSample = FirstSample
        super(YDirectionType, self).__init__(**kwargs)
Exemple #23
0
class RcvChanProcType(Serializable):
    """The Received Processed Channels."""
    _fields = ('NumChanProc', 'PRFScaleFactor', 'ChanIndices')
    _required = ('NumChanProc', 'ChanIndices')
    _collections_tags = {
        'ChanIndices': {'array': False, 'child_tag': 'ChanIndex'}}
    _numeric_format = {'PRFScaleFactor': FLOAT_FORMAT}
    # descriptors
    NumChanProc = IntegerDescriptor(
        'NumChanProc', _required, strict=DEFAULT_STRICT,
        docstring='Number of receive data channels processed to form the image.')  # type: int
    PRFScaleFactor = FloatDescriptor(
        'PRFScaleFactor', _required, strict=DEFAULT_STRICT,
        docstring='Factor indicating the ratio of the effective PRF to the actual PRF.')  # type: float
    ChanIndices = IntegerListDescriptor(
        'ChanIndices', _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='Index of a data channel that was processed.')  # type: List[int]

    def __init__(self, NumChanProc=None, PRFScaleFactor=None, ChanIndices=None, **kwargs):
        """

        Parameters
        ----------
        NumChanProc : int
        PRFScaleFactor : float
        ChanIndices : List[int]
        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.NumChanProc = NumChanProc
        self.PRFScaleFactor = PRFScaleFactor
        self.ChanIndices = ChanIndices
        super(RcvChanProcType, self).__init__(**kwargs)
Exemple #24
0
class TOAExtendedType(Serializable):
    """
    The time-of-arrival (TOA) extended swath information.
    """

    _fields = ('TOAExtSaved', 'LFMEclipse')
    _required = ('TOAExtSaved', )
    _numeric_format = {'TOAExtSaved': FLOAT_FORMAT}
    # 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)
Exemple #25
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': FLOAT_FORMAT, 'TxTime2': FLOAT_FORMAT}
    # 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)
Exemple #26
0
class INCAType(Serializable):
    """Parameters for Imaging Near Closest Approach (INCA) image description."""
    _fields = ('TimeCAPoly', 'R_CA_SCP', 'FreqZero', 'DRateSFPoly',
               'DopCentroidPoly', 'DopCentroidCOA')
    _required = ('TimeCAPoly', 'R_CA_SCP', 'FreqZero', 'DRateSFPoly')
    _numeric_format = {'R_CA_SCP': '0.17E', 'FreqZero': '0.17E'}
    # descriptors
    TimeCAPoly = SerializableDescriptor(
        'TimeCAPoly',
        Poly1DType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Polynomial function that yields *Time of Closest Approach* as function of '
        'image column *(azimuth)* coordinate in meters. Time relative to '
        'collection start in seconds.')  # type: Poly1DType
    R_CA_SCP = FloatDescriptor(
        'R_CA_SCP',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        '*Range at Closest Approach (R_CA)* for the *Scene Center Point (SCP)* in meters.'
    )  # type: float
    FreqZero = FloatDescriptor(
        'FreqZero',
        _required,
        strict=DEFAULT_STRICT,
        docstring=r'*RF frequency* :\math:`(f_0)` in Hz used for computing '
        r'Doppler Centroid values. Typical :math:`f_0` '
        r'set equal to center transmit frequency.')  # type: float
    DRateSFPoly = SerializableDescriptor(
        'DRateSFPoly',
        Poly2DType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Polynomial function that yields *Doppler Rate scale factor (DRSF)* '
        'as a function of image location. Yields `DRSF` as a function of image '
        'range coordinate ``(variable 1)`` and azimuth coordinate ``(variable 2)``. '
        'Used to compute Doppler Rate at closest approach.'
    )  # type: Poly2DType
    DopCentroidPoly = SerializableDescriptor(
        'DopCentroidPoly',
        Poly2DType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Polynomial function that yields Doppler Centroid value as a '
        'function of image location *(fdop_DC)*. The *fdop_DC* is the '
        'Doppler frequency at the peak signal response. The polynomial is a function '
        'of image range coordinate ``(variable 1)`` and azimuth coordinate ``(variable 2)``. '
        '*Note: Only used for Stripmap and Dynamic Stripmap collections.*'
    )  # type: Poly2DType
    DopCentroidCOA = BooleanDescriptor(
        'DopCentroidCOA',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        """Flag indicating that the COA is at the peak signal :math`fdop_COA = fdop_DC`.
        
        * `True` - if Pixel COA at peak signal for all pixels.
        
        * `False` otherwise.
        
        *Note:* Only used for Stripmap and Dynamic Stripmap.""")  # type: bool

    def __init__(self,
                 TimeCAPoly=None,
                 R_CA_SCP=None,
                 FreqZero=None,
                 DRateSFPoly=None,
                 DopCentroidPoly=None,
                 DopCentroidCOA=None,
                 **kwargs):
        """

        Parameters
        ----------
        TimeCAPoly : Poly1DType|numpy.ndarray|list|tuple
        R_CA_SCP : float
        FreqZero : float
        DRateSFPoly : Poly2DType|numpy.ndarray|list|tuple
        DopCentroidPoly : Poly2DType|numpy.ndarray|list|tuple
        DopCentroidCOA : bool
        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.TimeCAPoly = TimeCAPoly
        self.R_CA_SCP = R_CA_SCP
        self.FreqZero = FreqZero
        self.DRateSFPoly = DRateSFPoly
        self.DopCentroidPoly = DopCentroidPoly
        self.DopCentroidCOA = DopCentroidCOA
        super(INCAType, self).__init__(**kwargs)

    def _apply_reference_frequency(self, reference_frequency):
        if self.FreqZero is not None:
            self.FreqZero += reference_frequency
Exemple #27
0
class IonoErrorType(Serializable):
    """
    Ionosphere delay error statistics.
    """

    _fields = ('IonoRangeVertical', 'IonoRangeRateVertical', 'IonoRgRgRateCC',
               'IonoRangeVertDecorr')
    _required = ('IonoRangeVertical', )
    _numeric_format = {
        'IonoRangeVertical': '0.16G',
        'IonoRangeRateVertical': '0.16G',
        'IonoRgRgRateCC': '0.16G'
    }
    # descriptors
    IonoRangeVertical = FloatDescriptor(
        'IonoRangeVertical',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'Ionosphere two-way delay error for normal incidence standard deviation. '
        r'Expressed as a range error. :math:`(\Delta R) = (\Delta T) \cdot (c/2)`.'
    )  # type: float
    IonoRangeRateVertical = FloatDescriptor(
        'IonoRangeRateVertical',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'Ionosphere two-way delay rate of change error for normal incidence standard deviation. '
        r'Expressed as a range rate error. :math:`\dot{R} = \Delta \dot{TD_Iono} \times c/2`.'
    )  # type: float
    IonoRgRgRateCC = FloatDescriptor(
        'IonoRgRgRateCC',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(-1, 1),
        docstring=
        'Ionosphere range error and range rate error correlation coefficient.'
    )  # type: float
    IonoRangeVertDecorr = SerializableDescriptor(
        'IonoRangeVertDecorr',
        ErrorDecorrFuncType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Ionosphere range error decorrelation function.'
    )  # type: ErrorDecorrFuncType

    def __init__(self,
                 IonoRangeVertical=None,
                 IonoRangeRateVertical=None,
                 IonoRgRgRateCC=None,
                 IonoRangeVertDecorr=None,
                 **kwargs):
        """

        Parameters
        ----------
        IonoRangeVertical : float
        IonoRangeRateVertical : None|float
        IonoRgRgRateCC : None|float
        IonoRangeVertDecorr : None|ErrorDecorrFuncType
        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.IonoRangeVertical = IonoRangeVertical
        self.IonoRangeRateVertical = IonoRangeRateVertical
        self.IonoRgRgRateCC = IonoRgRgRateCC
        self.IonoRangeVertDecorr = IonoRangeVertDecorr
        super(IonoErrorType, self).__init__(**kwargs)
Exemple #28
0
class LatLonEleType(Serializable, Arrayable):
    """A three-dimensional geographic point in WGS-84 coordinates."""
    _fields = ('Lat', 'Lon', 'Ele')
    _required = _fields
    _numeric_format = {'Lat': '0.16G', 'Lon': '0.16G', 'Ele': '0.16G'}
    # descriptors
    Lat = FloatDescriptor(
        'Lat',
        _required,
        strict=True,
        docstring='The latitude attribute. Assumed to be WGS-84 coordinates.'
    )  # type: float
    Lon = FloatDescriptor(
        'Lon',
        _required,
        strict=True,
        docstring='The longitude attribute. Assumed to be WGS-84 coordinates.'
    )  # type: float
    Ele = FloatDescriptor(
        'Ele',
        _required,
        strict=True,
        docstring='The Height Above Ellipsoid (in meters) attribute. '
        'Assumed to be WGS-84 coordinates.')  # type: float

    def __init__(self, Lat=None, Lon=None, Ele=None, **kwargs):
        """
        Parameters
        ----------
        Lat : float
        Lon : float
        Ele : 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.Lat = Lat
        self.Lon = Lon
        self.Ele = Ele
        super(LatLonEleType, self).__init__(Lat=Lat, Lon=Lon, **kwargs)

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

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

        Returns
        -------
        numpy.ndarray
            data array with appropriate entry order
        """

        return numpy.array([self.Lat, self.Lon, self.Ele], dtype=dtype)

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

        Parameters
        ----------
        array: numpy.ndarray|list|tuple
            assumed [Lat, Lon, Ele]

        Returns
        -------
        LatLonEleType
        """

        if array is None:
            return None
        if isinstance(array, (numpy.ndarray, list, tuple)):
            if len(array) < 3:
                raise ValueError(
                    'Expected array to be of length 3, and received {}'.format(
                        array))
            return cls(Lat=array[0], Lon=array[1], Ele=array[2])
        raise ValueError(
            'Expected array to be numpy.ndarray, list, or tuple, got {}'.
            format(type(array)))
Exemple #29
0
class RowColDoubleType(Serializable, Arrayable):
    _fields = ('Row', 'Col')
    _required = _fields
    _numeric_format = {key: '0.16G' for key in _fields}
    # Descriptors
    Row = FloatDescriptor('Row',
                          _required,
                          strict=True,
                          docstring='The Row attribute.')  # type: float
    Col = FloatDescriptor('Col',
                          _required,
                          strict=True,
                          docstring='The Column attribute.')  # type: float

    def __init__(self, Row=None, Col=None, **kwargs):
        """
        Parameters
        ----------
        Row : float
        Col : 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.Row, self.Col = Row, Col
        super(RowColDoubleType, self).__init__(**kwargs)

    def get_array(self, dtype='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 [Row, Col]
        """

        return numpy.array([self.Row, self.Col], dtype=dtype)

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

        Parameters
        ----------
        array: numpy.ndarray|list|tuple
            assumed [Row, Col]

        Returns
        -------
        RowColDoubleType
        """
        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(Row=array[0], Col=array[1])
        raise ValueError(
            'Expected array to be numpy.ndarray, list, or tuple, got {}'.
            format(type(array)))
Exemple #30
0
class AntPatternType(Serializable):
    """
    Parameter set that defines each one-way Antenna Pattern.
    """

    _fields = ('Identifier', 'FreqZero', 'EBFreqShift', 'MLFreqDilation',
               'GainZero', 'GainBSPoly', 'ArrayGPId', 'ElementGPId')
    _required = ('Identifier', 'FreqZero', 'EBFreqShift', 'MLFreqDilation',
                 'ArrayGPId', 'ElementGPId')
    _numeric_format = {'FreqZero': FLOAT_FORMAT, 'GainZero': FLOAT_FORMAT}
    # descriptors
    Identifier = StringDescriptor(
        'Identifier',
        _required,
        strict=DEFAULT_STRICT,
        docstring='String that uniquely identifies this Antenna Pattern'
    )  # type: str
    FreqZero = FloatDescriptor(
        'FreqZero',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'The reference frequency value for which the patterns are computed.'
    )  # type: float
    EBFreqShift = BooleanDescriptor(
        'EBFreqShift',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        "Parameter indicating whether the electronic boresight shifts with "
        "frequency.")  # type: bool
    MLFreqDilation = BooleanDescriptor(
        'MLFreqDilation',
        _required,
        strict=DEFAULT_STRICT,
        docstring="Parameter indicating the mainlobe (ML) width changes with "
        "frequency.")  # type: bool
    GainZero = FloatDescriptor(
        'GainZero',
        _required,
        strict=DEFAULT_STRICT,
        docstring='The reference antenna gain at zero steering angle at the '
        'reference frequency, measured in dB.')  # type: float
    GainBSPoly = SerializableDescriptor(
        'GainBSPoly',
        Poly1DType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Gain polynomial *(in dB)* as a function of frequency for boresight *(BS)* '
        'at :math:`DCX=0, DCY=0`. '
        'Frequency ratio :math:`(f-f0)/f0` is the input variable, and the constant '
        'coefficient is always `0.0`.')  # type: Poly1DType
    ArrayGPId = StringDescriptor(
        'ArrayGPId',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Support array identifier of the sampled gain/phase of the array '
        'at ref frequency.')  # type: str
    ElementGPId = StringDescriptor(
        'ElementGPId',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Support array identifier of the sampled gain/phase of the element '
        'at ref frequency.')  # type: str

    def __init__(self,
                 Identifier=None,
                 FreqZero=None,
                 EBFreqShift=None,
                 MLFreqDilation=None,
                 GainZero=None,
                 GainBSPoly=None,
                 ArrayGPId=None,
                 ElementGPId=None,
                 **kwargs):
        """

        Parameters
        ----------
        Identifier : str
        FreqZero : float
        EBFreqShift : bool
        MLFreqDilation : bool
        GainZero : None|float
        GainBSPoly : None|Poly1DType
        ArrayGPId : str
        ElementGPId : 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.Identifier = Identifier
        self.FreqZero = FreqZero
        self.EBFreqShift = EBFreqShift
        self.MLFreqDilation = MLFreqDilation
        self.GainZero = GainZero
        self.GainBSPoly = GainBSPoly
        self.ArrayGPId = ArrayGPId
        self.ElementGPId = ElementGPId
        super(AntPatternType, self).__init__(**kwargs)