No reference date set for parameter prime-meridian-offset

Hi All,

I am trying to write a modified TDOA class using Java and I am getting the error

no reference date set for parameter prime-meridian-offset

This is generated when executing the line,

 final TimeStampedFieldPVCoordinates<Gradient> primePV =
                        primeToInert.transformPVCoordinates(new TimeStampedFieldPVCoordinates<>(measurementDateG,
                                                                                                zero, zero, zero));

I would some insight in to how to solve this issue.

I prefer not to use the syntax

 final TimeStampedPVCoordinates primePV = primeStation.getBaseFrame().getPVCoordinates(mDate, state.getFrame());

to get the PV coordinates of the prime station. I tried this and getting slightly different values. Following is the first part of the class.

public class DiffOfArrivelPV extends AbstractMeasurement<DiffOfArrivelPV>{

	//this class take satellite state, measurement date and calculate the
	/*
	 * 1. primePV
	 * 2. satellitePV
	 * 3. secondPV
	 * 4. tau1
	 * 5. tau2
	 * 6. tdoa
	 */
	private TimeStampedFieldPVCoordinates<Gradient> primePV;
	private TimeStampedFieldPVCoordinates<Gradient> secondPV;
	private TimeStampedFieldPVCoordinates<Gradient> satellitePV;
	private Gradient tau1;
	private Gradient tau2;
	private GroundStation primeStation;
	private GroundStation secondStation;
	private AbsoluteDate mDate;
	
	public DiffOfArrivelPV(final GroundStation primeStation,final GroundStation secondStation,AbsoluteDate obDate,final ObservableSatellite satellite) {
		super(obDate, 0.01, 0.01, 1.0, Collections.singletonList(satellite));
		
		// add parameter drivers for the primary station
        addParameterDriver(primeStation.getClockOffsetDriver());
        addParameterDriver(primeStation.getClockDriftDriver());
        addParameterDriver(primeStation.getEastOffsetDriver());
        addParameterDriver(primeStation.getNorthOffsetDriver());
        addParameterDriver(primeStation.getZenithOffsetDriver());
        addParameterDriver(primeStation.getPrimeMeridianOffsetDriver());
        addParameterDriver(primeStation.getPrimeMeridianDriftDriver());
        addParameterDriver(primeStation.getPolarOffsetXDriver());
        addParameterDriver(primeStation.getPolarDriftXDriver());
        addParameterDriver(primeStation.getPolarOffsetYDriver());
        addParameterDriver(primeStation.getPolarDriftYDriver());
        // add parameter drivers for the secondary station
        addParameterDriver(secondStation.getClockOffsetDriver());
        addParameterDriver(secondStation.getClockDriftDriver());
        addParameterDriver(secondStation.getEastOffsetDriver());
        addParameterDriver(secondStation.getNorthOffsetDriver());
        addParameterDriver(secondStation.getZenithOffsetDriver());
        addParameterDriver(secondStation.getPrimeMeridianOffsetDriver());
        addParameterDriver(secondStation.getPrimeMeridianDriftDriver());
        addParameterDriver(secondStation.getPolarOffsetXDriver());
        addParameterDriver(secondStation.getPolarDriftXDriver());
        addParameterDriver(secondStation.getPolarOffsetYDriver());
        addParameterDriver(secondStation.getPolarDriftYDriver());
        // satellite
        addParameterDriver(satellite.getClockDriftDriver());
		this.primeStation = primeStation;
		this.secondStation = secondStation;
		this.mDate = obDate;
		// Set parameters
		
	}
	
	
	


	public void calculatePVData(final SpacecraftState state) {
		final double METERS_TO_KM = 1e-3;
		int nbParams = 6;
        final Map<String, Integer> indices = new HashMap<>();
		final FieldVector3D<Gradient> zero = FieldVector3D.getZero(GradientField.getField(nbParams));
	
        
        for (ParameterDriver driver : getParametersDrivers()) {
            // we have to check for duplicate keys because primary and secondary station share
            // pole and prime meridian parameters names that must be considered
            // as one set only (they are combined together by the estimation engine)
            if (driver.isSelected() && !indices.containsKey(driver.getName())) {
                indices.put(driver.getName(), nbParams++);
            }
        }
        
        

        // coordinates of the spacecraft as a gradient
        final TimeStampedFieldPVCoordinates<Gradient> pvaG = AbstractMeasurement.getCoordinates(state, 0, nbParams);
             
        // get the prime station iniertial frame as filedTransform
        final FieldTransform<Gradient> primeToInert =
                primeStation.getOffsetToInertial(state.getFrame(), mDate, nbParams, indices);
        final FieldAbsoluteDate<Gradient> measurementDateG = primeToInert.getFieldDate();
        
     // prime station PV in inertial frame at the real date of the measurement
        final TimeStampedFieldPVCoordinates<Gradient> primePV =
                        primeToInert.transformPVCoordinates(new TimeStampedFieldPVCoordinates<>(measurementDateG,
                                                                                                zero, zero, zero));

        // compute downlink delay from emitter to prime receiver
        Gradient tau1 = AbstractMeasurement.signalTimeOfFlight(pvaG, primePV.getPosition(), measurementDateG);

        // elapsed time between state date and signal arrival to the prime receiver
        final Gradient dtMtau1 = measurementDateG.durationFrom(state.getDate()).subtract(tau1);

When I am using the above class with exiting TDOA class, the error does not appear . I am not sure how the reference date is set for primeMeridianDriftDriver by Orekit.

Thank you. !!

Hi @niluj,

The reference date must be set by the user.
If you’re not estimating the Earth Orientation Parameters you can set any date: the measurement date, the S/C date, an arbitrary epoch…

See an example in Orekit tests, in the class TDOAMeasurementCreator.

Hope this helps,
Maxime

Hi MaximeJ,

THANK YOU VERY MUCH!!! :slight_smile:

May I know the purpose of the TDOAMeasurementCreator Class?
The tdoa calculation is slightly different in this class compared to TDOA class.

Its purpose is to generate TDOA measurement for tests. To validate the measurement class, like TDOA class, we need to generate measurements and that’s the purpose of TDOAMeasurementCreator.
This class is an Orekit’s step handler, it means that when you add the class to an orbit propagator, it generates the measurements during the propagation.
The TDOAMeasurementCreator class is only devoted for tests purposes.

A full measurement generation package is available in Orekit in the estimation.measurements.creator package. You can also find a tutorial showing how to use this package here.

Regards,
Bryan