class TimelineType(Serializable): """ Parameters that describe the collection times for the data contained in the product. """ _fields = ('CollectionStart', 'RcvCollectionStart', 'TxTime1', 'TxTime2') _required = ('CollectionStart', 'TxTime1', 'TxTime2') _numeric_format = {'TxTime1': '0.16G', 'TxTime2': '0.16G'} # descriptors CollectionStart = _DateTimeDescriptor( 'CollectionStart', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us', docstring='Collection Start date and time (UTC). Time reference used for times ' 'measured from collection start (i.e. slow time t = 0). For bistatic ' 'collections, the time is the transmit platform collection ' 'start time. The default display precision is microseconds, but this ' 'does not that accuracy in value.') # type: numpy.datetime64 RcvCollectionStart = _DateTimeDescriptor( 'RcvCollectionStart', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us', docstring='Receive only platform collection date and start time.') # type: numpy.datetime64 TxTime1 = _FloatDescriptor( 'TxTime1', _required, strict=DEFAULT_STRICT, bounds=(0, None), docstring='Earliest TxTime value for any signal vector in the product. ' 'Time relative to Collection Start in seconds.') # type: float TxTime2 = _FloatDescriptor( 'TxTime2', _required, strict=DEFAULT_STRICT, bounds=(0, None), docstring='Latest TxTime value for any signal vector in the product. ' 'Time relative to Collection Start in seconds.') # type: float def __init__(self, CollectionStart=None, RcvCollectionStart=None, TxTime1=None, TxTime2=None, **kwargs): """ Parameters ---------- CollectionStart : numpy.datetime64|datetime|date|str RcvCollectionStart : None|numpy.datetime64|datetime|date|str TxTime1 : float TxTime2 : float kwargs """ if '_xml_ns' in kwargs: self._xml_ns = kwargs['_xml_ns'] if '_xml_ns_key' in kwargs: self._xml_ns_key = kwargs['_xml_ns_key'] self.CollectionStart = CollectionStart self.RcvCollectionStart = RcvCollectionStart self.TxTime1 = TxTime1 self.TxTime2 = TxTime2 super(TimelineType, self).__init__(**kwargs)
class ProcessorInformationType(Serializable): """ Details regarding the processor. """ _fields = ('Application', 'ProcessingDateTime', 'Site', 'Profile') _required = ('Application', 'ProcessingDateTime', 'Site') # descriptors Application = _StringDescriptor( 'Application', _required, strict=DEFAULT_STRICT, docstring='Name and version of the application used to create the image.' ) # type: str ProcessingDateTime = _DateTimeDescriptor( 'ProcessingDateTime', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us', docstring= 'Date and time the image creation application processed the image (UTC).' ) # type: numpy.datetime64 Site = _StringDescriptor( 'Site', _required, strict=DEFAULT_STRICT, docstring='The creation site of this SICD product.') # type: str Profile = _StringDescriptor( 'Profile', _required, strict=DEFAULT_STRICT, docstring='Identifies what profile was used to create this SICD product.' ) # type: str def __init__(self, Application=None, ProcessingDateTime=None, Site=None, Profile=None, **kwargs): """ Parameters ---------- Application : str ProcessingDateTime : numpy.datetime64|datetime|date|str Site : str Profile : 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.Application = Application self.ProcessingDateTime = ProcessingDateTime self.Site = Site self.Profile = Profile super(ProcessorInformationType, self).__init__(**kwargs)
class CreationInfoType(Serializable): """ Parameters that provide general information about the CPHD product generation. """ _fields = ('Application', 'DateTime', 'Site', 'Parameters') _required = ('DateTime', ) _collections_tags = { 'Parameters': { 'array': False, 'child_tag': 'Parameter' } } # descriptors Application = _StringDescriptor( 'Application', _required, strict=DEFAULT_STRICT, docstring='Name and version of the application used to create the CPHD.' ) # type: str DateTime = _DateTimeDescriptor( 'DateTime', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us', docstring= 'Date and time the image creation application processed the image (UTC).' ) # type: numpy.datetime64 Site = _StringDescriptor( 'Site', _required, strict=DEFAULT_STRICT, docstring='The creation site of this CPHD product.') # type: str Parameters = _ParametersDescriptor( 'Parameters', _collections_tags, _required, strict=DEFAULT_STRICT, docstring='Additional parameters.' ) # type: Union[None, ParametersCollection] def __init__(self, Application=None, DateTime=None, Site=None, Parameters=None, **kwargs): """ Parameters ---------- Application : str DateTime : numpy.datetime64|datetime|date|str Site : str Profile : str 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.Application = Application self.DateTime = DateTime self.Site = Site self.Parameters = Parameters super(CreationInfoType, self).__init__(**kwargs)
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)
class GlobalType(Serializable): """ The Global type definition. """ _fields = ( 'DomainType', 'PhaseSGN', 'RefFreqIndex', 'CollectStart', 'CollectDuration', 'TxTime1', 'TxTime2', 'ImageArea') _required = ( 'DomainType', 'PhaseSGN', 'CollectStart', 'CollectDuration', 'TxTime1', 'TxTime2', 'ImageArea') _numeric_format = { 'CollectDuration': '0.16G', 'TxTime1': '0.16G', 'TxTime2': '0.16G'} # descriptors DomainType = _StringEnumDescriptor( 'DomainType', ('FX', 'TOA'), _required, strict=DEFAULT_STRICT, docstring='Indicates the domain represented by the sample dimension of the ' 'CPHD signal array(s), where "FX" denotes Transmit Frequency, and ' '"TOA" denotes Difference in Time of Arrival') # type: str PhaseSGN = _IntegerEnumDescriptor( 'PhaseSGN', (-1, 1), _required, strict=DEFAULT_STRICT, docstring='Phase SGN applied to compute target signal phase as a function of ' r'target :math:`\Delta TOA^{TGT}`. Target phase in cycles. ' r'For simple phase model :math:`Phase(fx) = SGN \times fx \times \Delta TOA^{TGT}` ' r'In TOA domain, phase of the mainlobe peak ' r':math:`Phase(\Delta TOA^{TGT}) = SGN \times fx_C \times \Delta TOA^{TGT}`' '.') # type: int RefFreqIndex = _IntegerDescriptor( 'RefFreqIndex', _required, strict=DEFAULT_STRICT, docstring='Indicates if the RF frequency values are expressed as offsets from ' 'a reference frequency (RefFreq).') # type: Union[None, int] CollectStart = _DateTimeDescriptor( 'CollectStart', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us', docstring='Collection Start date and time (UTC). Time reference used for times ' 'measured from collection start (i.e. slow time t = 0). For bistatic ' 'collections, the time is the transmit platform collection ' 'start time. The default display precision is microseconds, but this ' 'does not that accuracy in value.') # type: numpy.datetime64 CollectDuration = _FloatDescriptor( 'CollectDuration', _required, strict=DEFAULT_STRICT, docstring='The duration of the collection, in seconds.') # type: float TxTime1 = _FloatDescriptor( 'TxTime1', _required, strict=DEFAULT_STRICT, bounds=(0, None), docstring='Earliest TxTime value for any signal vector in the product. ' 'Time relative to Collection Start in seconds.') # type: float TxTime2 = _FloatDescriptor( 'TxTime2', _required, strict=DEFAULT_STRICT, bounds=(0, None), docstring='Latest TxTime value for any signal vector in the product. ' 'Time relative to Collection Start in seconds.') # type: float ImageArea = _SerializableDescriptor( 'ImageArea', ImageAreaType, _required, strict=DEFAULT_STRICT, docstring='Parameters describing the ground area covered by this ' 'product.') # type: ImageAreaType def __init__(self, DomainType=None, PhaseSGN=None, RefFreqIndex=None, CollectStart=None, CollectDuration=None, TxTime1=None, TxTime2=None, ImageArea=None, **kwargs): """ Parameters ---------- DomainType : str PhaseSGN : int RefFreqIndex : None|int CollectStart : numpy.datetime64|datetime.datetime|str CollectDuration : float TxTime1 : float TxTime2 : float ImageArea : ImageAreaType 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.DomainType = DomainType self.PhaseSGN = PhaseSGN self.RefFreqIndex = RefFreqIndex self.CollectStart = CollectStart self.CollectDuration = CollectDuration self.TxTime1 = TxTime1 self.TxTime2 = TxTime2 self.ImageArea = ImageArea super(GlobalType, self).__init__(**kwargs)
class ProcessingEventType(Serializable): """ Processing event data. """ _fields = ('ApplicationName', 'AppliedDateTime', 'InterpolationMethod', 'Descriptors') _required = ('ApplicationName', 'AppliedDateTime') _collections_tags = { 'Descriptors': { 'array': False, 'child_tag': 'Descriptor' } } # Descriptor ApplicationName = _StringDescriptor( 'ApplicationName', _required, strict=DEFAULT_STRICT, docstring='Application which applied a modification.') # type: str AppliedDateTime = _DateTimeDescriptor( 'AppliedDateTime', _required, strict=DEFAULT_STRICT, numpy_datetime_units='us', docstring='Date and time defined in Coordinated Universal Time (UTC).' ) # type: numpy.datetime64 InterpolationMethod = _StringDescriptor( 'InterpolationMethod', _required, strict=DEFAULT_STRICT, docstring='Type of interpolation applied to the data.' ) # type: Union[None, str] Descriptors = _ParametersDescriptor( 'Descriptors', _collections_tags, _required, strict=DEFAULT_STRICT, docstring='Descriptors for the processing event.' ) # type: ParametersCollection def __init__(self, ApplicationName=None, AppliedDateTime=None, InterpolationMethod=None, Descriptors=None, **kwargs): """ Parameters ---------- ApplicationName : str AppliedDateTime : numpy.datetime64|str InterpolationMethod : None|str Descriptors : 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.ApplicationName = ApplicationName self.AppliedDateTime = numpy.datetime64( datetime.now()) if AppliedDateTime is None else AppliedDateTime self.InterpolationMethod = InterpolationMethod self.Descriptors = Descriptors super(ProcessingEventType, self).__init__(**kwargs)