Skip to content

Commit

Permalink
Merge pull request #2 from jbkalmbach/issue/1/only-print-unique-top-r…
Browse files Browse the repository at this point in the history
…esults

Issue/1/only print unique top results
  • Loading branch information
jbkalmbach committed May 5, 2016
2 parents c623491 + 6f796ef commit 496106a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 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 @@ -332,7 +333,7 @@ def findLikelyTrajectories(self, psiArray, phiArray,
velArr = np.array([vRow, vCol]).T

psfPixelArea = np.pi*(psfSigma**2)
tempResults = int(np.ceil(psfPixelArea)*numResults)
tempResults = int(np.ceil(psfPixelArea)*numResults)*2

topVel = np.zeros((tempResults, 2))
topT0 = np.zeros((tempResults,2))
Expand Down Expand Up @@ -377,7 +378,8 @@ 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 (testVel[0] == vel[0]) and (testVel[1] == vel[1])):
if ((euclidean(testT0, t0) <= psfSigma) and ((euclidean(testT0+(testVel*timeArr[-1]),
t0+(vel*timeArr[-1])) <= psfSigma))):
keepVal=False
if keepVal == True:
keepT0[resultsSet] = testT0
Expand Down

0 comments on commit 496106a

Please sign in to comment.