def _populateOrbit(self): orbit = self.frame.getOrbit() velocityScale = 1.0 if (self.leaderFile.sceneHeaderRecord. metadata['Processing facility identifier'] == 'ERSDAC'): # The ERSDAC header orbits are in mm/s velocityScale = 1000.0 orbit.setReferenceFrame(self.leaderFile.platformPositionRecord. metadata['Reference coordinate system']) orbit.setOrbitSource('Header') orbitQuality = self._decodeOrbitQuality( self.leaderFile.platformPositionRecord. metadata['Orbital elements designator']) orbit.setOrbitQuality(orbitQuality) t0 = datetime.datetime(year=self.leaderFile.platformPositionRecord. metadata['Year of data point'], month=self.leaderFile.platformPositionRecord. metadata['Month of data point'], day=self.leaderFile.platformPositionRecord. metadata['Day of data point']) t0 = t0 + datetime.timedelta( seconds=self.leaderFile.platformPositionRecord. metadata['Seconds of day']) for i in range(self.leaderFile.platformPositionRecord. metadata['Number of data points']): vec = OrbitStateVector() t = t0 + datetime.timedelta( seconds=i * self.leaderFile.platformPositionRecord. metadata['Time interval between DATA points']) vec.setTime(t) dataPoints = self.leaderFile.platformPositionRecord.metadata[ 'Positional Data Points'][i] vec.setPosition([ dataPoints['Position vector X'], dataPoints['Position vector Y'], dataPoints['Position vector Z'] ]) vec.setVelocity([ dataPoints['Velocity vector X'] / velocityScale, dataPoints['Velocity vector Y'] / velocityScale, dataPoints['Velocity vector Z'] / velocityScale ]) orbit.addStateVector(vec)
def _populateOrbit(self, **kwargs): """ Create the orbit as the reference orbit defined by the peg """ # print("UAVSAR_RPI._populateOrbit") numExtra = 10 deltaFactor = 200 dt = deltaFactor * 1.0 / self.frame.instrument.getPulseRepetitionFrequency( ) t0 = (self.frame.getSensingStart() - datetime.timedelta(microseconds=int(numExtra * dt * 1e6))) ds = deltaFactor * self.frame.instrument.getAzimuthPixelSize() s0 = self.platformStartingAzimuth - numExtra * ds # print("populateOrbit: t0, startingAzimuth, platformStartingAzimuth, s0, ds = ", # t0, self.frame.S0, self.platformStartingAzimuth, s0, ds) h = self.platformHeight v = [self.velocity, 0., 0.] # print("t0, dt = ", t0, dt) # print("s0, ds, h = ", s0, ds, h) # print("v = ", v[0]) platform = self.frame.getInstrument().getPlatform() elp = platform.getPlanet().get_elp() elp.setSCH(self.peg.latitude, self.peg.longitude, self.peg.heading) orbit = self.frame.getOrbit() orbit.setOrbitSource('Header') # print("_populateOrbit: self.frame.numberOfLines, numExtra = ", self.frame.getNumberOfLines(), numExtra) for i in range(self.frame.getNumberOfLines() + numExtra): vec = OrbitStateVector() t = t0 + datetime.timedelta(microseconds=int(i * dt * 1e6)) vec.setTime(t) posSCH = [s0 + i * ds * (elp.pegRadCur + h) / elp.pegRadCur, 0., h] velSCH = v posXYZ, velXYZ = elp.schdot_to_xyzdot(posSCH, velSCH) vec.setPosition(posXYZ) vec.setVelocity(velXYZ) orbit.addStateVector(vec) # if i%1000 == 0 or i>self.frame.getNumberOfLines()+numExtra-3 or i < 3: # print("vec = ", vec) return
def _populateOrbit(self, **kwargs): """ Create the orbit as the reference orbit defined by the peg """ numgroup = 1000 prf = self.frame.instrument.getPulseRepetitionFrequency() daz = self.frame.instrument.getAzimuthPixelSize() vel = daz * prf t0 = self.frame.getSensingStart() nlines = int((self.frame.getSensingStop() - t0).total_seconds() * prf) #make sure the elp property has been called elp = self.elp orbit = self.frame.getOrbit() orbit.setOrbitSource('Header') for i in range(-5 * numgroup, int(nlines / numgroup) * numgroup + 5 * numgroup, numgroup): delt = int(i * 1.0e6 / prf) torb = self.frame.getSensingStart() + datetime.timedelta( microseconds=delt) ###Need to compute offset ###While taking into account, rounding off in time ds = delt * 1.0e-6 * vel vec = OrbitStateVector() vec.setTime(torb) posSCH = [self.frame.S0 + ds, 0.0, self.platformHeight] velSCH = [self.velocity, 0., 0.] posXYZ, velXYZ = elp.schdot_to_xyzdot(posSCH, velSCH) vec.setPosition(posXYZ) vec.setVelocity(velXYZ) orbit.addStateVector(vec) return