aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers/WindGaussianMapper.py
diff options
context:
space:
mode:
Diffstat (limited to 'pixelmappers/WindGaussianMapper.py')
-rwxr-xr-xpixelmappers/WindGaussianMapper.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pixelmappers/WindGaussianMapper.py b/pixelmappers/WindGaussianMapper.py
new file mode 100755
index 0000000..c5d77ca
--- /dev/null
+++ b/pixelmappers/WindGaussianMapper.py
@@ -0,0 +1,18 @@
+from operationscore.PixelMapper import *
+import util.Geo as Geo
+import math
+class WindGaussianMapper(PixelMapper):
+ def mappingFunction(self, eventLocation, screen):
+ returnPixels = [] #TODO: consider preallocation and trimming
+ [x,y] = eventLocation
+ potentialPixels = screen.pixelsInRange(x-self.CutoffDist, x)
+ for (xloc,pixel) in screen.pixelsInRange(x-self.CutoffDist, x):
+ pixelDistx = math.fabs(pixel.location[0] - x)
+ pixelDisty = math.fabs(pixel.location[1] - y)
+ if pixelDistx < self.CutoffDist:
+ if pixelDisty < 30:
+ w = Geo.windtrail(pixelDistx, pixelDisty, self.Height, 0, self.Width)
+ if w > self.MinWeight:
+ returnPixels.append((pixel, w))
+
+ return returnPixels