コード例 #1
0
ファイル: other_nitf.py プロジェクト: kirkjens/sarpy
 def set_scp(scp_ecf, scp_pixel, override=False):
     def set_scppixel():
         if the_sicd.ImageData is None:
             the_sicd.ImageData = ImageDataType(SCPPixel=scp_pixel)
         else:
             the_sicd.ImageData.SCPPixel = scp_pixel
     if the_sicd.GeoData is None:
         the_sicd.GeoData = GeoDataType(SCP=SCPType(ECF=scp_ecf))
         set_scppixel()
     elif the_sicd.GeoData.SCP is None or override:
         the_sicd.GeoData.SCP = SCPType(ECF=scp_ecf)
         set_scppixel()
コード例 #2
0
    def set_scp(scp_ecf: numpy.ndarray,
                scp_pixel: Union[numpy.ndarray, list, tuple],
                override: bool = False) -> None:
        def set_scppixel():
            if the_sicd.ImageData is None:
                the_sicd.ImageData = ImageDataType(SCPPixel=scp_pixel)
            else:
                the_sicd.ImageData.SCPPixel = scp_pixel

        if the_sicd.GeoData is None:
            the_sicd.GeoData = GeoDataType(SCP=SCPType(ECF=scp_ecf))
            set_scppixel()
        elif the_sicd.GeoData.SCP is None or override:
            the_sicd.GeoData.SCP = SCPType(ECF=scp_ecf)
            set_scppixel()
コード例 #3
0
        def get_geo_data():
            # type: () -> GeoDataType
            # seeds a rough SCP for projection usage
            poly_str = _stringify(
                hf['/science/LSAR/identification/boundingPolygon'][()])
            beg_str = 'POLYGON (('
            if not poly_str.startswith(beg_str):
                raise ValueError(
                    'Unexpected polygon string {}'.format(poly_str))
            parts = poly_str[len(beg_str):-2].strip().split(',')
            if len(parts) != 5:
                raise ValueError(
                    'Unexpected polygon string parts {}'.format(parts))
            lats_lons = numpy.zeros((4, 2), dtype=numpy.float64)
            for i, part in enumerate(parts[:-1]):
                spart = part.strip().split()
                if len(spart) != 2:
                    raise ValueError(
                        'Unexpected polygon string parts {}'.format(parts))
                lats_lons[i, :] = float(spart[1]), float(spart[0])

            llh = numpy.zeros((3, ), dtype=numpy.float64)
            llh[0:2] = numpy.mean(lats_lons, axis=0)
            llh[2] = numpy.mean(hf[
                '/science/LSAR/SLC/metadata/processingInformation/parameters/referenceTerrainHeight']
                                [:])
            return GeoDataType(SCP=SCPType(LLH=llh))
コード例 #4
0
ファイル: csk.py プロジェクト: ngageoint/sarpy
 def update_scp_prelim(sicd: SICDType, band_name: str) -> None:
     if self._mission_id in ['CSK', 'KMPS']:
         LLH = band_dict[band_name]['Centre Geodetic Coordinates']
     elif self._mission_id == 'CSG':
         LLH = h5_dict['Scene Centre Geodetic Coordinates']
     else:
         raise ValueError(_unhandled_id_text.format(self._mission_id))
     sicd.GeoData = GeoDataType(
         SCP=SCPType(LLH=LLH))  # EarthModel & ECF will be populated
コード例 #5
0
    def _update_geo_data(sicd):
        """
        Populates the GeoData.

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

        Returns
        -------
        None
        """

        ecf = point_projection.image_to_ground(
            [sicd.ImageData.SCPPixel.Row, sicd.ImageData.SCPPixel.Col], sicd)
        sicd.GeoData.SCP = SCPType(ECF=ecf)  # LLH implicitly populated
コード例 #6
0
ファイル: capella.py プロジェクト: khavernathy/sarpy
 def get_geo_data():
     # type: () -> GeoDataType
     return GeoDataType(SCP=SCPType(
         ECF=collect['image']['center_pixel']['target_position']))
コード例 #7
0
ファイル: other_nitf.py プロジェクト: kirkjens/sarpy
    def try_CMETAA():
        tre = None if tres is None else tres['CMETAA']  # type: CMETAA
        if tre is None:
            return

        cmetaa = tre.DATA

        if the_sicd.GeoData is None:
            the_sicd.GeoData = GeoDataType()
        if the_sicd.SCPCOA is None:
            the_sicd.SCPCOA = SCPCOAType()
        if the_sicd.Grid is None:
            the_sicd.Grid = GridType()
        if the_sicd.Timeline is None:
            the_sicd.Timeline = TimelineType()
        if the_sicd.RadarCollection is None:
            the_sicd.RadarCollection = RadarCollectionType()
        if the_sicd.ImageFormation is None:
            the_sicd.ImageFormation = ImageFormationType()

        the_sicd.SCPCOA.SCPTime = 0.5*float(cmetaa.WF_CDP)
        the_sicd.GeoData.SCP = SCPType(ECF=tre.get_scp())
        the_sicd.SCPCOA.ARPPos = tre.get_arp()

        the_sicd.SCPCOA.SideOfTrack = cmetaa.CG_LD.strip().upper()
        the_sicd.SCPCOA.SlantRange = float(cmetaa.CG_SRAC)
        the_sicd.SCPCOA.DopplerConeAng = float(cmetaa.CG_CAAC)
        the_sicd.SCPCOA.GrazeAng = float(cmetaa.CG_GAAC)
        the_sicd.SCPCOA.IncidenceAng = 90 - float(cmetaa.CG_GAAC)
        if hasattr(cmetaa, 'CG_TILT'):
            the_sicd.SCPCOA.TwistAng = float(cmetaa.CG_TILT)
        if hasattr(cmetaa, 'CG_SLOPE'):
            the_sicd.SCPCOA.SlopeAng = float(cmetaa.CG_SLOPE)

        the_sicd.ImageData.SCPPixel = [int(cmetaa.IF_DC_IS_COL), int(cmetaa.IF_DC_IS_ROW)]
        img_corners = tre.get_image_corners()
        if img_corners is not None:
            the_sicd.GeoData.ImageCorners = img_corners

        if cmetaa.CMPLX_SIGNAL_PLANE.upper() == 'S':
            the_sicd.Grid.ImagePlane = 'SLANT'
        elif cmetaa.CMPLX_SIGNAL_PLANE.upper() == 'G':
            the_sicd.Grid.ImagePlane = 'GROUND'
        else:
            logger.warning(
                'Got unexpected CMPLX_SIGNAL_PLANE value {},\n\t'
                'setting ImagePlane to SLANT'.format(cmetaa.CMPLX_SIGNAL_PLANE))

        the_sicd.Grid.Row = DirParamType(
            SS=float(cmetaa.IF_RSS),
            ImpRespWid=float(cmetaa.IF_RGRES),
            Sgn=1 if cmetaa.IF_RFFTS.strip() == '-' else -1,  # opposite sign convention
            ImpRespBW=float(cmetaa.IF_RFFT_SAMP)/(float(cmetaa.IF_RSS)*float(cmetaa.IF_RFFT_TOT)))
        the_sicd.Grid.Col = DirParamType(
            SS=float(cmetaa.IF_AZSS),
            ImpRespWid=float(cmetaa.IF_AZRES),
            Sgn=1 if cmetaa.IF_AFFTS.strip() == '-' else -1,  # opposite sign convention
            ImpRespBW=float(cmetaa.IF_AZFFT_SAMP)/(float(cmetaa.IF_AZSS)*float(cmetaa.IF_AZFFT_TOT)))
        cmplx_weight = cmetaa.CMPLX_WEIGHT.strip().upper()
        if cmplx_weight == 'UWT':
            the_sicd.Grid.Row.WgtType = WgtTypeType(WindowName='UNIFORM')
            the_sicd.Grid.Col.WgtType = WgtTypeType(WindowName='UNIFORM')
        elif cmplx_weight == 'HMW':
            the_sicd.Grid.Row.WgtType = WgtTypeType(WindowName='HAMMING')
            the_sicd.Grid.Col.WgtType = WgtTypeType(WindowName='HAMMING')
        elif cmplx_weight == 'HNW':
            the_sicd.Grid.Row.WgtType = WgtTypeType(WindowName='HANNING')
            the_sicd.Grid.Col.WgtType = WgtTypeType(WindowName='HANNING')
        elif cmplx_weight == 'TAY':
            the_sicd.Grid.Row.WgtType = WgtTypeType(
                WindowName='TAYLOR',
                Parameters={
                    'SLL': '-{0:d}'.format(int(cmetaa.CMPLX_RNG_SLL)),
                    'NBAR': '{0:d}'.format(int(cmetaa.CMPLX_RNG_TAY_NBAR))})
            the_sicd.Grid.Col.WgtType = WgtTypeType(
                WindowName='TAYLOR',
                Parameters={
                    'SLL': '-{0:d}'.format(int(cmetaa.CMPLX_AZ_SLL)),
                    'NBAR': '{0:d}'.format(int(cmetaa.CMPLX_AZ_TAY_NBAR))})
        else:
            logger.warning(
                'Got unsupported CMPLX_WEIGHT value {}.\n\tThe resulting SICD will '
                'not have valid weight array populated'.format(cmplx_weight))
        the_sicd.Grid.Row.define_weight_function()
        the_sicd.Grid.Col.define_weight_function()

        # noinspection PyBroadException
        try:
            date_str = cmetaa.T_UTC_YYYYMMMDD
            time_str = cmetaa.T_HHMMSSUTC
            date_time = _iso_date_format.format(
                date_str[:4], date_str[4:6], date_str[6:8],
                time_str[:2], time_str[2:4], time_str[4:6])
            the_sicd.Timeline.CollectStart = numpy.datetime64(date_time, 'us')
        except Exception:
            logger.info('Failed extracting start time from CMETAA')
            pass
        the_sicd.Timeline.CollectDuration = float(cmetaa.WF_CDP)
        the_sicd.Timeline.IPP = [
            IPPSetType(TStart=0,
                       TEnd=float(cmetaa.WF_CDP),
                       IPPStart=0,
                       IPPEnd=numpy.floor(float(cmetaa.WF_CDP)*float(cmetaa.WF_PRF)),
                       IPPPoly=[0, float(cmetaa.WF_PRF)])]

        the_sicd.RadarCollection.TxFrequency = TxFrequencyType(
            Min=float(cmetaa.WF_SRTFR),
            Max=float(cmetaa.WF_ENDFR))
        the_sicd.RadarCollection.TxPolarization = cmetaa.POL_TR.upper()
        the_sicd.RadarCollection.Waveform = [WaveformParametersType(
            TxPulseLength=float(cmetaa.WF_WIDTH),
            TxRFBandwidth=float(cmetaa.WF_BW),
            TxFreqStart=float(cmetaa.WF_SRTFR),
            TxFMRate=float(cmetaa.WF_CHRPRT)*1e12)]
        tx_rcv_pol = '{}:{}'.format(cmetaa.POL_TR.upper(), cmetaa.POL_RE.upper())
        the_sicd.RadarCollection.RcvChannels = [
            ChanParametersType(TxRcvPolarization=tx_rcv_pol)]

        the_sicd.ImageFormation.TxRcvPolarizationProc = tx_rcv_pol
        if_process = cmetaa.IF_PROCESS.strip().upper()
        if if_process == 'PF':
            the_sicd.ImageFormation.ImageFormAlgo = 'PFA'
            scp_ecf = tre.get_scp()
            fpn_ned = numpy.array(
                [float(cmetaa.CG_FPNUV_X), float(cmetaa.CG_FPNUV_Y), float(cmetaa.CG_FPNUV_Z)], dtype='float64')
            ipn_ned = numpy.array(
                [float(cmetaa.CG_IDPNUVX), float(cmetaa.CG_IDPNUVY), float(cmetaa.CG_IDPNUVZ)], dtype='float64')
            fpn_ecf = ned_to_ecf(fpn_ned, scp_ecf, absolute_coords=False)
            ipn_ecf = ned_to_ecf(ipn_ned, scp_ecf, absolute_coords=False)
            the_sicd.PFA = PFAType(FPN=fpn_ecf, IPN=ipn_ecf)
        elif if_process in ['RM', 'CD']:
            the_sicd.ImageFormation.ImageFormAlgo = 'RMA'

        # the remainder of this is guesswork to define required fields
        the_sicd.ImageFormation.TStartProc = 0  # guess work
        the_sicd.ImageFormation.TEndProc = float(cmetaa.WF_CDP)
        the_sicd.ImageFormation.TxFrequencyProc = TxFrequencyProcType(
            MinProc=float(cmetaa.WF_SRTFR), MaxProc=float(cmetaa.WF_ENDFR))
        # all remaining guess work
        the_sicd.ImageFormation.STBeamComp = 'NO'
        the_sicd.ImageFormation.ImageBeamComp = 'SV' if cmetaa.IF_BEAM_COMP[0] == 'Y' else 'NO'
        the_sicd.ImageFormation.AzAutofocus = 'NO' if cmetaa.AF_TYPE[0] == 'N' else 'SV'
        the_sicd.ImageFormation.RgAutofocus = 'NO'
コード例 #8
0
 def get_geo_data():
     # type: () -> GeoDataType
     # NB: the remainder will be derived.
     return GeoDataType(SCP=SCPType(
         LLH=[coord_center[2], coord_center[3], avg_scene_height]))
コード例 #9
0
ファイル: csk.py プロジェクト: LordHui/sarpy
 def update_geodata(sicd):  # type: (SICDType) -> None
     ecf = point_projection.image_to_ground([sicd.ImageData.SCPPixel.Row, sicd.ImageData.SCPPixel.Col], sicd)
     sicd.GeoData.SCP = SCPType(ECF=ecf)  # LLH will be populated
コード例 #10
0
ファイル: csk.py プロジェクト: LordHui/sarpy
 def update_scp_prelim(sicd, band_name):
     # type: (SICDType, str) -> None
     LLH = band_dict[band_name]['Centre Geodetic Coordinates']
     sicd.GeoData = GeoDataType(SCP=SCPType(LLH=LLH))  # EarthModel & ECF will be populated
コード例 #11
0
 def update_geodata():
     ecf = point_projection.image_to_ground(
         [t_sicd.ImageData.SCPPixel.Row, t_sicd.ImageData.SCPPixel.Col], t_sicd)
     t_sicd.GeoData.SCP = SCPType(ECF=ecf)  # LLH will be populated
コード例 #12
0
    def _get_image_and_geo_data(self):
        """
        Gets the ImageData and GeoData metadata.

        Returns
        -------
        Tuple[ImageDataType, GeoDataType]
        """

        pixel_type = 'RE16I_IM16I'
        if self.generation == 'RS2':
            cols = int(
                self._find(
                    './imageAttributes/rasterAttributes/numberOfLines').text)
            rows = int(
                self._find(
                    './imageAttributes/rasterAttributes/numberOfSamplesPerLine'
                ).text)
            tie_points = self._findall('./imageAttributes'
                                       '/geographicInformation'
                                       '/geolocationGrid'
                                       '/imageTiePoint')
        elif self.generation == 'RCM':
            cols = int(
                self._find('./sceneAttributes/imageAttributes/numLines').text)
            rows = int(
                self._find(
                    './sceneAttributes/imageAttributes/samplesPerLine').text)
            tie_points = self._findall('./imageReferenceAttributes'
                                       '/geographicInformation'
                                       '/geolocationGrid'
                                       '/imageTiePoint')
            if self._find(
                    './imageReferenceAttributes/rasterAttributes/bitsPerSample'
            ).text == '32':
                pixel_type = 'RE32F_IM32F'
        else:
            raise ValueError('unhandled generation {}'.format(self.generation))
        # let's use the tie point closest to the center as the SCP
        center_pixel = 0.5 * numpy.array([rows - 1, cols - 1],
                                         dtype=numpy.float64)
        tp_pixels = numpy.zeros((len(tie_points), 2), dtype=numpy.float64)
        tp_llh = numpy.zeros((len(tie_points), 3), dtype=numpy.float64)
        for j, tp in enumerate(tie_points):
            tp_pixels[j, :] = (float(tp.find('imageCoordinate/pixel').text),
                               float(tp.find('imageCoordinate/line').text))
            tp_llh[j, :] = (float(tp.find('geodeticCoordinate/latitude').text),
                            float(
                                tp.find('geodeticCoordinate/longitude').text),
                            float(tp.find('geodeticCoordinate/height').text))
        scp_index = numpy.argmin(
            numpy.sum((tp_pixels - center_pixel)**2, axis=1))
        im_data = ImageDataType(NumRows=rows,
                                NumCols=cols,
                                FirstRow=0,
                                FirstCol=0,
                                PixelType=pixel_type,
                                FullImage=(rows, cols),
                                ValidData=((0, 0), (0, cols - 1),
                                           (rows - 1, cols - 1), (rows - 1,
                                                                  0)),
                                SCPPixel=numpy.round(tp_pixels[scp_index, :]))
        geo_data = GeoDataType(SCP=SCPType(LLH=tp_llh[scp_index, :]))
        return im_data, geo_data
コード例 #13
0
ファイル: other_nitf.py プロジェクト: LordHui/sarpy
    def try_CMETAA():
        tre = None if tres is None else tres['CMETAA']
        if tre is None:
            return
        cmetaa = tre.DATA

        if the_sicd.GeoData is None:
            the_sicd.GeoData = GeoDataType()
        if the_sicd.SCPCOA is None:
            the_sicd.SCPCOA = SCPCOAType()
        if the_sicd.Grid is None:
            the_sicd.Grid = GridType()
        if the_sicd.Timeline is None:
            the_sicd.Timeline = TimelineType()
        if the_sicd.RadarCollection is None:
            the_sicd.RadarCollection = RadarCollectionType()
        if the_sicd.ImageFormation is None:
            the_sicd.ImageFormation = ImageFormationType()

        the_sicd.SCPCOA.SCPTime = 0.5 * cmetaa.WF_CDP
        if cmetaa.CG_MODEL == 'ECEF':
            the_sicd.GeoData.SCP = SCPType(ECF=[
                cmetaa.CG_SCECN_X, cmetaa.CG_SCECN_Y, cmetaa.cmetaa.CG_SCECN_Z
            ])
            the_sicd.SCPCOA.ARPPos = [
                cmetaa.CG_APCEN_X, cmetaa.CG_APCEN_Y, cmetaa.CG_APCEN_Z
            ]
        elif cmetaa.CG_MODEL == 'WGS84':
            the_sicd.GeoData.SCP = SCPType(LLH=[
                cmetaa.CG_SCECN_X, cmetaa.CG_SCECN_Y, cmetaa.cmetaa.CG_SCECN_Z
            ])
            the_sicd.SCPCOA.ARPPos = geodetic_to_ecf(
                [cmetaa.CG_APCEN_X, cmetaa.CG_APCEN_Y, cmetaa.CG_APCEN_Z])

        the_sicd.SCPCOA.SideOfTrack = cmetaa.CG_LD
        the_sicd.SCPCOA.SlantRange = cmetaa.CG_SRAC
        the_sicd.SCPCOA.DopplerConeAng = cmetaa.CG_CAAC
        the_sicd.SCPCOA.GrazeAng = cmetaa.CG_GAAC
        the_sicd.SCPCOA.IncidenceAng = 90 - cmetaa.CG_GAAC
        if hasattr(cmetaa, 'CG_TILT'):
            the_sicd.SCPCOA.TwistAng = cmetaa.CG_TILT
        if hasattr(cmetaa, 'CG_SLOPE'):
            the_sicd.SCPCOA.SlopeAng = cmetaa.CG_SLOPE

        the_sicd.ImageData.SCPPixel = [
            cmetaa.IF_DC_IS_COL, cmetaa.IF_DC_IS_ROW
        ]
        if cmetaa.CG_MAP_TYPE == 'GEOD':
            the_sicd.GeoData.ImageCorners = [
                [cmetaa.CG_PATCH_LTCORUL, cmetaa.CG_PATCH_LGCORUL],
                [cmetaa.CG_PATCH_LTCORUR, cmetaa.CG_PATCH_LGCORUR],
                [cmetaa.CG_PATCH_LTCORLR, cmetaa.CG_PATCH_LGCORLR],
                [cmetaa.CG_PATCH_LTCORLL, cmetaa.CG_PATCH_LNGCOLL]
            ]
        if cmetaa.CMPLX_SIGNAL_PLANE[0].upper() == 'S':
            the_sicd.Grid.ImagePlane = 'SLANT'
        elif cmetaa.CMPLX_SIGNAL_PLANE[0].upper() == 'G':
            the_sicd.Grid.ImagePlane = 'GROUND'
        the_sicd.Grid.Row = DirParamType(
            SS=cmetaa.IF_RSS,
            ImpRespWid=cmetaa.IF_RGRES,
            Sgn=1
            if cmetaa.IF_RFFTS == '-' else -1,  # opposite sign convention
            ImpRespBW=cmetaa.IF_RFFT_SAMP /
            (cmetaa.IF_RSS * cmetaa.IF_RFFT_TOT))
        the_sicd.Grid.Col = DirParamType(
            SS=cmetaa.IF_AZSS,
            ImpRespWid=cmetaa.IF_AZRES,
            Sgn=1
            if cmetaa.IF_AFFTS == '-' else -1,  # opposite sign convention
            ImpRespBW=cmetaa.IF_AZFFT_SAMP /
            (cmetaa.IF_AZSS * cmetaa.IF_AZFFT_TOT))
        cmplx_weight = cmetaa.CMPLX_WEIGHT
        if cmplx_weight == 'UWT':
            the_sicd.Grid.Row.WgtType = WgtTypeType(WindowName='UNIFORM')
            the_sicd.Grid.Col.WgtType = WgtTypeType(WindowName='UNIFORM')
        elif cmplx_weight == 'HMW':
            the_sicd.Grid.Row.WgtType = WgtTypeType(WindowName='HAMMING')
            the_sicd.Grid.Col.WgtType = WgtTypeType(WindowName='HAMMING')
        elif cmplx_weight == 'HNW':
            the_sicd.Grid.Row.WgtType = WgtTypeType(WindowName='HANNING')
            the_sicd.Grid.Col.WgtType = WgtTypeType(WindowName='HANNING')
        elif cmplx_weight == 'TAY':
            the_sicd.Grid.Row.WgtType = WgtTypeType(
                WindowName='TAYLOR',
                Parameters={
                    'SLL': '{0:0.16G}'.format(-cmetaa.CMPLX_RNG_SLL),
                    'NBAR': '{0:0.16G}'.format(cmetaa.CMPLX_RNG_TAY_NBAR)
                })
            the_sicd.Grid.Col.WgtType = WgtTypeType(
                WindowName='TAYLOR',
                Parameters={
                    'SLL': '{0:0.16G}'.format(-cmetaa.CMPLX_AZ_SLL),
                    'NBAR': '{0:0.16G}'.format(cmetaa.CMPLX_AZ_TAY_NBAR)
                })
        the_sicd.Grid.Row.define_weight_function()
        the_sicd.Grid.Col.define_weight_function()

        # noinspection PyBroadException
        try:
            date_str = cmetaa.T_UTC_YYYYMMMDD
            time_str = cmetaa.T_HHMMSSUTC
            date_time = '{}-{}-{}T{}:{}:{}Z'.format(
                date_str[:4], date_str[4:6], date_str[6:8], time_str[:2],
                time_str[2:4], time_str[4:6])
            the_sicd.Timeline.CollectStart = numpy.datetime64(date_time, 'us')
        except:
            pass
        the_sicd.Timeline.CollectDuration = cmetaa.WF_CDP
        the_sicd.Timeline.IPP = [
            IPPSetType(TStart=0,
                       TEnd=cmetaa.WF_CDP,
                       IPPStart=0,
                       IPPEnd=numpy.floor(cmetaa.WF_CDP * cmetaa.WF_PRF),
                       IPPPoly=[0, cmetaa.WF_PRF])
        ]

        the_sicd.RadarCollection.TxFrequency = TxFrequencyType(
            Min=cmetaa.WF_SRTFR, Max=cmetaa.WF_ENDFR)
        the_sicd.RadarCollection.TxPolarization = cmetaa.POL_TR.upper()
        the_sicd.RadarCollection.Waveform = [
            WaveformParametersType(TxPulseLength=cmetaa.WF_WIDTH,
                                   TxRFBandwidth=cmetaa.WF_BW,
                                   TxFreqStart=cmetaa.WF_SRTFR,
                                   TxFMRate=cmetaa.WF_CHRPRT * 1e12)
        ]
        tx_rcv_pol = '{}:{}'.format(cmetaa.POL_TR.upper(),
                                    cmetaa.POL_RE.upper())
        the_sicd.RadarCollection.RcvChannels = [
            ChanParametersType(TxRcvPolarization=tx_rcv_pol)
        ]

        the_sicd.ImageFormation.TxRcvPolarizationProc = tx_rcv_pol
        if_process = cmetaa.IF_PROCESS
        if if_process == 'PF':
            the_sicd.ImageFormation.ImageFormAlgo = 'PFA'
            scp_ecf = the_sicd.GeoData.SCP.ECF.get_array()
            fpn_ned = numpy.array(
                [cmetaa.CG_FPNUV_X, cmetaa.CG_FPNUV_Y, cmetaa.CG_FPNUV_Z],
                dtype='float64')
            ipn_ned = numpy.array(
                [cmetaa.CG_IDPNUVX, cmetaa.CG_IDPNUVY, cmetaa.CG_IDPNUVZ],
                dtype='float64')
            fpn_ecf = ned_to_ecf(fpn_ned, scp_ecf, absolute_coords=False)
            ipn_ecf = ned_to_ecf(ipn_ned, scp_ecf, absolute_coords=False)
            the_sicd.PFA = PFAType(FPN=fpn_ecf, IPN=ipn_ecf)
        elif if_process in ['RM', 'CD']:
            the_sicd.ImageFormation.ImageFormAlgo = 'RMA'

        # the remainder of this is guesswork to define required fields
        the_sicd.ImageFormation.TStartProc = 0  # guess work
        the_sicd.ImageFormation.TEndProc = cmetaa.WF_CDP
        the_sicd.ImageFormation.TxFrequencyProc = TxFrequencyProcType(
            MinProc=cmetaa.WF_SRTFR, MaxProc=cmetaa.WF_ENDFR)
        # all remaining guess work
        the_sicd.ImageFormation.STBeamComp = 'NO'
        the_sicd.ImageFormation.ImageBeamComp = 'SV' if cmetaa.IF_BEAM_COMP[
            0] == 'Y' else 'NO'
        the_sicd.ImageFormation.AzAutofocus = 'NO' if cmetaa.AF_TYPE[
            0] == 'N' else 'SV'
        the_sicd.ImageFormation.RgAutofocus = 'NO'
コード例 #14
0
 def get_geo_data() -> GeoDataType:
     return GeoDataType(SCP=SCPType(
         ECF=img['center_pixel']['target_position']))