@petrus.hyvonen @MaximeJ
The Java run time error of my code was due to the line,
estimated = EstimatedMeasurement(self, iteration, evaluation, [emitterState],timeStampedCoordList)
I had to create a TDOA instance and pass the instance to the EstimatedMeasurement.
# Create a new instance
tdoaInstance = MyTDOA(self.getPrimeStation(),self.getSecondStation(),self.getDate(), float(self.getObservedValue()[0]),float(self.getTheoreticalStandardDeviation()[0]),float(self.getBaseWeight()[0]), self.getSatellites().get(0))
estimated = EstimatedMeasurement(tdoaInstance , iteration, evaluation, [emitterState],timeStampedCoordList)
The above error seems to resolve for now.
But the values I am getting are vastly different for the second iteration. Is is necessary to add clock offset drivers if the values are all zero for the ground stations ?
I have attached the data I get from BatchLSObserver . (observations_TDOA : data from Orekit TDOA class)
What could be the reason for the difference ?
The theoraticalEvaluation
method is -
def theoreticalEvaluation(self,iteration,evaluation,states):
state = states[0]
nbParams = 6
pvaG = self.getCoordinates(state, 0, nbParams)
primePV = self._primeStation.getBaseFrame().getPVCoordinates(self.getDate(), state.getFrame())
primePVFieldPosition, measurementDateG = self.getFiedStationCoordinates(primePV.getPosition(),primePV.getDate(),nbParams,0)
tau1 = self.signalTimeOfFlight(pvaG, primePVFieldPosition, measurementDateG)
dtMtau1 = Gradient.cast_(measurementDateG.durationFrom(state.getDate()).subtract(tau1))
emitterState = state.shiftedBy(dtMtau1.getValue())
emitterPV = pvaG.shiftedBy(dtMtau1)
tau2 = tau1
previous = tau2.getValue()
dateAt2 = emitterState.getDate().shiftedBy(previous)
secondPV = self._secondStation.getBaseFrame().getPVCoordinates(dateAt2, state.getFrame())
secondPVFieldPosition, measurementDateG = self.getFiedStationCoordinates(secondPV.getPosition(),secondPV.getDate(),nbParams,0)
tau2 = Gradient.cast_(self.linkDelay(emitterPV.getPosition(), secondPVFieldPosition))
delta = FastMath.abs(tau2.getValue() - previous)
count = 1
while (count < 10 and delta >= 2 * FastMath.ulp(tau2.getValue())):
# While loop code
tdoaG = Gradient.cast_(tau1.subtract(tau2))
tdoa = tdoaG.getValue()
pv1 = primePV
pv2 = secondPV
timeStampedCoordList = [emitterPV.toTimeStampedPVCoordinates(), pv2 if tdoa>0 else pv1, pv1 if tdoa>0 else pv2]
tdoaInstance = MyTDOA(self.getPrimeStation(),self.getSecondStation(),self.getDate(), float(self.getObservedValue()[0]),float(self.getTheoreticalStandardDeviation()[0]),float(self.getBaseWeight()[0]), self.getSatellites().get(0))
estimated = EstimatedMeasurement(tdoaInstance, iteration, evaluation, [emitterState],timeStampedCoordList)
estimated.setEstimatedValue(tdoa)
derivatives = tdoaG.getGradient()
jArrayArray = JArray('object')(1)
jArrayArray[0] = Arrays.copyOfRange(derivatives, 0, 6)
estimated.setStateDerivatives(0, jArrayArray)
return estimated
observations_TDOA.txt (2.2 MB)
observations_MyTdoa.txt (552.3 KB)
I am getting "Unable to solve , Singular problem " error due this.
Thank you.