Пример #1
0
    def setDefaults(self):
        if self.polyDoppler is None:
            self.polyDoppler = Poly1D(name=self.name+'_geo2rdrPoly')
            self.polyDoppler.setMean(0.0)
            self.polyDoppler.initPoly(order=len(self.dopplerCentroidCoeffs)-1,
                coeffs = self.dopplerCentroidCoeffs)

        if all(v is None for v in [self.rangeImageName, self.azimuthImageName,
                    self.rangeOffsetImageName, self.azimuthOffsetImageName]):
            print('No outputs requested from geo2rdr. Check again.')
            sys.exit(0)

        if self.demWidth is None:
            self.demWidth = self.demImage.width

        if self.demLength is None:
            self.demLength = self.demImage.length

        if any(v != self.demWidth  for v in [self.demImage.width, self.latImage.width, self.lonImage.width]):
            print('Input lat, lon, z images should all have the same width')
            sys.exit(0)

        if any(v != self.demLength for v in [self.demImage.length, self.latImage.length, self.lonImage.length]):
            print('Input lat, lon, z images should all have the same length')
            sys.exit(0)

        if self.bistaticDelayCorrectionFlag is None:
            self.bistaticDelayCorrectionFlag = False
            print('Turning off bistatic delay correction term by default.')

        if self.orbitInterpolationMethod is None:
            self.orbitInterpolationMethod = 'HERMITE'

        pass
Пример #2
0
 def setDefaults(self):
     if self.polyDoppler is None:
         self.polyDoppler = Poly1D(name=self.name+'_geozeroPoly')
         self.polyDoppler.setMean(0.0)
         self.polyDoppler.initPoly(order=len(self.dopplerCentroidCoeffs)-1,
             coeffs = self.dopplerCentroidCoeffs)
     pass
Пример #3
0
def estimateAzShift(frame, dpoly, fpoly):
    '''
    Estimate azimuth shift polynomial.
    '''
    width = frame.getNumberOfSamples()
    prf = frame.getInstrument().getPulseRepetitionFrequency()

    print('Dopplers: ', dpoly(0), dpoly(width-1))
    print('FMrates: ', fpoly(0), fpoly(width-1))

    x = np.linspace(0,width, num=100)
    dt = -prf * dpoly(x) / fpoly(x)

    print('Shifts: ', dt[0], dt[-1])

    dt0 = dt[0] ####Account for shift to near range

#    dt = dt-dt0
    shift = Poly1D()
    shift.initPoly(order=4)
    shift.polyfit(x,dt)
    y = shift(x)

    print('Est shifts: ', y[0], y[-1])

    if False:
        plt.plot(x, dt, 'b')
        plt.plot(x, y, 'r')
        plt.show()

    return shift, dt0/prf 
Пример #4
0
def createPoly(polyType='2d', family=None, name=None):
    pol = None
    if polyType == '2d':
        pol = Poly2D(family, name)
    else:
        pol = Poly1D(family, name)
    return pol
Пример #5
0
 def setDefaults(self):
     if self.polyDoppler is None:
         self.polyDoppler = Poly1D(name=self.name+'_geocodePoly')
         self.polyDoppler.setNorm(1.0/(1.0*self.numberRangeLooks))
         self.polyDoppler.setMean(0.0)
         self.polyDoppler.initPoly(order=len(self.dopplerCentroidCoeffs)-1,
             coeffs = self.dopplerCentroidCoeffs)
     pass