Skip to content

Commit

Permalink
Use scipy euclidean to measure distance.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkalmbach committed May 5, 2016
1 parent 9e4d3ad commit 549e5bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/createImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import astropy.convolution as conv
import matplotlib.pyplot as plt
from astropy.io import fits
from scipy.spatial.distance import euclidean

class createImage(object):

Expand Down Expand Up @@ -377,7 +378,7 @@ def findLikelyTrajectories(self, psiArray, phiArray,
testVel = topVel[rankings][objNum]
keepVal = True
for t0, vel in zip(keepT0, keepVel):
if ((np.sqrt(np.sum(np.power(testT0-t0,2))) < psfSigma) and (np.array_equal(testVel, vel))):
if ((euclidean(testT0, t0) < psfSigma) and (np.array_equal(testVel, vel))):
keepVal=False
if keepVal == True:
keepT0[resultsSet] = testT0
Expand Down

0 comments on commit 549e5bb

Please sign in to comment.