Integrals to calculate generalised magnetic coordinates from an input magnetic flux function asymptotically close to the separatrix are presented, and implemented in the GPEC/DCON code suite. These integrals allow characterisation of the magnetic equilibrium of a diverted tokamak, in magnetic coordinates, arbitrarily close to the last closed flux surface, avoiding the numerical issues associated with calculating diverging field-line integrals near a magnetic x-point. These methods may assist ongoing efforts to develop robust asymptotic equilibrium behaviour for spectral 3D MHD codes at the separatrix.