comparison python/moving.py @ 213:5cde6da74605

added minor comments
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 07 Jun 2012 00:53:30 -0400
parents ada6e8fbe4c6
children 9c7fc6899c0e
comparison
equal deleted inserted replaced
212:ce44605f888a 213:5cde6da74605
623 values = sorted(values[indices], reverse = self.mostSevereIsMax) # inverted if most severe is max -> take the first values 623 values = sorted(values[indices], reverse = self.mostSevereIsMax) # inverted if most severe is max -> take the first values
624 return mean(values[:minNInstants]) 624 return mean(values[:minNInstants])
625 else: 625 else:
626 return None 626 return None
627 627
628 # functions to aggregate discretized maps of indicators
629 # TODO add values in the cells between the positions (similar to discretizing vector graphics to bitmap)
630
628 def indicatorMap(indicatorValues, trajectory, squareSize): 631 def indicatorMap(indicatorValues, trajectory, squareSize):
629 '''Returns a dictionary 632 '''Returns a dictionary
630 with keys for the indices of the cells (squares) 633 with keys for the indices of the cells (squares)
631 in which the trajectory positions are located 634 in which the trajectory positions are located
632 at which the indicator values are attached 635 at which the indicator values are attached