How to calculate epoch of signal emitting from ground station for fixed epoch of its receiving by spacecraft

I have a question about sending signal from the ground station to the spacecraft. If the spacecraft orbit is known, how can I calculate the epoch, when the ground station should emit the signal, so that the spacecraft will receive it exactly in a fixed epoch?
I examined some types of measurements. “Range” suites well for signal route from spacecraft to ground station, or two-way from spacecraft to ground station and back, but it seems impossible to calculate the second part of this route for the fixed final epoch. “Bistatic range”, if I understand it correctly, works with route ‘ground station - spacecraft - ground station’ with fixed initial epoch. Could you help me with advice, which class is better to use in this task? Or should I write a new realization of AbstractMeasurement, maybe?
Thank you in advance for your answer.

Hi @IrinaPonomareva

You can probably look at the AbstractMeasurement.signalTimeOfFlight method, using the satellite position as the receiver position. This is a static method, you can call it directly.
For the emitter position, you need to have a complete TimeStampedPVCoordinates for the emitting ground station. The simplest way to do that is to use the Transform from the topocentric frame to the inertial frame. In the topocentric frame, you get the fixed origin and it will be the Transform that will add the Earth rotation and derivatives, hence allowing signalTimeOfFlight to take into account Earth rotation. If the time of flight of your signal is short (i.e. your satellite is closer than the Moon for example), then it will work directly. If your time of fligh is long, you may need to call the method twice, once to have a rought estimate and a second time with the Transform recomputed at this rough emission date estimate.

The initial TimeStampedPVCoordinates could be computed using something along these lines:

 TimeStampedPVCoordinates  origin =
      new TimeStampedPVCoordinates(receptionDate ,
                                   Vector3D.ZERO, Vector3D.ZERO, Vector3D.ZERO);
  Transform transform = topoFrame.getTransformTo(inertialFrame, receptionDate);
  TimeStampedPVCoordinates movingStation = transform.transformPVCoordinates(origin);