galpy
galpy copied to clipboard
Overflow error in ``McMillan17``
McMillan17
(and more generally, DiskSCFPotential
) is prone to overflow errors at large z/zd
, for example, the following fails
import numpy as np
from galpy.orbit import Orbit
from galpy import potential
from galpy.potential.mwpotentials import McMillan17
from galpy.actionAngle import estimateDeltaStaeckel
from galpy.util import conversion
ro17 = conversion.get_physical(McMillan17)['ro']
vo17 = conversion.get_physical(McMillan17)['vo']
o17 = Orbit([209.3, 26.8, 46.5, -1.16, -0.88, 189.11], radec=True, ro = ro17, vo=vo17)
estimateDeltaStaeckel(McMillan17,o17.R(use_physical=False),o17.z(use_physical=False))
because of overflow in line 270 here: https://github.com/jobovy/galpy/blob/6abeaa6764b3734a64eb9baa4af2f754a41b9869/galpy/potential/DiskSCFPotential.py#L268-L270
cc @anyadovgal who raised this issue originally.