Пример #1
0
class ChannelType(Serializable):
    """
    The channel definition.
    """

    _fields = ('RefChId', 'FXFixedCPHD', 'TOAFixedCPHD', 'SRPFixedCPHD',
               'Parameters', 'AddedParameters')
    _required = ('RefChId', 'FXFixedCPHD', 'TOAFixedCPHD', 'SRPFixedCPHD',
                 'Parameters')
    _collections_tags = {
        'Parameters': {
            'array': False,
            'child_tag': 'Parameters'
        },
        'AddedParameters': {
            'array': False,
            'child_tag': 'AddedParameters'
        }
    }
    # descriptors
    RefChId = _StringDescriptor(
        'RefChId',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Channel ID for the Reference Channel in the '
        'product.')  # type: str
    FXFixedCPHD = _BooleanDescriptor(
        'FXFixedCPHD',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Flag to indicate when a constant FX band is saved for all '
        'signal vectors of all channels.')  # type: bool
    TOAFixedCPHD = _BooleanDescriptor(
        'TOAFixedCPHD',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Flag to indicate when a constant TOA swath is saved for all '
        'signal vectors of all channels.')  # type: bool
    SRPFixedCPHD = _BooleanDescriptor(
        'SRPFixedCPHD',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Flag to indicate when a constant SRP position is used all '
        'signal vectors of all channels.')  # type: bool
    Parameters = _SerializableListDescriptor(
        'Parameters',
        ChannelParametersType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameter Set that describes a CPHD data '
        'channel.')  # type: List[ChannelParametersType]
    AddedParameters = _ParametersDescriptor(
        'AddedParameters',
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Additional free form parameters.'
    )  # type: Union[None, ParametersCollection]

    def __init__(self,
                 RefChId=None,
                 FXFixedCPHD=None,
                 TOAFixedCPHD=None,
                 SRPFixedCPHD=None,
                 Parameters=None,
                 AddedParameters=None,
                 **kwargs):
        """

        Parameters
        ----------
        RefChId : str
        FXFixedCPHD : bool
        TOAFixedCPHD : bool
        SRPFixedCPHD : bool
        Parameters : List[ChannelParametersType]
        AddedParameters
        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.RefChId = RefChId
        self.FXFixedCPHD = FXFixedCPHD
        self.TOAFixedCPHD = TOAFixedCPHD
        self.SRPFixedCPHD = SRPFixedCPHD
        self.Parameters = Parameters
        self.AddedParameters = AddedParameters
        super(ChannelType, self).__init__(**kwargs)
Пример #2
0
class AntPatternType(Serializable):
    """
    Parameter set that defines each Antenna Pattern as function time.
    """

    _fields = ('Identifier', 'FreqZero', 'GainZero', 'EBFreqShift',
               'MLFreqDilation', 'GainBSPoly', 'EB', 'Array', 'Element',
               'GainPhaseArray')
    _required = ('Identifier', 'FreqZero', 'EB', 'Array', 'Element')
    _collections_tags = {
        'GainPhaseArray': {
            'array': False,
            'child_tag': 'GainPhaseArray'
        }
    }
    _numeric_format = {'FreqZero': '0.16G', 'GainZero': '0.16G'}
    # descriptors
    Identifier = _StringDescriptor(
        'Identifier',
        _required,
        strict=DEFAULT_STRICT,
        docstring='String that uniquely identifies this ACF.')  # type: str
    FreqZero = _FloatDescriptor(
        'FreqZero',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'The reference frequency value for which the Electrical Boresight '
        'and array pattern polynomials are computed.')  # type: float
    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
    EBFreqShift = _BooleanDescriptor(
        'EBFreqShift',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        "Parameter indicating whether the electronic boresite shifts with "
        "frequency.")  # type: bool
    MLFreqDilation = _BooleanDescriptor(
        'MLFreqDilation',
        _required,
        strict=DEFAULT_STRICT,
        docstring="Parameter indicating the mainlobe (ML) width changes with "
        "frequency.")  # type: bool
    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
    EB = _SerializableDescriptor(
        'EB',
        EBType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Electrical boresight *(EB)* steering directions for an electronically '
        'steered array.')  # type: EBType
    Array = _SerializableDescriptor(
        'Array',
        GainPhasePolyType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Array pattern polynomials that define the shape of the '
        'main-lobe.')  # type: GainPhasePolyType
    Element = _SerializableDescriptor(
        'Element',
        GainPhasePolyType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Element array pattern polynomials for electronically steered '
        'arrays.')  # type: GainPhasePolyType
    GainPhaseArray = _SerializableListDescriptor(
        'GainPhaseArray',
        GainPhaseArrayType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Array of parameters that identify 2-D sampled Gain and Phase patterns at '
        'single frequency value.'
    )  # type: Union[None, List[GainPhaseArrayType]]

    def __init__(self,
                 Identifier=None,
                 FreqZero=None,
                 GainZero=None,
                 EBFreqShift=None,
                 MLFreqDilation=None,
                 GainBSPoly=None,
                 EB=None,
                 Array=None,
                 Element=None,
                 GainPhaseArray=None,
                 **kwargs):
        """

        Parameters
        ----------
        Identifier : str
        FreqZero : float
        GainZero : float
        EBFreqShift : bool
        MLFreqDilation : bool
        GainBSPoly : None|Poly1DType
        EB : EBType
        Array : GainPhasePolyType
        Element : GainPhasePolyType
        GainPhaseArray : None|List[GainPhaseArrayType]
        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.GainZero = GainZero
        self.EBFreqShift = EBFreqShift
        self.MLFreqDilation = MLFreqDilation
        self.GainBSPoly = GainBSPoly
        self.EB = EB
        self.Array = Array
        self.Element = Element
        self.GainPhaseArray = GainPhaseArray
        super(AntPatternType, self).__init__(**kwargs)
Пример #3
0
class ChannelParametersType(Serializable):
    _fields = ('Identifier', 'RefVectorIndex', 'FXFixed', 'TOAFixed',
               'SRPFixed', 'SignalNormal', 'Polarization', 'FxC', 'FxBW',
               'FxBWNoise', 'TOASaved', 'TOAExtended', 'DwellTimes',
               'ImageArea', 'Antenna', 'TxRcv', 'TgtRefLevel', 'NoiseLevel')
    _required = ('Identifier', 'RefVectorIndex', 'FXFixed', 'TOAFixed',
                 'SRPFixed', 'Polarization', 'FxC', 'FxBW', 'TOASaved',
                 'DwellTimes')
    _numeric_format = {
        'FxC': '0.16G',
        'FxBW': '0.16G',
        'FxBWNoise': '0.16G',
        'TOASaved': '0.16G'
    }
    # descriptors
    Identifier = _StringDescriptor(
        'Identifier',
        _required,
        strict=DEFAULT_STRICT,
        docstring='String that uniquely identifies this CPHD data channel.'
    )  # type: str
    RefVectorIndex = _IntegerDescriptor(
        'RefVectorIndex',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='Index of the reference vector for the channel.'
    )  # type: int
    FXFixed = _BooleanDescriptor(
        'FXFixed',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Flag to indicate when a constant FX band is saved for all signal '
        'vectors of the channel.')  # type: bool
    TOAFixed = _BooleanDescriptor(
        'TOAFixed',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Flag to indicate when a constant TOA swath is saved for all '
        'signal vectors of the channel.')  # type: bool
    SRPFixed = _BooleanDescriptor(
        'SRPFixed',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Flag to indicate when a constant SRP position is used all '
        'signal vectors of the channel.')  # type: bool
    SignalNormal = _BooleanDescriptor(
        'SignalNormal',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Flag to indicate when all signal array vectors are normal. '
        'Included if and only if the SIGNAL PVP is also included.'
    )  # type: bool
    Polarization = _SerializableDescriptor(
        'Polarization',
        PolarizationType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Polarization(s) of the signals that formed the signal '
        'array.')  # type: PolarizationType
    FxC = _FloatDescriptor(
        'FxC',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'FX center frequency value for saved bandwidth for the channel. '
        'Computed from all vectors of the signal array.')  # type: float
    FxBW = _FloatDescriptor(
        'FxBW',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring='FX band spanned for the saved bandwidth for the channel. '
        'Computed from all vectors of the signal array.')  # type: float
    FxBWNoise = _FloatDescriptor(
        'FxBWNoise',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'FX signal bandwidth saved that includes noise signal below or '
        'above the retained echo signal bandwidth.')  # type: float
    TOASaved = _FloatDescriptor(
        'TOASaved',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'TOA swath saved for the full resolution echoes for the channel.'
    )  # type: float
    TOAExtended = _SerializableDescriptor(
        'TOAExtended',
        TOAExtendedType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='TOA extended swath information.'
    )  # type: Union[None, TOAExtendedType]
    DwellTimes = _SerializableDescriptor(
        'DwellTimes',
        DwellTimesType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='COD Time and Dwell Time polynomials over the image area.'
    )  # type: DwellTimesType
    ImageArea = _SerializableDescriptor(
        'ImageArea',
        AreaType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Image Area for the CPHD channel defined by a rectangle aligned with '
        '(IAX, IAY). May be reduced by the optional '
        'polygon.')  # type: Union[None, AreaType]
    Antenna = _SerializableDescriptor(
        'Antenna',
        AntennaType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Antenna Phase Center and Antenna Pattern identifiers for the antenna(s) '
        'used to collect and form the signal array data.'
    )  # type: Union[None, AntennaType]
    TxRcv = _SerializableDescriptor(
        'TxRcv',
        TxRcvType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Parameters to identify the Transmit and Receive parameter sets '
        'used to collect the signal array.')  # type: Union[None, TxRcvType]
    TgtRefLevel = _SerializableDescriptor(
        'TgtRefLevel',
        TgtRefLevelType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Signal level for an ideal point scatterer located at the SRP for '
        'reference signal vector.')  # type: Union[None, TgtRefLevelType]
    NoiseLevel = _SerializableDescriptor(
        'NoiseLevel',
        NoiseLevelType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Thermal noise level for the reference signal '
        'vector.')  # type: Union[None, NoiseLevelType]

    def __init__(self,
                 Identifier=None,
                 RefVectorIndex=None,
                 FXFixed=None,
                 TOAFixed=None,
                 SRPFixed=None,
                 SignalNormal=None,
                 Polarization=None,
                 FxC=None,
                 FxBW=None,
                 FxBWNoise=None,
                 TOASaved=None,
                 TOAExtended=None,
                 DwellTimes=None,
                 ImageArea=None,
                 Antenna=None,
                 TxRcv=None,
                 TgtRefLevel=None,
                 NoiseLevel=None,
                 **kwargs):
        """

        Parameters
        ----------
        Identifier : str
        RefVectorIndex : int
        FXFixed : bool
        TOAFixed : bool
        SRPFixed : bool
        SignalNormal : None|bool
        Polarization : PolarizationType
        FxC : float
        FxBW : float
        FxBWNoise : None|float
        TOASaved : float
        TOAExtended : None|TOAExtendedType
        DwellTimes : DwellTimesType
        ImageArea : None|AreaType
        Antenna : None|AntennaType
        TxRcv : None|TxRcvType
        TgtRefLevel : None|TgtRefLevelType
        NoiseLevel : None|NoiseLevelType
        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.RefVectorIndex = RefVectorIndex
        self.FXFixed = FXFixed
        self.TOAFixed = TOAFixed
        self.SRPFixed = SRPFixed
        self.SignalNormal = SignalNormal
        self.Polarization = Polarization
        self.FxC = FxC
        self.FxBW = FxBW
        self.FxBWNoise = FxBWNoise
        self.TOASaved = TOASaved
        self.TOAExtended = TOAExtended
        self.DwellTimes = DwellTimes
        self.ImageArea = ImageArea
        self.Antenna = Antenna
        self.TxRcv = TxRcv
        self.TgtRefLevel = TgtRefLevel
        self.NoiseLevel = NoiseLevel
        super(ChannelParametersType, self).__init__(**kwargs)
Пример #4
0
class TxRcvPolarizationType(Serializable):
    """
    The transmit/receive polarization information.
    """

    _fields = ('TxPolarization', 'RcvPolarization', 'RcvPolarizationOffset',
               'Processed')
    _required = ('TxPolarization', 'RcvPolarization')
    _numeric_format = {'RcvPolarizationOffset': '0.16G'}
    # Descriptor
    TxPolarization = _StringEnumDescriptor(
        'TxPolarization',
        POLARIZATION1_VALUES,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Transmit polarization type.')  # type: str
    RcvPolarization = _StringEnumDescriptor(
        'RcvPolarization',
        POLARIZATION1_VALUES,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Receive polarization type.')  # type: str
    RcvPolarizationOffset = _FloatModularDescriptor(
        'RcvPolarizationOffset',
        180.0,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Angle offset for the receive polarization defined at aperture '
        'center.')  # type: Union[None, float]
    Processed = _BooleanDescriptor('Processed',
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: Union[None, bool]

    def __init__(self,
                 TxPolarization=None,
                 RcvPolarization=None,
                 RcvPolarizationOffset=None,
                 Processed=None,
                 **kwargs):
        """

        Parameters
        ----------
        TxPolarization : str
        RcvPolarization : str
        RcvPolarizationOffset : None|float
        Processed : None|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.TxPolarization = TxPolarization
        self.RcvPolarization = RcvPolarization
        self.RcvPolarizationOffset = RcvPolarizationOffset
        self.Processed = Processed
        super(TxRcvPolarizationType, self).__init__(**kwargs)

    @classmethod
    def from_sicd_value(cls, str_in):
        """
        Construct from the sicd style tx/rcv polarization string.

        Parameters
        ----------
        str_in : str

        Returns
        -------
        TxRcvPolarizationType
        """

        tx, rcv = _extract_sicd_tx_rcv_pol(str_in)
        return cls(TxPolarization=tx, RcvPolarization=rcv)