subroutine heliocentriccorr locate ODF orbit file locate earth ephemeris file calculate XMM-Newton attitude calculate Earth velocity Get the time of the observation mid point calculate Heliocentric correction end subroutine heliocentriccorr