Exemplo n.º 1
0
class GeographicAndTargetType(Serializable):
    """
    Container specifying the image coverage area in geographic coordinates, as
    well as optional data about the target of the collection/product.
    """

    _fields = ('GeographicCoverage', 'TargetInformations')
    _required = ('GeographicCoverage', )
    _collections_tags = {'TargetInformations': {'array': False, 'child_tag': 'TargetInformation'}}
    # Descriptors
    GeographicCoverage = _SerializableDescriptor(
        'GeographicCoverage', GeographicCoverageType, _required, strict=DEFAULT_STRICT,
        docstring='Provides geographic coverage information.')  # type: GeographicCoverageType
    TargetInformations = _SerializableListDescriptor(
        'TargetInformations', TargetInformationType, _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='Provides target specific geographic '
                  'information.')  # type: Union[None, List[TargetInformationType]]

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

        Parameters
        ----------
        GeographicCoverage : GeographicCoverageType
        TargetInformations : None|List[TargetInformationType]
        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.GeographicCoverage = GeographicCoverage
        self.TargetInformations = TargetInformations
        super(GeographicAndTargetType, self).__init__(**kwargs)
Exemplo n.º 2
0
class ChannelType(Serializable):
    """
    Channel specific parameters for CPHD.
    """

    _fields = ('Parameters', )
    _required = ('Parameters', )
    _collections_tags = {'Parameters': {'array': False, 'child_tag': 'Parameters'}}
    # descriptors
    Parameters = _SerializableListDescriptor(
        'Parameters', ParametersType, _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='Channel dependent parameter list.')  # type: List[ParametersType]

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

        Parameters
        ----------
        Parameters : List[ParametersType]
        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.Parameters = Parameters
        super(ChannelType, self).__init__(**kwargs)
Exemplo n.º 3
0
class AnnotationsType(Serializable):
    """
    The list of annotations.
    """

    _fields = ('Annotations', )
    _required = ('Annotations', )
    _collections_tags = {'Annotations': {'array': False, 'child_tag': 'Annotation'}}
    # Descriptor
    Annotations = _SerializableListDescriptor(
        'Annotations', AnnotationType, _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='')  # type: List[AnnotationType]

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

        Parameters
        ----------
        Annotations : List[AnnotationType]
        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.Annotations = Annotations
        super(AnnotationsType, self).__init__(**kwargs)

    def __len__(self):
        return len(self.Annotations)

    def __getitem__(self, item):
        return self.Annotations[item]
Exemplo n.º 4
0
class DataType(Serializable):
    """
    Parameters that describe binary data components contained in the product.
    """

    _fields = ('SampleType', 'NumCPHDChannels', 'NumBytesVBP', 'ArraySize')
    _required = ('SampleType', 'NumBytesVBP', 'ArraySize')
    _collections_tags = {'ArraySize': {'array': False, 'child_tag': 'ArraySize'}}
    # descriptors
    SampleType = _StringEnumDescriptor(
        'SampleType', ("RE32F_IM32F", "RE16I_IM16I", "RE08I_IM08I"), _required, strict=True,
        docstring="Indicates the PHD sample format of the PHD array(s). All arrays "
                  "have the sample type. Real and imaginary components stored in adjacent "
                  "bytes, real component stored first.")  # type: str
    NumBytesVBP = _IntegerDescriptor(
        'NumBytesVBP', _required, strict=DEFAULT_STRICT, bounds=(1, None),
        docstring='Number of bytes per set of Vector Based Parameters.')  # type: int
    ArraySize = _SerializableListDescriptor(
        'ArraySize', ArraySizeType, _collections_tags, _required, strict=DEFAULT_STRICT,
        docstring='CPHD array size parameters.')  # type: List[ArraySizeType]

    def __init__(self, SampleType=None, NumBytesVBP=None, ArraySize=None, **kwargs):
        """

        Parameters
        ----------
        SampleType : str
        NumBytesVBP : int
        ArraySize : List[ArraySizeType]
        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.SampleType = SampleType
        self.NumBytesVBP = NumBytesVBP
        self.ArraySize = ArraySize
        super(DataType, self).__init__(**kwargs)

    @property
    def NumCPHDChannels(self):
        """
        int: The number of CPHD channels.
        """

        if self.ArraySize is None:
            return 0
        return len(self.ArraySize)
Exemplo n.º 5
0
class AnnotationType(Serializable):
    """
    The annotation type.
    """

    _fields = ('Identifier', 'SpatialReferenceSystem', 'Objects')
    _required = ('Identifier', 'Objects')
    _collections_tags = {'Objects': {'array': False, 'child_tag': 'Object'}}
    # Descriptor
    Identifier = _StringDescriptor('Identifier',
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: str
    SpatialReferenceSystem = _SerializableDescriptor(
        'SpatialReferenceSystem',
        ReferenceSystemType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: Union[None, ReferenceSystemType]
    Objects = _SerializableListDescriptor(
        'Objects',
        AnnotationObjectType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: List[AnnotationObjectType]

    def __init__(self,
                 Identifier=None,
                 SpatialReferenceSystem=None,
                 Objects=None,
                 **kwargs):
        """

        Parameters
        ----------
        Identifier : str
        SpatialReferenceSystem : None|ReferenceSystemType
        Objects : List[AnnotationObjectType]
        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.SpatialReferenceSystem = SpatialReferenceSystem
        self.Objects = Objects
        super(AnnotationType, self).__init__(**kwargs)
Exemplo n.º 6
0
class DownstreamReprocessingType(Serializable):
    """
    Further processing after initial image creation.
    """

    _fields = ('GeometricChip', 'ProcessingEvents')
    _required = ()
    _collections_tags = {
        'ProcessingEvents': {
            'array': False,
            'child_tag': 'ProcessingEvent'
        }
    }
    # Descriptor
    GeometricChip = _SerializableDescriptor(
        'GeometricChip',
        GeometricChipType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: Union[None, GeometricChipType]
    ProcessingEvents = _SerializableListDescriptor(
        'ProcessingEvents',
        ProcessingEventType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: Union[None, List[ProcessingEventType]]

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

        Parameters
        ----------
        GeometricChip : None|GeometricChipType
        ProcessingEvents : None|List[ProcessingEventType]
        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.GeometricChip = GeometricChip
        self.ProcessingEvents = ProcessingEvents
        super(DownstreamReprocessingType, self).__init__(**kwargs)
Exemplo n.º 7
0
class ExploitationFeaturesType(Serializable):
    """
    Computed metadata regarding the collect.
    """
    _fields = ('Collections', 'Products')
    _required = ('Collections', 'Products')
    _collections_tags = {
        'Collections': {
            'array': False,
            'child_tag': 'Collection'
        },
        'Products': {
            'array': False,
            'child_tag': 'Product'
        }
    }
    # Descriptor
    Collections = _SerializableListDescriptor(
        'Collections',
        CollectionType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: List[CollectionType]
    Products = _SerializableListDescriptor(
        'Products',
        ExploitationFeaturesProductType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: List[ExploitationFeaturesProductType]

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

        Parameters
        ----------
        Collections : List[CollectionType]
        Products : List[ExploitationFeaturesProductType]
        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.Collections = Collections
        self.Products = Products
        super(ExploitationFeaturesType, self).__init__(**kwargs)

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

        Parameters
        ----------
        sicd : SICDType|List[SICDType]
        row_vector : numpy.ndarray
        col_vector : numpy.ndarray

        Returns
        -------
        ExploitationFeaturesType
        """

        if isinstance(sicd, (list, tuple)):
            collections = []
            feats = []
            for i, entry in sicd:
                calculator = ExploitationCalculator.from_sicd(
                    entry, row_vector, col_vector)
                collections.append(
                    CollectionType.from_calculator(calculator, entry))
                feats.append(ExploitationFeaturesProductType.from_sicd(entry))
            return cls(Collections=collections, Products=feats)

        if not isinstance(sicd, SICDType):
            raise TypeError('Requires SICDType instance, got type {}'.format(
                type(sicd)))
        return cls(Collections=[
            CollectionType.from_calculator(
                ExploitationCalculator.from_sicd(sicd, row_vector, col_vector),
                sicd),
        ],
                   Products=[ExploitationFeaturesProductType.from_sicd(sicd)])
Exemplo n.º 8
0
class SupportArrayType(Serializable):
    """
    Parameters that describe the binary support array(s) content and
    grid coordinates.
    """

    _fields = ('IAZArray', 'AntGainPhase', 'AddedSupportArray')
    _required = ()
    _collections_tags = {
        'IAZArray': {
            'array': False,
            'child_tag': 'IAZArray'
        },
        'AntGainPhase': {
            'array': False,
            'child_tag': 'AntGainPhase'
        },
        'AddedSupportArray': {
            'array': False,
            'child_tag': 'AddedSupportArray'
        }
    }
    # descriptors
    IAZArray = _SerializableListDescriptor(
        'IAZArray',
        IAZArrayType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Arrays of scene surface heights expressed in image coordinate IAZ '
        'values (meters). Grid coordinates are image area coordinates '
        '(IAX, IAY).')  # type: Union[None, List[IAZArrayType]]
    AntGainPhase = _SerializableListDescriptor(
        'AntGainPhase',
        AntGainPhaseType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Antenna arrays with values are antenna gain and phase expressed in dB '
        'and cycles. Array coordinates are direction cosines with respect to '
        'the ACF (DCX, DCY).')  # type: Union[None, List[AntGainPhaseType]]
    AddedSupportArray = _SerializableListDescriptor(
        'AddedSupportArray',
        AddedSupportArrayType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Additional arrays (two-dimensional), where the content and format and units of each '
        'element are user defined.'
    )  # type: Union[None, List[AddedSupportArrayType]]

    def __init__(self,
                 IAZArray=None,
                 AntGainPhase=None,
                 AddedSupportArray=None,
                 **kwargs):
        """

        Parameters
        ----------
        IAZArray : None|List[IAZArrayType]
        AntGainPhase : None|List[AntGainPhaseType]
        AddedSupportArray : None|List[AddedSupportArrayType]
        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.IAZArray = IAZArray
        self.AntGainPhase = AntGainPhase
        self.AddedSupportArray = AddedSupportArray
        super(SupportArrayType, self).__init__(**kwargs)

    def find_support_array(self, identifier):
        """
        Find and return the details for support array associated with the given identifier.

        Parameters
        ----------
        identifier : str

        Returns
        -------
        IAZArrayType|AntGainPhaseType|AddedSupportArrayType
        """

        if self.IAZArray is not None:
            for entry in self.IAZArray:
                if entry.Identifier == identifier:
                    return entry

        if self.AntGainPhase is not None:
            for entry in self.AntGainPhase:
                if entry.Identifier == identifier:
                    return entry

        if self.AddedSupportArray is not None:
            for entry in self.AddedSupportArray:
                if entry.Identifier == identifier:
                    return entry

        raise KeyError(
            'Identifier {} not associated with a support array.'.format(
                identifier))
Exemplo n.º 9
0
class PVPType(Serializable):
    _fields = ('TxTime', 'TxPos', 'TxVel', 'RcvTime', 'RcvPos', 'RcvVel',
               'SRPPos', 'AmpSF', 'aFDOP', 'aFRR1', 'aFRR2', 'FX1', 'FX2',
               'FXN1', 'FXN2', 'TOA1', 'TOA2', 'TOAE1', 'TOAE2', 'TDTropoSRP',
               'TDIonoSRP', 'SC0', 'SCSS', 'SIGNAL', 'AddedPVP')
    _required = ('TxTime', 'TxPos', 'TxVel', 'RcvTime', 'RcvPos', 'RcvVel',
                 'SRPPos', 'aFDOP', 'aFRR1', 'aFRR2', 'FX1', 'FX2', 'TOA1',
                 'TOA2', 'TDTropoSRP', 'SC0', 'SCSS')
    _collections_tags = {'AddedPVP': {'array': False, 'child_tag': 'AddedPVP'}}
    # descriptors
    TxTime = _SerializableDescriptor(
        'TxTime',
        PerVectorParameterF8,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterF8
    TxPos = _SerializableDescriptor(
        'TxPos',
        PerVectorParameterXYZ,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterXYZ
    TxVel = _SerializableDescriptor(
        'TxVel',
        PerVectorParameterXYZ,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterXYZ
    RcvTime = _SerializableDescriptor(
        'RcvTime',
        PerVectorParameterF8,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterF8
    RcvPos = _SerializableDescriptor(
        'RcvPos',
        PerVectorParameterXYZ,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterXYZ
    RcvVel = _SerializableDescriptor(
        'RcvVel',
        PerVectorParameterXYZ,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterXYZ
    SRPPos = _SerializableDescriptor(
        'SRPPos',
        PerVectorParameterXYZ,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterXYZ
    AmpSF = _SerializableDescriptor('AmpSF',
                                    PerVectorParameterF8,
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring='')  # type: PerVectorParameterF8
    aFDOP = _SerializableDescriptor('aFDOP',
                                    PerVectorParameterF8,
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring='')  # type: PerVectorParameterF8
    aFRR1 = _SerializableDescriptor('aFRR1',
                                    PerVectorParameterF8,
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring='')  # type: PerVectorParameterF8
    aFRR2 = _SerializableDescriptor('aFRR2',
                                    PerVectorParameterF8,
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring='')  # type: PerVectorParameterF8
    FX1 = _SerializableDescriptor('FX1',
                                  PerVectorParameterF8,
                                  _required,
                                  strict=DEFAULT_STRICT,
                                  docstring='')  # type: PerVectorParameterF8
    FX2 = _SerializableDescriptor('FX2',
                                  PerVectorParameterF8,
                                  _required,
                                  strict=DEFAULT_STRICT,
                                  docstring='')  # type: PerVectorParameterF8
    FXN1 = _SerializableDescriptor('FXN1',
                                   PerVectorParameterF8,
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: PerVectorParameterF8
    FXN2 = _SerializableDescriptor('FXN2',
                                   PerVectorParameterF8,
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: PerVectorParameterF8
    TOA1 = _SerializableDescriptor('TOA1',
                                   PerVectorParameterF8,
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: PerVectorParameterF8
    TOA2 = _SerializableDescriptor('TOA2',
                                   PerVectorParameterF8,
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: PerVectorParameterF8
    TOAE1 = _SerializableDescriptor('TOAE1',
                                    PerVectorParameterF8,
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring='')  # type: PerVectorParameterF8
    TOAE2 = _SerializableDescriptor('TOAE2',
                                    PerVectorParameterF8,
                                    _required,
                                    strict=DEFAULT_STRICT,
                                    docstring='')  # type: PerVectorParameterF8
    TDTropoSRP = _SerializableDescriptor(
        'TDTropoSRP',
        PerVectorParameterF8,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterF8
    TDIonoSRP = _SerializableDescriptor(
        'TDIonoSRP',
        PerVectorParameterF8,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterF8
    SC0 = _SerializableDescriptor('SC0',
                                  PerVectorParameterF8,
                                  _required,
                                  strict=DEFAULT_STRICT,
                                  docstring='')  # type: PerVectorParameterF8
    SCSS = _SerializableDescriptor('SCSS',
                                   PerVectorParameterF8,
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='')  # type: PerVectorParameterF8
    SIGNAL = _SerializableDescriptor(
        'SIGNAL',
        PerVectorParameterI8,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: PerVectorParameterI8
    AddedPVP = _SerializableListDescriptor(
        'AddedPVP',
        UserDefinedPVPType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='')  # type: Union[None, List[UserDefinedPVPType]]

    def __init__(self,
                 TxTime=None,
                 TxPos=None,
                 TxVel=None,
                 RcvTime=None,
                 RcvPos=None,
                 RcvVel=None,
                 SRPPos=None,
                 AmpSF=None,
                 aFDOP=None,
                 aFRR1=None,
                 aFRR2=None,
                 FX1=None,
                 FX2=None,
                 FXN1=None,
                 FXN2=None,
                 TOA1=None,
                 TOA2=None,
                 TOAE1=None,
                 TOAE2=None,
                 TDTropoSRP=None,
                 TDIonoSRP=None,
                 SC0=None,
                 SCSS=None,
                 SIGNAL=None,
                 AddedPVP=None,
                 **kwargs):
        """

        Parameters
        ----------
        TxTime : PerVectorParameterF8
        TxPos : PerVectorParameterXYZ
        TxVel : PerVectorParameterXYZ
        RcvTime : PerVectorParameterF8
        RcvPos : PerVectorParameterXYZ
        RcvVel : PerVectorParameterXYZ
        SRPPos : PerVectorParameterXYZ
        AmpSF : None|PerVectorParameterF8
        aFDOP : PerVectorParameterF8
        aFRR1 : PerVectorParameterF8
        aFRR2 : PerVectorParameterF8
        FX1 : PerVectorParameterF8
        FX2 : PerVectorParameterF8
        FXN1 : None|PerVectorParameterF8
        FXN2 : None|PerVectorParameterF8
        TOA1 : PerVectorParameterF8
        TOA2 : PerVectorParameterF8
        TOAE1 : None|PerVectorParameterF8
        TOAE2 : None|PerVectorParameterF8
        TDTropoSRP : PerVectorParameterF8
        TDIonoSRP : None|PerVectorParameterF8
        SC0 : PerVectorParameterF8
        SCSS : PerVectorParameterF8
        SIGNAL : None|PerVectorParameterI8
        AddedPVP : None|List[UserDefinedPVPType]
        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.TxTime = TxTime
        self.TxPos = TxPos
        self.TxVel = TxVel
        self.RcvTime = RcvTime
        self.RcvPos = RcvPos
        self.RcvVel = RcvVel
        self.SRPPos = SRPPos
        self.AmpSF = AmpSF
        self.aFDOP = aFDOP
        self.aFRR1 = aFRR1
        self.aFRR2 = aFRR2
        self.FX1 = FX1
        self.FX2 = FX2
        self.FXN1 = FXN1
        self.FXN2 = FXN2
        self.TOA1 = TOA1
        self.TOA2 = TOA2
        self.TOAE1 = TOAE1
        self.TOAE2 = TOAE2
        self.TDTropoSRP = TDTropoSRP
        self.TDIonoSRP = TDIonoSRP
        self.SC0 = SC0
        self.SCSS = SCSS
        self.SIGNAL = SIGNAL
        self.AddedPVP = AddedPVP
        super(PVPType, self).__init__(**kwargs)

    def get_size(self):
        """
        Gets the size in bytes of each vector.

        Returns
        -------
        int
        """

        out = 0
        for fld in self._fields[:-1]:
            val = getattr(self, fld)
            if val is not None:
                out += val.Size * 8
        if self.AddedPVP is not None:
            for entry in self.AddedPVP:
                out += entry.Size * 8
        return out

    def get_offset_size_format(self, field):
        """
        Get the Offset (in bytes), Size (in bytes) for the given field,
        as well as the corresponding struct format string.

        Parameters
        ----------
        field : str
            The desired field name.

        Returns
        -------
        None|(int, int, str)
        """

        if field in self._fields[:-1]:
            val = getattr(self, field)
            if val is None:
                return None
            return val.Offset * 8, val.Size * 8, homogeneous_format(val.Format)
        else:
            if self.AddedPVP is None:
                return None
            for val in self.AddedPVP:
                if field == val.Name:
                    return val.Offset * 8, val.Size * 8, homogeneous_format(
                        val.Format)
            return None
Exemplo n.º 10
0
class ProductDisplayType(Serializable):
    """

    """
    _fields = ('PixelType', 'NumBands', 'DefaultBandDisplay',
               'NonInteractiveProcessing', 'InteractiveProcessing',
               'DisplayExtensions')
    _required = ('PixelType', 'NumBands', 'NonInteractiveProcessing',
                 'InteractiveProcessing')
    _collections_tags = {
        'NonInteractiveProcessing': {
            'array': False,
            'child_tag': 'NonInteractiveProcessing'
        },
        'InteractiveProcessing': {
            'array': False,
            'child_tag': 'InteractiveProcessing'
        },
        'DisplayExtensions': {
            'array': False,
            'child_tag': 'DisplayExtension'
        }
    }

    # Descriptors
    PixelType = _StringEnumDescriptor(
        'PixelType', ('MONO8I', 'MONO8LU', 'MONO16I', 'RGBL8U', 'RGB24I'),
        _required,
        strict=DEFAULT_STRICT,
        docstring='Enumeration of the pixel type. Definition in '
        'Design and Exploitation document.')  # type: str
    NumBands = _IntegerDescriptor(
        'NumBands',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Number of bands contained in the image. Populate with the number of bands '
        'present after remapping. For example an 8-bit RGB image (RGBLU), this will '
        'be 3.')  # type: int
    DefaultBandDisplay = _IntegerDescriptor(
        'DefaultBandDisplay',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Indicates which band to display by default. '
        'Valid range = 1 to NumBands.')  # type: int
    NonInteractiveProcessing = _SerializableListDescriptor(
        'NonInteractiveProcessing',
        NonInteractiveProcessingType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Non-interactive processing details.'
    )  # type: List[NonInteractiveProcessingType]
    InteractiveProcessing = _SerializableListDescriptor(
        'InteractiveProcessing',
        InteractiveProcessingType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Interactive processing details.'
    )  # type: List[InteractiveProcessingType]
    DisplayExtensions = _ParametersDescriptor(
        'DisplayExtensions',
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Optional extensible parameters used to support profile-specific needs related to '
        'product display. Predefined filter types.'
    )  # type: ParametersCollection

    def __init__(self,
                 PixelType=None,
                 NumBands=1,
                 DefaultBandDisplay=None,
                 NonInteractiveProcessing=None,
                 InteractiveProcessing=None,
                 DisplayExtensions=None,
                 **kwargs):
        """

        Parameters
        ----------
        PixelType : PixelTypeType
        NumBands : int
        DefaultBandDisplay : int|None
        NonInteractiveProcessing : List[NonInteractiveProcessingType]
        InteractiveProcessing : List[InteractiveProcessingType]
        DisplayExtensions : 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.PixelType = PixelType
        self.NumBands = NumBands
        self.DefaultBandDisplay = DefaultBandDisplay
        self.NonInteractiveProcessing = NonInteractiveProcessing
        self.InteractiveProcessing = InteractiveProcessing
        self.DisplayExtensions = DisplayExtensions
        super(ProductDisplayType, self).__init__(**kwargs)
Exemplo n.º 11
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)
Exemplo n.º 12
0
class AntennaType(Serializable):
    """
    Antenna parameters that describe antenna orientation, mainlobe steering and
    gain patterns vs. time.
    """

    _fields = ('NumTxAnt', 'NumRcvAnt', 'NumTWAnt', 'Tx', 'Rcv', 'TwoWay')
    _required = ()
    _collections_tags = {
        'Tx': {
            'array': False,
            'child_tag': 'Tx'
        },
        'Rcv': {
            'array': False,
            'child_tag': 'Rcv'
        },
        'TwoWay': {
            'array': False,
            'child_tag': 'TwoWay'
        }
    }
    # descriptors
    Tx = _SerializableListDescriptor(
        'Tx',
        AntParamType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Transmit antenna pattern parameters.'
    )  # type: Union[None, List[AntParamType]]
    Rcv = _SerializableListDescriptor(
        'Rcv',
        AntParamType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Receive antenna pattern parameters.'
    )  # type: Union[None, List[AntParamType]]
    TwoWay = _SerializableListDescriptor(
        'TwoWay',
        AntParamType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Two-way antenna pattern parameters.'
    )  # type: Union[None, List[AntParamType]]

    def __init__(self, Tx=None, Rcv=None, TwoWay=None, **kwargs):
        """

        Parameters
        ----------
        Tx : None|List[AntParamType]
        Rcv : None|List[AntParamType]
        TwoWay : None|List[AntParamType]
        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.Tx = Tx
        self.Rcv = Rcv
        self.TwoWay = TwoWay
        super(AntennaType, self).__init__(**kwargs)

    @property
    def NumTxAnt(self):
        """
        int: The number of transmit elements.
        """

        if self.Tx is None:
            return 0
        return len(self.Tx)

    @property
    def NumRcvAnt(self):
        """
        int: The number of receive elements.
        """

        if self.Rcv is None:
            return 0
        return len(self.Rcv)

    @property
    def NumTWAnt(self):
        """
        int: The number of two way elements.
        """

        if self.TwoWay is None:
            return 0
        return len(self.TwoWay)
Exemplo n.º 13
0
class ProductInfoType(Serializable):
    """
    Parameters that provide general information about the CPHD product and/or the
    derived products that may be created from it.
    """

    _fields = ('Profile', 'CreationInfos', 'Parameters')
    _required = ()
    _collections_tags = {
        'CreationInfos': {
            'array': False,
            'child_tag': 'CreationInfo'
        },
        'Parameters': {
            'array': False,
            'child_tag': 'Parameter'
        }
    }
    # descriptors
    Profile = _StringDescriptor(
        'Profile',
        _required,
        strict=DEFAULT_STRICT,
        docstring='Identifies what profile was used to create this CPHD product.'
    )  # type: str
    CreationInfos = _SerializableListDescriptor(
        'CreationInfos',
        CreationInfoType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters that provide general information about the CPHD '
        'product generation.')  # type: Union[None, List[CreationInfoType]]
    Parameters = _ParametersDescriptor(
        'Parameters',
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Additional parameters.'
    )  # type: Union[None, ParametersCollection]

    def __init__(self,
                 Profile=None,
                 CreationInfos=None,
                 Parameters=None,
                 **kwargs):
        """

        Parameters
        ----------
        Profile : str
        CreationInfos : None|List[CreationInfoType]
        Parameters : None|ParametersCollection|dict
        kwargs
        """

        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
        if '_xml_ns_key' in kwargs:
            self._xml_ns_key = kwargs['_xml_ns_key']
        self.Profile = Profile
        self.CreationInfos = CreationInfos
        self.Parameters = Parameters
        super(ProductInfoType, self).__init__(**kwargs)
Exemplo n.º 14
0
class ExploitationFeaturesCollectionInformationType(Serializable):
    """
    General collection information.
    """

    _fields = ('SensorName', 'RadarMode', 'CollectionDateTime',
               'LocalDateTime', 'CollectionDuration', 'Resolution', 'InputROI',
               'Polarizations')
    _required = ('SensorName', 'RadarMode', 'CollectionDateTime',
                 'CollectionDuration')
    _collections_tags = {
        'Polarizations': {
            'array': False,
            'child_tag': 'Polarization'
        }
    }
    _numeric_format = {'CollectionDuration': '0.16G'}
    # Descriptor
    SensorName = _StringDescriptor('SensorName',
                                   _required,
                                   strict=DEFAULT_STRICT,
                                   docstring='The name of the sensor.')  # str
    RadarMode = _SerializableDescriptor(
        'RadarMode',
        RadarModeType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Radar collection mode.')  # type: RadarModeType
    CollectionDateTime = _DateTimeDescriptor(
        'CollectionDateTime',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Collection date and time defined in Coordinated Universal Time (UTC). The seconds '
        'should be followed by a Z to indicate UTC.')  # type: numpy.datetime64
    CollectionDuration = _FloatDescriptor(
        'CollectionDuration',
        _required,
        strict=DEFAULT_STRICT,
        docstring='The duration of the collection (units = seconds).'
    )  # type: float
    Resolution = _SerializableDescriptor(
        'Resolution',
        RangeAzimuthType,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Uniformly-weighted resolution (range and azimuth) processed in '
        'the slant plane.')  # type: Union[None, RangeAzimuthType]
    InputROI = _SerializableDescriptor(
        'InputROI',
        InputROIType,
        _required,
        strict=DEFAULT_STRICT,
        docstring='ROI representing portion of input data used to make '
        'this product.')  # type: Union[None, InputROIType]
    Polarizations = _SerializableListDescriptor(
        'Polarizations',
        TxRcvPolarizationType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Transmit and receive polarization(s).'
    )  # type: Union[None, List[TxRcvPolarizationType]]

    def __init__(self,
                 SensorName=None,
                 RadarMode=None,
                 CollectionDateTime=None,
                 LocalDateTime=None,
                 CollectionDuration=None,
                 Resolution=None,
                 Polarizations=None,
                 **kwargs):
        """

        Parameters
        ----------
        SensorName : str
        RadarMode : RadarModeType
        CollectionDateTime : numpy.datetime64|datetime.datetime|datetime.date|str
        LocalDateTime : None|str|datetime.datetime
        CollectionDuration : float
        Resolution : None|RangeAzimuthType|numpy.ndarray|list|tuple
        Polarizations : None|List[TxRcvPolarizationType]
        kwargs
        """

        self._local_date_time = None
        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
        if '_xml_ns_key' in kwargs:
            self._xml_ns_key = kwargs['_xml_ns_key']
        self.SensorName = SensorName
        self.RadarMode = RadarMode
        self.CollectionDateTime = CollectionDateTime
        self.CollectionDuration = CollectionDuration
        self.LocalDateTime = LocalDateTime
        self.Resolution = Resolution
        self.Polarizations = Polarizations
        super(ExploitationFeaturesCollectionInformationType,
              self).__init__(**kwargs)

    @property
    def LocalDateTime(self):
        """None|str:  The local date/time string of the collection. *Optional.*"""
        return self._local_date_time

    @LocalDateTime.setter
    def LocalDateTime(
            self,
            value):  # type: (Union[None, str, datetime.datetime]) -> None
        if value is None:
            self._local_date_time = None
            return
        elif isinstance(value, datetime.datetime):
            value = value.isoformat('T')

        if isinstance(value, string_types):
            self._local_date_time = value
        else:
            logging.error(
                'Attribute LocalDateTime of class ExploitationFeaturesCollectionInformationType '
                'requires a datetime.datetime or string. Got unsupported type {}. '
                'Setting value to None.'.format(type(value)))
            self._local_date_time = None

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

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

        Returns
        -------
        ExploitationFeaturesCollectionInformationType
        """

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

        polarizations = [
            TxRcvPolarizationType.from_sicd_value(entry.TxRcvPolarization)
            for entry in sicd.RadarCollection.RcvChannels
        ]

        return cls(
            SensorName=sicd.CollectionInfo.CollectorName,
            RadarMode=RadarModeType(**sicd.CollectionInfo.RadarMode.to_dict()),
            CollectionDateTime=sicd.Timeline.CollectStart,
            CollectionDuration=sicd.Timeline.CollectDuration,
            Resolution=(sicd.Grid.Row.SS, sicd.Grid.Col.SS),
            Polarizations=polarizations)
Exemplo n.º 15
0
class ExploitationFeaturesProductType(Serializable):
    """
    Metadata regarding the product.
    """

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

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

        Parameters
        ----------
        Resolution : RowColDoubleType|numpy.ndarray|list|tuple
        Ellipticity : float
        Polarizations : List[ProcTxRcvPolarizationType]
        North : None|float
        Extensions : None|ParametersCollection|dict
        kwargs
        """

        if '_xml_ns' in kwargs:
            self._xml_ns = kwargs['_xml_ns']
        if '_xml_ns_key' in kwargs:
            self._xml_ns_key = kwargs['_xml_ns_key']
        self.Resolution = Resolution
        self.Ellipticity = Ellipticity
        self.Polarizations = Polarizations
        self.North = North
        self.Extensions = Extensions
        super(ExploitationFeaturesProductType, self).__init__(**kwargs)

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

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

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

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

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

        return cls(Resolution=(row_ground, col_ground),
                   Ellipticity=ellipticity,
                   Polarizations=[
                       ProcTxRcvPolarizationType.from_sicd_value(
                           sicd.ImageFormation.TxRcvPolarizationProc),
                   ])
Exemplo n.º 16
0
class AntennaType(Serializable):
    """
    Parameters that describe the transmit and receive antennas used to collect
    the signal array(s).
    """

    _fields = ('NumACFs', 'NumAPCs', 'NumAntPats', 'AntCoordFrame',
               'AntPhaseCenter', 'AntPattern')
    _required = ('AntCoordFrame', 'AntPhaseCenter', 'AntPattern')
    _collections_tags = {
        'AntCoordFrame': {
            'array': False,
            'child_tag': 'AntCoordFrame'
        },
        'AntPhaseCenter': {
            'array': False,
            'child_tag': 'AntPhaseCenter'
        },
        'AntPattern': {
            'array': False,
            'child_tag': 'AntPattern'
        }
    }
    # descriptors
    AntCoordFrame = _SerializableListDescriptor(
        'AntCoordFrame',
        AntCoordFrameType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Unit vectors that describe the orientation of an Antenna Coordinate Frame (ACF) '
        'as function of time. Parameter set repeated for '
        'each ACF.')  # type: List[AntCoordFrameType]
    AntPhaseCenter = _SerializableListDescriptor(
        'AntPhaseCenter',
        AntPhaseCenterType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Parameters that describe each Antenna Phase Center (APC). Parameter '
        'set repeated for each APC.')  # type: List[AntPhaseCenterType]
    AntPattern = _SerializableListDescriptor(
        'AntPattern',
        AntPatternType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Parameter set that defines each Antenna Pattern as function time. Parameters '
        'set repeated for each Antenna Pattern.')  # type: List[AntPatternType]

    def __init__(self,
                 AntCoordFrame=None,
                 AntPhaseCenter=None,
                 AntPattern=None,
                 **kwargs):
        """

        Parameters
        ----------
        AntCoordFrame : List[AntCoordFrameType]
        AntPhaseCenter : List[AntPhaseCenterType]
        AntPattern : List[AntPatternType]
        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.AntCoordFrame = AntCoordFrame
        self.AntPhaseCenter = AntPhaseCenter
        self.AntPattern = AntPattern
        super(AntennaType, self).__init__(**kwargs)

    @property
    def NumACFs(self):
        """
        int: The number of antenna coordinate frame elements.
        """

        if self.AntCoordFrame is None:
            return 0
        return len(self.AntCoordFrame)

    @property
    def NumAPCs(self):
        """
        int: The number of antenna phase center elements.
        """

        if self.AntPhaseCenter is None:
            return 0
        return len(self.AntPhaseCenter)

    @property
    def NumAntPats(self):
        """
        int: The number of antenna pattern elements.
        """

        if self.AntPattern is None:
            return 0
        return len(self.AntPattern)
Exemplo n.º 17
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)
Exemplo n.º 18
0
class DataType(Serializable):
    """
    Parameters that describe binary data components contained in the product.
    """

    _fields = ('SignalArrayFormat', 'NumBytesPVP', 'NumCPHDChannels',
               'SignalCompressionID', 'Channels', 'NumSupportArrays',
               'SupportArrays')
    _required = ('SignalArrayFormat', 'NumBytesPVP', 'Channels')
    _collections_tags = {
        'Channels': {
            'array': False,
            'child_tag': 'Channel'
        },
        'SupportArrays': {
            'array': False,
            'child_tag': 'SupportArray'
        }
    }
    # descriptors
    SignalArrayFormat = _StringEnumDescriptor(
        'SignalArrayFormat', ('CI2', 'CI4', 'CF8'),
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Signal Array sample binary format of the CPHD signal arrays in standard '
        '(i.e. uncompressed) format, where `CI2` denotes a 1 byte signed integer '
        "parameter, 2's complement format, and 2 Bytes Per Sample; `CI4` denotes "
        "a 2 byte signed integer parameter, 2's complement format, and "
        "4 Bytes Per Sample; `CF8` denotes a 4 byte floating point parameter, and "
        "8 Bytes Per Sample.")  # type: str
    NumBytesPVP = _IntegerDescriptor(
        'NumBytesPVP',
        _required,
        strict=DEFAULT_STRICT,
        bounds=(0, None),
        docstring=
        'Number of bytes per set of Per Vector Parameters, where there is '
        'one set of PVPs for each CPHD signal vector')  # type: int
    SignalCompressionID = _StringDescriptor(
        'SignalCompressionID',
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Parameter that indicates the signal arrays are in compressed format. Value '
        'identifies the method of decompression. Parameter included if and only if '
        'the signal arrays are in compressed format.')  # type: str
    Channels = _SerializableListDescriptor(
        'Channels',
        ChannelSizeType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Parameters that define the Channel signal array and PVP array size '
        'and location.')  # type: List[ChannelSizeType]
    SupportArrays = _SerializableListDescriptor(
        'SupportArrays',
        SupportArraySizeType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring=
        'Support Array size parameters. Branch repeated for each binary support array. '
        'Support Array referenced by its unique Support Array '
        'identifier.')  # type: List[SupportArraySizeType]

    def __init__(self,
                 SignalArrayFormat=None,
                 NumBytesPVP=None,
                 SignalCompressionID=None,
                 Channels=None,
                 SupportArrays=None,
                 **kwargs):
        """

        Parameters
        ----------
        SignalArrayFormat : str
        NumBytesPVP : int
        SignalCompressionID : None|str
        Channels : List[ChannelSizeType]
        SupportArrays : None|List[SupportArraySizeType]
        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.SignalArrayFormat = SignalArrayFormat
        self.NumBytesPVP = NumBytesPVP
        self.SignalCompressionID = SignalCompressionID
        self.Channels = Channels
        self.SupportArrays = SupportArrays
        super(DataType, self).__init__(**kwargs)

    @property
    def NumSupportArrays(self):
        """
        int: The number of support arrays.
        """

        if self.SupportArrays is None:
            return 0
        else:
            return len(self.SupportArrays)

    @property
    def NumCPHDChannels(self):
        """
        int: The number of CPHD channels.
        """

        if self.Channels is None:
            return 0
        else:
            return len(self.Channels)
Exemplo n.º 19
0
class DwellType(Serializable):
    """
    Parameters that specify the dwell time supported by the signal arrays
    contained in the CPHD product.
    """

    _fields = ('NumCODTimes', 'CODTimes', 'NumDwellTimes', 'DwellTimes')
    _required = ('CODTimes', 'DwellTimes')
    _collections_tags = {
        'CODTimes': {
            'array': False,
            'child_tag': 'CODTime'
        },
        'DwellTimes': {
            'array': False,
            'child_tag': 'DwellTime'
        }
    }
    # descriptors
    CODTimes = _SerializableListDescriptor(
        'CODTimes',
        CODTimeType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='The Center of Dwell (COD) time polynomials.'
    )  # type: List[CODTimeType]
    DwellTimes = _SerializableListDescriptor(
        'DwellTimes',
        DwellTimeType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='The dwell time polynomials.')  # type: List[DwellTimeType]

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

        Parameters
        ----------
        CODTimes : List[CODTimeType]
        DwellTimes : List[DwellTimeType]
        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.CODTimes = CODTimes
        self.DwellTimes = DwellTimes
        super(DwellType, self).__init__(**kwargs)

    @property
    def NumCODTimes(self):
        """
        int: The number of cod time polynomial elements.
        """

        if self.CODTimes is None:
            return 0
        else:
            return len(self.CODTimes)

    @property
    def NumDwellTimes(self):
        """
        int: The number of dwell time polynomial elements.
        """

        if self.DwellTimes is None:
            return 0
        else:
            return len(self.DwellTimes)
Exemplo n.º 20
0
class TxRcvType(Serializable):
    """
    Parameters that describe the transmitted waveform(s) and receiver
    configurations used in the collection
    """

    _fields = ('NumTxWFs', 'TxWFParameters', 'NumRcvs', 'RcvParameters')
    _required = ('TxWFParameters', 'RcvParameters')
    _collections_tags = {
        'TxWFParameters': {
            'array': False,
            'child_tag': 'TxWFParameters'
        },
        'RcvParameters': {
            'array': False,
            'child_tag': 'RcvParameters'
        }
    }
    # descriptors
    TxWFParameters = _SerializableListDescriptor(
        'TxWFParameters',
        TxWFParametersType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters that describe a Transmit Waveform.'
    )  # type: List[TxWFParametersType]
    RcvParameters = _SerializableListDescriptor(
        'RcvParameters',
        RcvParametersType,
        _collections_tags,
        _required,
        strict=DEFAULT_STRICT,
        docstring='Parameters that describe a Receive configuration.'
    )  # type: List[RcvParametersType]

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

        Parameters
        ----------
        TxWFParameters : List[TxWFParametersType]
        RcvParameters : List[RcvParametersType]
        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.TxWFParameters = TxWFParameters
        self.RcvParameters = RcvParameters
        super(TxRcvType, self).__init__(**kwargs)

    @property
    def NumTxWFs(self):
        """
        int: The number of transmit waveforms used.
        """

        if self.TxWFParameters is None:
            return 0
        return len(self.TxWFParameters)

    @property
    def NumRcvs(self):
        """
        int: The number of receive configurations used.
        """

        if self.RcvParameters is None:
            return 0
        return len(self.RcvParameters)