Skip to content

Commit

Permalink
Syntax + credit changes for PR #427
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmlane committed Jul 22, 2020
1 parent 0b38e5e commit a3c1c99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions galpy/orbit/Orbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3281,12 +3281,12 @@ def vr(self,*args,**kwargs):
HISTORY:
2020-07-01 - Written - James (UofT)
2020-07-01 - Written - James Lane (UofT)
"""
thiso = self._call_internal(*args,**kwargs)
if self.dim() == 3:
r = numpy.sqrt( numpy.square(thiso[0]) + numpy.square(thiso[3]) )
r = numpy.sqrt(thiso[0]**2.+thiso[3]**2.)
return ((thiso[0]*thiso[1]+thiso[3]*thiso[4])/r).T
else:
return thiso[1].T
Expand Down Expand Up @@ -3317,14 +3317,14 @@ def vtheta(self,*args,**kwargs):
HISTORY:
2020-07-01 - Written - James (UofT)
2020-07-01 - Written - James Lane (UofT)
"""
thiso = self._call_internal(*args,**kwargs)
if not self.dim() == 3:
raise AttributeError("Orbit must be 3D to use vtheta()")
else:
r = numpy.sqrt(numpy.square(thiso[0])+numpy.square(thiso[3]))
r = numpy.sqrt( thiso[0]**2.+thiso[3]**2.)
return ((thiso[1]*thiso[3]-thiso[0]*thiso[4])/r).T

@physical_conversion('angle')
Expand All @@ -3349,7 +3349,7 @@ def theta(self,*args,**kwargs):
HISTORY:
2020-07-01 - Written - James (UofT)
2020-07-01 - Written - James Lane (UofT)
"""
thiso = self._call_internal(*args,**kwargs)
Expand Down
2 changes: 1 addition & 1 deletion galpy/util/bovy_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ def cyl_to_spher_vec(vR,vT,vz,R,z):
2020-07-01 - Written - James Lane (UofT)
"""
r = numpy.sqrt(numpy.square(R) + numpy.square(z))
r = numpy.sqrt(R**2.+z**2.)
vr = (R*vR + z*vz)/r
vtheta = (z*vR - R*vz)/r
return (vr,vT,vtheta)
Expand Down

0 comments on commit a3c1c99

Please sign in to comment.