Пример #1
0
    def computePeg(self):

        shortOrb = Orbit()
        for i in range(-10, 10):
            time = self.tMid + datetime.timedelta(
                seconds=(old_div(i, self.prf)))
            sv = self.orbVec.interpolateOrbit(time, method='hermite')
            shortOrb.addStateVector(sv)

        objPeg = stdproc.createGetpeg()
        objPeg.wireInputPort(name='planet', object=self.planet)
        objPeg.wireInputPort(name='Orbit', object=shortOrb)

        stdWriter = create_writer("log", "", True, filename="orbitInfo.log")
        stdWriter.setFileTag("getpeg", "log")
        stdWriter.setFileTag("getpeg", "err")
        stdWriter.setFileTag("getpeg", "log")

        objPeg.setStdWriter(stdWriter)
        objPeg.estimatePeg()

        self.peg = objPeg.getPeg()
        self.rds = objPeg.getPegRadiusOfCurvature()
        self.hgt = objPeg.getAverageHeight()
        return
Пример #2
0
def getPeg(planet, orbit):
    #Returns relevant peg point. From runSetMocompPath.py

    objPeg = stdproc.createGetpeg()
    objPeg.wireInputPort(name='planet', object=planet)
    objPeg.wireInputPort(name='Orbit', object=orbit)

    stdWriter.setFileTag("getpeg", "log")
    stdWriter.setFileTag("getpeg", "err")
    stdWriter.setFileTag("getpeg", "out")
    #    objSetmocomppath.setStdWriter(self._stdWriter)
    objPeg.setStdWriter(stdWriter)
    objPeg.estimatePeg()

    return objPeg.getPeg(), objPeg.getAverageHeight()
Пример #3
0
def runSetmocomppath_new(self, peg=None):
    from isceobj.Location.Peg import Peg
    from stdproc.orbit.pegManipulator import averagePeg
    from isceobj.Catalog import recordInputsAndOutputs

    logger.info("Selecting individual peg points")

    planet = self._insar.getMasterFrame().getInstrument().getPlatform(
    ).getPlanet()
    masterOrbit = self._insar.getMasterOrbit()
    slaveOrbit = self._insar.getSlaveOrbit()

    pegpts = []

    for orbitObj, order in zip((masterOrbit, slaveOrbit), ('First', 'Second')):
        objGetpeg = stdproc.createGetpeg()
        if peg:
            objGetpeg.setPeg(peg)

        objGetpeg.wireInputPort(name='planet', object=planet)
        objGetpeg.wireInputPort(name='Orbit', object=orbitObj)
        self._stdWriter.setFileTag("getpeg", "log")
        self._stdWriter.setFileTag("getpeg", "err")
        self._stdWriter.setFileTag("getpeg", "out")
        objGetpeg.setStdWriter(self._stdWriter)
        logger.info('Peg points are computed for individual SAR scenes.')
        objGetpeg.estimatePeg()
        pegpts.append(objGetpeg.getPeg())

        recordInputsAndOutputs(self._insar.procDoc, objGetpeg, "getpeg", \
                    logger, "runSetmocomppath")
        #Piyush
        # I set these values here for the sake of continuity, but they need to be updated
        # in orbit2sch as the correct peg point is not yet known
        getattr(self._insar,
                'set%sAverageHeight' % (order))(objGetpeg.getAverageHeight())
        getattr(self._insar,
                'set%sProcVelocity' % (order))(objGetpeg.getProcVelocity())

    logger.info('Combining individual peg points.')
    peg = averagePeg(pegpts, planet)
    self._insar.setPeg(peg)
def run(orbit, planet, stdWriter, peg=None, catalog=None, sceneid='NO_ID'):
    """
    Get peg point from orbit.
    """
    logger.info("Selecting individual peg points: %s" % sceneid)

    objGetpeg = stdproc.createGetpeg()
    if peg is not None:
        objGetpeg.setPeg(peg)

    objGetpeg.wireInputPort(name='planet', object=planet)
    objGetpeg.wireInputPort(name='Orbit', object=orbit)
    objGetpeg.stdWriter = stdWriter.set_file_tags("getpeg", "log", "err",
                                                  "log")
    logger.info('Peg points are computed for individual SAR scenes.')
    objGetpeg.estimatePeg()
    if catalog is not None:
        isceobj.Catalog.recordInputsAndOutputs(
            catalog, objGetpeg, "runSetmocomppath.Getpeg.%s" % sceneid, logger,
            "runSetmocomppath.Getpeg.%s" % sceneid)
    return objGetpeg
Пример #5
0
    def getPeg(self):

        shortOrb = Orbit()
        for i in range(-10, 10):
            time = self.dt + datetime.timedelta(seconds=(i / self.prf))
            sv = self.orbit.interpolateOrbit(time, method='hermite')
            shortOrb.addStateVector(sv)

        objPeg = stdproc.createGetpeg()
        objPeg.wireInputPort(name='planet', object=self.planet)
        objPeg.wireInputPort(name='Orbit', object=shortOrb)

        stdWriter.setFileTag("getpeg", "log")
        stdWriter.setFileTag("getpeg", "err")
        stdWriter.setFileTag("getpeg", "out")
        objPeg.setStdWriter(stdWriter)
        objPeg.estimatePeg()

        self.peg = objPeg.getPeg()
        self.hgt = objPeg.getAverageHeight()
        self.rds = self.peg.getRadiusOfCurvature()
Пример #6
0
def runSetmocomppath(self, peg=None):
    from isceobj.Location.Peg import Peg
    from stdproc.orbit.pegManipulator import averagePeg
    from isceobj.Catalog import recordInputsAndOutputs

    logger.info("Selecting individual peg points")

    planet = self._insar.getReferenceFrame().getInstrument().getPlatform().getPlanet()
    referenceOrbit = self._insar.getReferenceOrbit()
    secondaryOrbit = self._insar.getSecondaryOrbit()

    if peg:
        self._insar.setPeg(peg)
        logger.info("Using the given peg = %r", peg)
        self._insar.setFirstAverageHeight(
            averageHeightAboveElp(planet, peg, referenceOrbit))
        self._insar.setSecondAverageHeight(
            averageHeightAboveElp(planet, peg, secondaryOrbit))
        self._insar.setFirstProcVelocity(
            sVelocityAtMidOrbit(planet, peg, referenceOrbit))
        self._insar.setSecondProcVelocity(
            sVelocityAtMidOrbit(planet, peg, secondaryOrbit))

        return


    pegpts = []

    for orbitObj, order in zip((referenceOrbit, secondaryOrbit)
                                ,('First', 'Second')):
        objGetpeg = stdproc.createGetpeg()
        if peg:
            objGetpeg.setPeg(peg)

        objGetpeg.wireInputPort(name='planet', object=planet)
        objGetpeg.wireInputPort(name='Orbit', object=orbitObj)
        self._stdWriter.setFileTag("getpeg", "log")
        self._stdWriter.setFileTag("getpeg", "err")
        self._stdWriter.setFileTag("getpeg", "out")
        objGetpeg.setStdWriter(self._stdWriter)
        logger.info('Peg points are computed for individual SAR scenes.')
        objGetpeg.estimatePeg()
        pegpts.append(objGetpeg.getPeg())

        recordInputsAndOutputs(self._insar.procDoc, objGetpeg, "getpeg", \
                    logger, "runSetmocomppath")
        #Piyush
        # I set these values here for the sake of continuity, but they need to be updated
        # in orbit2sch as the correct peg point is not yet known
        getattr(self._insar,'set%sAverageHeight'%(order))(objGetpeg.getAverageHeight())
        getattr(self._insar,'set%sProcVelocity'%(order))(objGetpeg.getProcVelocity())


    logger.info('Combining individual peg points.')
    peg = averagePeg(pegpts, planet)

    if self.pegSelect.upper() == 'REFERENCE':
        logger.info('Using reference info for peg point')
        self._insar.setPeg(pegpts[0])
    elif self.pegSelect.upper() == 'SECONDARY':
        logger.info('Using secondary infor for peg point')
        self._insar.setPeg(pegpts[1])
    elif self.pegSelect.upper() == 'AVERAGE':
        logger.info('Using average peg point')
        self._insar.setPeg(peg)
    else:
        raise Exception('Unknown peg selection method')