# HG changeset patch # User Nicolas Saunier # Date 1307988908 14400 # Node ID 19603b5fa57866dbea0e98fa19b614435b61e644 # Parent a5ef9e40688eab2eff9465164e264569799b0b82 added timeinterval computation for indicators based on dictionaries diff -r a5ef9e40688e -r 19603b5fa578 python/event.py --- a/python/event.py Sun Jun 12 03:24:55 2011 -0400 +++ b/python/event.py Mon Jun 13 14:15:08 2011 -0400 @@ -36,6 +36,7 @@ return None def computeIndicators(self): + '''Computes the collision course cosine only if the cosine is positive''' collisionCourseDotProduct = [0]*self.timeInterval.length() collisionCourseCosine = {} distances = [0]*self.timeInterval.length() diff -r a5ef9e40688e -r 19603b5fa578 python/moving.py --- a/python/moving.py Sun Jun 12 03:24:55 2011 -0400 +++ b/python/moving.py Mon Jun 13 14:15:08 2011 -0400 @@ -475,6 +475,12 @@ else: return self.values.values()[self.iterInstantNum-1] + def getTimeInterval(self): + if not self.timeInterval and type(self.values)==dict: + instants = self.values.keys() + self.timeInterval = TimeInterval(instants[0], instants[-1]) + return self.timeInterval + def getValues(self): if self.timeInterval: return self.values