Skip to content

Commit

Permalink
add test comparing frequencies for potential and interpolated potenti…
Browse files Browse the repository at this point in the history
…al; currently fails
  • Loading branch information
jobovy committed Aug 9, 2015
1 parent 4733e60 commit 61bc854
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nose/test_actionAngle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,25 @@ def test_actionAngleTorus_orbit():
'Integrated orbit does not agree with torus orbit in phi'
return None

# Test that actionAngleTorus w/ interp pot gives same freqs as regular pot
@expected_failure
def test_actionAngleTorus_interppot_freqs():
from galpy.actionAngle import actionAngleTorus
from galpy.potential import LogarithmicHaloPotential, interpRZPotential
lp= LogarithmicHaloPotential(normalize=1.)
ip= interpRZPotential(RZPot=lp,
interpDens=True,interpRforce=True,interpzforce=True,
enable_c=True)
aAT= actionAngleTorus(pot=lp)
aATi= actionAngleTorus(pot=ip)
jr,jphi,jz= 0.05,1.1,0.02
om= aAT.Freqs(jr,jphi,jz)
omi= aATi.Freqs(jr,jphi,jz)
assert numpy.fabs(om[0]-omi[0]) < 10.**-4., 'Radial frequency computed using the torus machine does not agree between potential and interpolated potential'
assert numpy.fabs(om[1]-omi[1]) < 10.**-4., 'Azimuthal frequency computed using the torus machine does not agree between potential and interpolated potential'
assert numpy.fabs(om[2]-omi[2]) < 10.**-4., 'Vertical frequency computed using the torus machine does not agree between potential and interpolated potential'
return None

#Test error when potential is not implemented in C
def test_actionAngleTorus_nocerr():
from galpy.actionAngle import actionAngleTorus
Expand Down

0 comments on commit 61bc854

Please sign in to comment.