Пример #1
0
class STDeskewType(Serializable):
    """
    Parameters to describe image domain ST Deskew processing.
    """

    _fields = ('Applied', 'STDSPhasePoly')
    _required = _fields
    # descriptors
    Applied = BooleanDescriptor(
        'Applied', _required, strict=DEFAULT_STRICT,
        docstring='Parameter indicating if slow time *(ST)* Deskew Phase function has been applied.')  # type: bool
    STDSPhasePoly = SerializableDescriptor(
        'STDSPhasePoly', Poly2DType, _required, strict=DEFAULT_STRICT,
        docstring='Slow time deskew phase function to perform the *ST/Kaz* shift. Two-dimensional phase '
                  '(cycles) polynomial function of image range coordinate *(variable 1)* and '
                  'azimuth coordinate *(variable 2)*.')  # type: Poly2DType

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

        Parameters
        ----------
        Applied : bool
        STDSPhasePoly : Poly2DType|numpy.ndarray|list|tuple
        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.Applied = Applied
        # noinspection PytypeChecker
        self.STDSPhasePoly = STDSPhasePoly
        super(STDeskewType, self).__init__(**kwargs)
Пример #2
0
class PolarizationCalibrationType(Serializable):
    """The polarization calibration"""
    _fields = ('DistortCorrectApplied', 'Distortion')
    _required = _fields
    # descriptors
    DistortCorrectApplied = BooleanDescriptor(
        'DistortCorrectApplied', _required, strict=DEFAULT_STRICT,
        docstring='Indicates whether the polarization calibration has been applied.')  # type: bool
    Distortion = SerializableDescriptor(
        'Distortion', DistortionType, _required, strict=DEFAULT_STRICT,
        docstring='The distortion parameters.')  # type: DistortionType

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

        Parameters
        ----------
        DistortCorrectApplied : bool
        Distortion : DistortionType
        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.DistortCorrectApplied = DistortCorrectApplied
        self.Distortion = Distortion
        super(PolarizationCalibrationType, self).__init__(**kwargs)
Пример #3
0
class ProcessingType(Serializable):
    """The transmit frequency range"""
    _fields = ('Type', 'Applied', 'Parameters')
    _required = ('Type', 'Applied')
    _collections_tags = {'Parameters': {'array': False, 'child_tag': 'Parameter'}}
    # descriptors
    Type = StringDescriptor(
        'Type', _required, strict=DEFAULT_STRICT,
        docstring='The processing type identifier.')  # type: str
    Applied = BooleanDescriptor(
        'Applied', _required, strict=DEFAULT_STRICT,
        docstring='Indicates whether the given processing type has been applied.')  # type: bool
    Parameters = ParametersDescriptor(
        'Parameters', _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='The parameters collection.')  # type: ParametersCollection

    def __init__(self, Type=None, Applied=None, Parameters=None, **kwargs):
        """

        Parameters
        ----------
        Type : str
        Applied : bool
        Parameters : 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.Type = Type
        self.Applied = Applied
        self.Parameters = Parameters
        super(ProcessingType, self).__init__(**kwargs)
Пример #4
0
class SARImagingType(Serializable):
    """
    The SAR Imaging parameters
    """

    _fields = ('TxLFMFixed', 'TxPol', 'DwellTimes', 'TxAntenna', 'ImageArea')
    _required = ('TxPol', 'DwellTimes')
    # descriptors
    TxLFMFixed = BooleanDescriptor(
        'TxLFMFixed', _required, strict=DEFAULT_STRICT,
        docstring='Flag to indicate the same transmit LFM waveform is used for all pulses.'
                  ' vectors of the channel.')  # type: Union[None, bool]
    TxPol = StringEnumDescriptor(
        'TxPol', POLARIZATION_TYPE, _required, strict=DEFAULT_STRICT,
        docstring='Transmitted signal polarization for the channel.')  # type: str
    DwellTimes = SerializableDescriptor(
        'DwellTimes', DwellTimesType, _required, strict=DEFAULT_STRICT,
        docstring='COD Time and Dwell Time polynomials over the image area.')  # type: DwellTimesType
    TxAntenna = SerializableDescriptor(
        'TxAntenna', TxAntennaType, _required, strict=DEFAULT_STRICT,
        docstring='Antenna Phase Center and Antenna Pattern identifiers for the transmit antenna'
                  ' used to illuminate the imaged area.')  # type: Union[None, TxAntennaType]
    ImageArea = SerializableDescriptor(
        'ImageArea', AreaType, _required, strict=DEFAULT_STRICT,
        docstring='SAR Image Area for the channel defined by a rectangle aligned with (IAX, IAY).'
                  ' May be reduced by the optional polygon.')  # type: Union[None, AreaType]

    def __init__(self, TxLFMFixed=None, TxPol=None, DwellTimes=None, TxAntenna=None,
                 ImageArea=None, **kwargs):
        """

        Parameters
        ----------
        TxLFMFixed : None|bool
        TxPol : PolarizationType
        DwellTimes : DwellTimesType
        TxAntenna : None|TxAntennaType
        ImageArea : None|AreaType
        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.TxLFMFixed = TxLFMFixed
        self.TxPol = TxPol
        self.DwellTimes = DwellTimes
        self.TxAntenna = TxAntenna
        self.ImageArea = ImageArea
        super(SARImagingType, self).__init__(**kwargs)
Пример #5
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
Пример #6
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)
Пример #7
0
class ImageInfoType(Serializable):
    _fields = ('DataFilename', 'ClassificationMarkings', 'Filetype',
               'DataCheckSum', 'DataSize', 'DataPlane', 'DataDomain',
               'DataType', 'BitsPerSample', 'DataFormat', 'DataByteOrder',
               'NumPixels', 'ImageCollectionDate', 'ZuluOffset',
               'SensorReferencePoint', 'SensorCalibrationFactor',
               'DataCalibrated', 'Resolution', 'PixelSpacing', 'WeightingType',
               'OverSamplingFactor', 'IPRWidth3dB', 'ImageQualityDescription',
               'ImageHeading', 'ImageCorners', 'SlantPlane', 'GroundPlane',
               'SceneCenterReferenceLine', 'ProjectionPerturbation')
    _required = ('DataFilename', 'ClassificationMarkings', 'DataCheckSum',
                 'DataPlane', 'DataDomain', 'DataType', 'DataFormat',
                 'NumPixels', 'ImageCollectionDate', 'SensorReferencePoint',
                 'DataCalibrated', 'Resolution', 'PixelSpacing',
                 'WeightingType', 'ImageCorners')
    _numeric_format = {
        'ImageHeading': '0.17G',
        'SensorCalibrationFactor': '0.17G',
        'SceneCenterReferenceLine': '0.17G',
    }
    # descriptors
    DataFilename = StringDescriptor(
        'DataFilename',
        _required,
        docstring='The base file name to which this information pertains'
    )  # type: str
    ClassificationMarkings = SerializableDescriptor(
        'ClassificationMarkings',
        ClassificationMarkingsType,
        _required,
        docstring='The classification information'
    )  # type: ClassificationMarkingsType
    Filetype = StringDescriptor(
        'Filetype', _required,
        docstring='The image file type')  # type: Optional[str]
    DataCheckSum = StringDescriptor(
        'DataCheckSum',
        _required,
        docstring='The 32 character (hexidecimal digest) MD5 checksum of the '
        'full image file')  # type: str
    DataSize = IntegerDescriptor(
        'DataSize', _required,
        docstring='The image size in bytes')  # type: Optional[int]
    DataPlane = StringEnumDescriptor('DataPlane', {'Slant', 'Ground'},
                                     _required,
                                     default_value='Slant',
                                     docstring='The image plane.')  # type: str
    DataDomain = StringEnumDescriptor(
        'DataDomain',
        {
            'Image',
        },
        _required,  # todo: values
        docstring='The image data domain')  # type: str
    DataType = StringEnumDescriptor(
        'DataType', {'Magnitude/Phase', 'In-phase/Quadrature'},
        _required,
        docstring='The image data type')  # type: str
    BitsPerSample = IntegerDescriptor(
        'BitsPerSample', _required,
        docstring='The number of bits per sample')  # type: Optional[int]
    DataFormat = StringDescriptor(
        'DataFormat', _required,
        docstring='The image data format')  # type: str
    DataByteOrder = StringEnumDescriptor(
        'DataByteOrder', {'Big-Endian', 'Little-Endian'},
        _required,
        docstring='The image data byte order.')  # type: Optional[str]
    NumPixels = SerializableDescriptor(
        'NumPixels',
        NumPixelsType,
        _required,
        docstring='The number of image pixels')  # type: NumPixelsType
    ImageCollectionDate = DateTimeDescriptor(
        'ImageCollectionDate',
        _required,
        docstring='The date/time of the image collection in UTC'
    )  # type: Optional[numpy.datetime64]
    ZuluOffset = StringDescriptor(
        'ZuluOffset', _required,
        docstring='The local time offset from UTC')  # type: Optional[str]
    SensorReferencePoint = StringEnumDescriptor(
        'DataPlane', {'Left', 'Right', 'Top', 'Bottom'},
        _required,
        docstring='Description of the sensor location relative to the scene.'
    )  # type: Optional[str]
    SensorCalibrationFactor = FloatDescriptor(
        'SensorCalibrationFactor',
        _required,
        docstring=
        'Multiplicative factor used to scale raw image data to the return '
        'of a calibrated reference reflector or active source'
    )  # type: Optional[float]
    DataCalibrated = BooleanDescriptor(
        'DataCalibrated', _required,
        docstring='Has the data been calibrated?')  # type: bool
    Resolution = SerializableDescriptor(
        'Resolution',
        RangeCrossRangeType,
        _required,
        docstring='Resolution (intrinsic) of the sensor system/mode in meters.'
    )  # type: RangeCrossRangeType
    PixelSpacing = SerializableDescriptor(
        'PixelSpacing',
        RangeCrossRangeType,
        _required,
        docstring='Pixel spacing of the image in meters.'
    )  # type: RangeCrossRangeType
    WeightingType = SerializableDescriptor(
        'WeightingType',
        StringRangeCrossRangeType,
        _required,
        docstring='Weighting function applied to the image during formation.'
    )  # type: StringRangeCrossRangeType
    OverSamplingFactor = SerializableDescriptor(
        'OverSamplingFactor',
        RangeCrossRangeType,
        _required,
        docstring='The factor by which the pixel space is oversampled.'
    )  # type: Optional[RangeCrossRangeType]
    IPRWidth3dB = SerializableDescriptor(
        'IPRWidth3dB',
        RangeCrossRangeType,
        _required,
        docstring='The 3 dB system impulse response with, in meters'
    )  # type: Optional[RangeCrossRangeType]
    ImageQualityDescription = StringDescriptor(
        'ImageQualityDescription',
        _required,
        docstring='General description of image quality'
    )  # type: Optional[str]
    ImageHeading = FloatDescriptor(
        'ImageHeading',
        _required,
        docstring='Image heading relative to True North, in degrees'
    )  # type: Optional[float]
    ImageCorners = SerializableDescriptor(
        'ImageCorners',
        ImageCornerType,
        _required,
        docstring='The image corners')  # type: ImageCornerType
    SlantPlane = SerializableDescriptor(
        'SlantPlane',
        PixelSpacingType,
        _required,
        docstring='The slant plane pixel spacing'
    )  # type: Optional[PixelSpacingType]
    GroundPlane = SerializableDescriptor(
        'GroundPlane',
        PixelSpacingType,
        _required,
        docstring='The ground plane pixel spacing'
    )  # type: Optional[PixelSpacingType]
    SceneCenterReferenceLine = FloatDescriptor(
        'SceneCenterReferenceLine',
        _required,
        docstring='The ideal line (heading) at the intersection of the radar '
        'line-of-sight with the horizontal reference plane '
        'created by the forward motion of the aircraft, '
        'in degrees')  # type: Optional[float]
    ProjectionPerturbation = SerializableDescriptor(
        'ProjectionPerturbation',
        ProjectionPerturbationType,
        _required,
        docstring='')  # type: Optional[ProjectionPerturbationType]

    def __init__(self,
                 DataFilename=None,
                 ClassificationMarkings=None,
                 FileType=None,
                 DataCheckSum=None,
                 DataSize=None,
                 DataPlane='Slant',
                 DataDomain=None,
                 DataType=None,
                 BitsPerSample=None,
                 DataFormat=None,
                 DataByteOrder=None,
                 NumPixels=None,
                 ImageCollectionDate=None,
                 ZuluOffset=None,
                 SensorReferencePoint=None,
                 SensorCalibrationFactor=None,
                 DataCalibrated=None,
                 Resolution=None,
                 PixelSpacing=None,
                 WeightingType=None,
                 OverSamplingFactor=None,
                 IPRWidth3dB=None,
                 ImageQualityDescription=None,
                 ImageHeading=None,
                 ImageCorners=None,
                 SlantPlane=None,
                 GroundPlane=None,
                 SceneCenterReferenceLine=None,
                 ProjectionPerturbation=None,
                 **kwargs):
        """
        Parameters
        ----------
        DataFilename : str
        ClassificationMarkings : ClassificationMarkingsType
        FileType : str
        DataCheckSum : str
        DataSize : int
        DataPlane : str
        DataDomain : None|str
        DataType : None|str
        BitsPerSample : None|int
        DataFormat : None|str
        DataByteOrder : None|str
        NumPixels : NumPixelsType|numpy.ndarray|list|tuple
        ImageCollectionDate : numpy.datetime64|datetime|date|str
        ZuluOffset : None|str
        SensorReferencePoint : None|str
        SensorCalibrationFactor : None|float
        DataCalibrated : bool
        Resolution : RangeCrossRangeType|numpy.ndarray|list|tuple
        PixelSpacing : RangeCrossRangeType|numpy.ndarray|list|tuple
        WeightingType : StringRangeCrossRangeType
        OverSamplingFactor : None|RangeCrossRangeType
        IPRWidth3dB : None|RangeCrossRangeType|numpy.ndarray|list|tuple
        ImageQualityDescription : None|str
        ImageHeading : None|float
        ImageCorners : ImageCornerType
        SlantPlane : None|PixelSpacingType
        GroundPlane : None|PixelSpacingType
        SceneCenterReferenceLine : None|float
        ProjectionPerturbation : None|ProjectionPerturbationType
        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.DataFilename = DataFilename

        if ClassificationMarkings is None:
            self.ClassificationMarkings = ClassificationMarkingsType()
        else:
            self.ClassificationMarkings = ClassificationMarkings

        self.Filetype = FileType
        self.DataCheckSum = DataCheckSum
        self.DataSize = DataSize
        self.DataPlane = DataPlane
        self.DataDomain = DataDomain
        self.DataType = DataType

        self.BitsPerSample = BitsPerSample
        self.DataFormat = DataFormat
        self.DataByteOrder = DataByteOrder
        self.NumPixels = NumPixels
        self.ImageCollectionDate = ImageCollectionDate
        self.ZuluOffset = ZuluOffset

        self.SensorReferencePoint = SensorReferencePoint
        self.SensorCalibrationFactor = SensorCalibrationFactor
        self.DataCalibrated = DataCalibrated
        self.Resolution = Resolution
        self.PixelSpacing = PixelSpacing
        self.WeightingType = WeightingType
        self.OverSamplingFactor = OverSamplingFactor
        self.IPRWidth3dB = IPRWidth3dB

        self.ImageQualityDescription = ImageQualityDescription
        self.ImageHeading = ImageHeading
        self.ImageCorners = ImageCorners
        self.SlantPlane = SlantPlane
        self.GroundPlane = GroundPlane
        self.SceneCenterReferenceLine = SceneCenterReferenceLine
        self.ProjectionPerturbation = ProjectionPerturbation
        super(ImageInfoType, self).__init__(**kwargs)

    @classmethod
    def from_sicd(cls,
                  sicd,
                  base_file_name,
                  file_type='NITF02.10',
                  md5_checksum=None):
        """
        Construct the ImageInfo from the sicd object and given image file name.

        Parameters
        ----------
        sicd : SICDType
        base_file_name : str
        file_type : str
            The file type. This should probably always be NITF02.10 for now.
        md5_checksum : None|str
            The md5 checksum of the full image file.

        Returns
        -------
        ImageInfoType
        """

        pixel_type = sicd.ImageData.PixelType
        if pixel_type == 'RE32F_IM32F':
            data_type = 'In-phase/Quadrature'
            bits_per_sample = 32
            data_format = 'float'
        elif pixel_type == 'RE16I_IM16I':
            data_type = 'In-phase/Quadrature'
            bits_per_sample = 16
            data_format = 'integer'
        elif pixel_type == 'AMP8I_PHS8I':
            data_type = 'Magnitude/Phase'
            bits_per_sample = 8
            data_format = 'unsigned integer'
        else:
            raise ValueError('Unhandled')

        data_cal = sicd.Radiometric is not None

        icps = ImageCornerType(UpperLeft=sicd.GeoData.ImageCorners.FRFC,
                               UpperRight=sicd.GeoData.ImageCorners.FRLC,
                               LowerRight=sicd.GeoData.ImageCorners.LRLC,
                               LowerLeft=sicd.GeoData.ImageCorners.LRFC)

        if sicd.Grid.ImagePlane == 'SLANT':
            data_plane = 'Slant'
        elif sicd.Grid.ImagePlane == 'Ground':
            data_plane = 'Ground'
        else:
            data_plane = None

        has_perturb = False
        proj_perturb = None
        coa = sicd.coa_projection
        if coa is not None:
            delta_arp = coa.delta_arp
            if numpy.any(delta_arp != 0):
                has_perturb = True
            else:
                delta_arp = None

            delta_varp = coa.delta_varp
            if numpy.any(delta_varp != 0):
                has_perturb = True
            else:
                delta_varp = None

            delta_range = coa.delta_range
            if delta_range != 0:
                has_perturb = True
            else:
                delta_range = None

            if has_perturb:
                proj_perturb = ProjectionPerturbationType(
                    CoordinateFrame='ECF',
                    DeltaArp=delta_arp,
                    DeltaVarp=delta_varp,
                    DeltaRange=delta_range)

        return ImageInfoType(
            DataFilename=base_file_name,
            ClassificationMarkings=ClassificationMarkingsType(
                Classification=sicd.CollectionInfo.Classification),
            FileType=file_type,
            DataCheckSum=md5_checksum,
            DataPlane=data_plane,
            DataType=data_type,
            DataCalibrated=data_cal,
            BitsPerSample=bits_per_sample,
            DataDomain='Image',
            DataFormat=data_format,
            DataByteOrder='Big-Endian',
            NumPixels=(sicd.ImageData.NumRows, sicd.ImageData.NumCols),
            ImageCollectionDate=sicd.Timeline.CollectStart,
            SensorReferencePoint='Top',
            Resolution=(sicd.Grid.Row.ImpRespWid, sicd.Grid.Col.ImpRespWid),
            PixelSpacing=(sicd.Grid.Row.SS, sicd.Grid.Col.SS),
            WeightingType=StringRangeCrossRangeType(
                Range=sicd.Grid.Row.WgtType.WindowName,
                CrossRange=sicd.Grid.Col.WgtType.WindowName),
            ImageHeading=sicd.SCPCOA.AzimAng,
            ImageCorners=icps,
            ProjectionPerturbation=proj_perturb)
Пример #8
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)
Пример #9
0
class ChannelParametersType(Serializable):
    """
    The CRSD data channel parameters
    """
    _fields = (
        'Identifier', 'RefVectorIndex', 'RefFreqFixed', 'FrcvFixed', 'DemodFixed',
        'F0Ref', 'Fs', 'BWInst', 'RcvPol', 'SignalNormal', 'RcvAntenna',
        'SignalRefLevel', 'NoiseLevel', 'AddedParameters', 'SARImaging')
    _required = (
        'Identifier', 'RefVectorIndex', 'RefFreqFixed', 'FrcvFixed', 'DemodFixed',
        'F0Ref', 'Fs', 'BWInst', 'RcvPol')
    _numeric_format = {
        'F0Ref': FLOAT_FORMAT, 'Fs': FLOAT_FORMAT, 'BWInst': FLOAT_FORMAT}
    _collections_tags = {
        'AddedParameters': {'array': False, 'child_tag': 'AddedParameters'}}
    # descriptors
    Identifier = StringDescriptor(
        'Identifier', _required, strict=DEFAULT_STRICT,
        docstring='String that uniquely identifies this CRSD 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
    RefFreqFixed = BooleanDescriptor(
        'RefFreqFixed', _required, strict=DEFAULT_STRICT,
        docstring='Flag to indicate a constant reference frequency is used for'
                  ' the channel.')  # type: bool
    FrcvFixed = BooleanDescriptor(
        'FrcvFixed', _required, strict=DEFAULT_STRICT,
        docstring='Flag to indicate a constant receive band is saved for the'
                  ' channel.')  # type: bool
    DemodFixed = BooleanDescriptor(
        'DemodFixed', _required, strict=DEFAULT_STRICT,
        docstring='Flag to indicate a constant demodulation is used for the'
                  ' channel.')  # type: bool
    F0Ref = FloatDescriptor(
        'F0Ref', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Reference frequency for the reference signal vector.')  # type: float
    Fs = FloatDescriptor(
        'Fs', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Fast time sample rate for the signal array.')  # type: float
    BWInst = FloatDescriptor(
        'BWInst', _required, strict=DEFAULT_STRICT, bounds=(0, None),
        docstring='Nominal instantaneous bandwidth for the channel.')  # type: float
    RcvPol = StringEnumDescriptor(
        'RcvPol', POLARIZATION_TYPE, _required, strict=DEFAULT_STRICT,
        docstring='Receive polarization for the signal data processed to form the signal array.'
                  ' Parameter describes the E-Field orientation of the signal.')  # type: str
    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: Union[None, bool]
    RcvAntenna = SerializableDescriptor(
        'RcvAntenna', RcvAntennaType, _required, strict=DEFAULT_STRICT,
        docstring='Antenna Phase Center and Antenna Pattern identifiers for the receive antenna'
                  ' used to collect and form the signal array data.')  # type: Union[None, RcvAntennaType]
    SignalRefLevel = SerializableDescriptor(
        'SignalRefLevel', SignalRefLevelType, _required, strict=DEFAULT_STRICT,
        docstring='Signal power levels for a received CW signal with f = f_0_REF and polarization'
                  ' matched to RcvPol of the channel.')  # type: Union[None, SignalRefLevelType]
    NoiseLevel = SerializableDescriptor(
        'NoiseLevel', NoiseLevelType, _required, strict=DEFAULT_STRICT,
        docstring='Thermal noise level in the CRSD signal vector for f_IC(v,t) ='
                  ' f_0(v_CH_REF).')  # type: Union[None, NoiseLevelType]
    AddedParameters = ParametersDescriptor(
        'AddedParameters', _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='Additional free form parameters.')  # type: Union[None, ParametersCollection]
    SARImaging = SerializableDescriptor(
        'SARImaging', SARImagingType, _required, strict=DEFAULT_STRICT,
        docstring='Structure included for all SAR imaging collections.')  # type: Union[None, SARImagingType]

    def __init__(self, Identifier=None, RefVectorIndex=None, RefFreqFixed=None,
                 FrcvFixed=None, DemodFixed=None, F0Ref=None, Fs=None, BWInst=None,
                 RcvPol=None, SignalNormal=None, RcvAntenna=None, SignalRefLevel=None,
                 NoiseLevel=None, AddedParameters=None, SARImaging=None, **kwargs):
        """

        Parameters
        ----------
        Identifier : str
        RefVectorIndex : int
        RefFreqFixed : bool
        FrcvFixed : bool
        DemodFixed : bool
        F0Ref : float
        Fs : float
        BWInst : float
        RcvPol : str
        SignalNormal : None|bool
        RcvAntenna : None|RcvAntennaType
        SignalRefLevel : None|SignalRefLevelType
        NoiseLevel : None|NoiseLevelType
        AddedParameters : None|ParametersCollection
        SARImaging : None|SARImagingType
        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.RefFreqFixed = RefFreqFixed
        self.FrcvFixed = FrcvFixed
        self.DemodFixed = DemodFixed
        self.F0Ref = F0Ref
        self.Fs = Fs
        self.BWInst = BWInst
        self.RcvPol = RcvPol
        self.SignalNormal = SignalNormal
        self.RcvAntenna = RcvAntenna
        self.SignalRefLevel = SignalRefLevel
        self.NoiseLevel = NoiseLevel
        self.AddedParameters = AddedParameters
        self.SARImaging = SARImaging
        super(ChannelParametersType, self).__init__(**kwargs)
Пример #10
0
class AntParamType(Serializable):
    """
    The antenna parameters container.
    """

    _fields = ('XAxisPoly', 'YAxisPoly', 'FreqZero', 'EB', 'Array', 'Elem',
               'GainBSPoly', 'EBFreqShift', 'MLFreqDilation')
    _required = ('XAxisPoly', 'YAxisPoly', 'FreqZero', 'Array')
    _numeric_format = {'FreqZero': FLOAT_FORMAT}
    # descriptors
    XAxisPoly = SerializableDescriptor(
        'XAxisPoly',
        XYZPolyType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Antenna X-Axis unit vector in ECF coordinates as a function of time ``(variable 1)``.'
    )  # type: XYZPolyType
    YAxisPoly = SerializableDescriptor(
        'YAxisPoly',
        XYZPolyType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Antenna Y-Axis unit vector in ECF coordinates as a function of time ``(variable 1)``.'
    )  # type: XYZPolyType
    FreqZero = FloatDescriptor(
        'FreqZero',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'RF frequency *(f0)* used to specify the array pattern and electrical boresite *(EB)* '
        'steering direction cosines.')  # type: float
    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
    Elem = SerializableDescriptor(
        'Elem',
        GainPhasePolyType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Element array pattern polynomials for electronically steered arrays.'
    )  # type: GainPhasePolyType
    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 ``(variable 1)``, and the constant '
        'coefficient is always `0.0`.')  # type: Poly1DType
    EBFreqShift = BooleanDescriptor('EBFreqShift',
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring="""
        Parameter indicating whether the electronic boresite shifts with frequency for an electronically steered array.
        
        * `False` - No shift with frequency.
        
        * `True` - Shift with frequency per ideal array theory.
        
        """)  # type: bool
    MLFreqDilation = BooleanDescriptor('MLFreqDilation',
                                       _required,
                                       strict=DEFAULT_STRICT,
                                       docstring="""
        Parameter indicating the mainlobe (ML) width changes with frequency.
        
        * `False` - No change with frequency.
        
        * `True` - Change with frequency per ideal array theory.
        
        """)  # type: bool

    def __init__(self,
                 XAxisPoly=None,
                 YAxisPoly=None,
                 FreqZero=None,
                 EB=None,
                 Array=None,
                 Elem=None,
                 GainBSPoly=None,
                 EBFreqShift=None,
                 MLFreqDilation=None,
                 **kwargs):
        """
        Parameters
        ----------
        XAxisPoly : XYZPolyType
        YAxisPoly : XYZPolyType
        FreqZero : float
        EB : EBType
        Array : GainPhasePolyType
        Elem : GainPhasePolyType
        GainBSPoly : Poly1DType|numpy.ndarray|list|tuple
        EBFreqShift : bool
        MLFreqDilation : bool
        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.XAxisPoly, self.YAxisPoly = XAxisPoly, YAxisPoly
        self.FreqZero = FreqZero
        self.EB = EB
        self.Array, self.Elem = Array, Elem
        self.GainBSPoly = GainBSPoly
        self.EBFreqShift, self.MLFreqDilation = EBFreqShift, MLFreqDilation
        super(AntParamType, self).__init__(**kwargs)

    def _apply_reference_frequency(self, reference_frequency):
        if self.FreqZero is not None:
            self.FreqZero += reference_frequency
Пример #11
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)
Пример #12
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': FLOAT_FORMAT, 'FxBW': FLOAT_FORMAT, 'FxBWNoise': FLOAT_FORMAT, 'TOASaved': FLOAT_FORMAT}
    # 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)
Пример #13
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)