Commit 3ad79526 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

bugfix displace points

parent 6b78d1c3
2017-12-14 13:00 18.3609 58.7568 0.0000
2017-12-14 13:15 18.3609 58.7568 0.0000
2017-12-14 13:30 18.3609 58.7568 0.0000
2017-12-14 13:45 18.3609 58.7568 0.0000
2017-12-14 14:00 18.3609 58.7568 0.0000
2017-12-14 14:15 18.3609 58.7568 0.0000
2017-12-14 14:30 18.3609 58.7568 0.0000
2017-12-14 14:45 18.3609 58.7568 0.0000
2017-12-14 15:00 18.3609 58.7568 0.0000
2017-12-14 15:15 18.3609 58.7568 0.0000
2017-12-14 15:30 18.3609 58.7568 0.0000
2017-12-14 15:45 18.3609 58.7568 0.0000
2017-12-14 16:00 18.3609 58.7568 0.0000
2017-12-14 16:15 18.3609 58.7568 0.0000
2017-12-14 16:30 18.3609 58.7568 0.0000
2017-12-14 16:45 18.3609 58.7568 0.0000
2017-12-14 17:00 18.3609 58.7568 0.0000
2017-12-14 17:15 18.3609 58.7568 0.0000
2017-12-14 17:30 18.3609 58.7568 0.0000
2017-12-14 17:45 18.3609 58.7568 0.0000
2017-12-14 18:00 18.3609 58.7568 0.0000
2017-12-14 18:15 18.3609 58.7568 0.0000
2017-12-14 18:30 18.3609 58.7568 0.0000
2017-12-14 18:45 18.3609 58.7568 0.0000
2017-12-14 19:00 18.3609 58.7568 0.0000
2017-12-14 19:15 18.3609 58.7568 0.0000
2017-12-14 19:30 18.3609 58.7568 0.0000
2017-12-14 19:45 18.3609 58.7568 0.0000
2017-12-14 20:00 18.3609 58.7568 0.0000
2017-12-14 20:15 18.3609 58.7568 0.0000
2017-12-14 20:30 18.3609 58.7568 0.0000
2017-12-14 20:45 18.3609 58.7568 0.0000
2017-12-14 21:00 18.3609 58.7568 0.0000
2017-12-14 21:15 18.3609 58.7568 0.0000
2017-12-14 21:30 18.3609 58.7568 0.0000
2017-12-14 21:45 18.3609 58.7568 0.0000
2017-12-14 22:00 18.3609 58.7568 0.0000
2017-12-14 22:15 18.3609 58.7568 0.0000
2017-12-14 22:30 18.3609 58.7568 0.0000
2017-12-14 22:45 18.3609 58.7568 0.0000
2017-12-14 23:00 18.3609 58.7568 0.0000
2017-12-14 23:15 18.3609 58.7568 0.0000
2017-12-14 23:30 18.3609 58.7568 0.0000
2017-12-14 23:45 18.3609 58.7568 0.0000
2017-12-15 00:00 18.3609 58.7568 0.0000
2017-12-15 00:15 18.3609 58.7568 0.0000
2017-12-15 00:30 18.3609 58.7568 0.0000
2017-12-15 00:45 18.3609 58.7568 0.0000
2017-12-15 01:00 18.3609 58.7568 0.0000
2017-12-15 01:15 18.3609 58.7568 0.0000
2017-12-15 01:30 18.3609 58.7568 0.0000
2017-12-15 01:45 18.3609 58.7568 0.0000
2017-12-15 02:00 18.3609 58.7568 0.0000
2017-12-15 02:15 18.3609 58.7568 0.0000
2017-12-15 02:30 18.3609 58.7568 0.0000
2017-12-15 02:45 18.3609 58.7568 0.0000
2017-12-15 03:00 18.3609 58.7568 0.0000
2017-12-15 03:15 18.3609 58.7568 0.0000
2017-12-15 03:30 18.3609 58.7568 0.0000
2017-12-15 03:45 18.3609 58.7568 0.0000
2017-12-15 04:00 18.3609 58.7568 0.0000
2017-12-15 04:15 18.3609 58.7568 0.0000
2017-12-15 04:30 18.3609 58.7568 0.0000
2017-12-15 04:45 18.3609 58.7568 0.0000
2017-12-15 05:00 18.3609 58.7568 0.0000
2017-12-15 05:15 18.3609 58.7568 0.0000
2017-12-15 05:30 18.3609 58.7568 0.0000
2017-12-15 05:45 18.3609 58.7568 0.0000
2017-12-15 06:00 18.3609 58.7568 0.0000
2017-12-15 06:15 18.3609 58.7568 0.0000
2017-12-15 06:30 18.3609 58.7568 0.0000
2017-12-15 06:45 18.3609 58.7568 0.0000
2017-12-15 07:00 18.3609 58.7568 0.0000
2017-12-15 07:15 18.3609 58.7568 0.0000
2017-12-15 07:30 18.3609 58.7568 0.0000
2017-12-15 07:45 18.3609 58.7568 0.0000
2017-12-15 08:00 18.3609 58.7568 0.0000
2017-12-15 08:15 18.3609 58.7568 0.0000
2017-12-15 08:30 18.3609 58.7568 0.0000
2017-12-15 08:45 18.3609 58.7568 0.0000
2017-12-15 09:00 18.3609 58.7568 0.0000
2017-12-15 09:15 18.3609 58.7568 0.0000
2017-12-15 09:30 18.3609 58.7568 0.0000
2017-12-15 09:45 18.3609 58.7568 0.0000
2017-12-15 10:00 18.3609 58.7568 0.0000
2017-12-15 10:15 18.3609 58.7568 0.0000
2017-12-15 10:30 18.3609 58.7568 0.0000
2017-12-15 10:45 18.3547 58.7598 0.0000
2017-12-15 11:00 18.3354 58.7690 0.0000
2017-12-15 11:15 18.2913 58.7901 0.0000
2017-12-15 11:30 18.2000 58.8339 0.0000
2017-12-15 11:45 18.1425 58.8614 0.0000
2017-12-15 12:00 18.1324 58.8662 0.0000
2017-12-15 12:15 18.1324 58.8662 0.0000
2017-12-15 12:30 18.1324 58.8662 0.0000
2017-12-15 12:45 18.1324 58.8662 0.0000
2017-12-15 13:00 18.1324 58.8662 0.0000
2017-12-14 13:15 18.3595 58.7583 0.0000
2017-12-14 13:30 18.3523 58.7620 0.0000
2017-12-14 13:45 18.3441 58.7661 0.0000
2017-12-14 14:00 18.3272 58.7730 0.0000
2017-12-14 14:15 18.3063 58.7805 0.0000
2017-12-14 14:30 18.2833 58.7879 0.0000
2017-12-14 14:45 18.2648 58.7937 0.0000
2017-12-14 15:00 18.2476 58.7993 0.0000
2017-12-14 15:15 18.2335 58.8036 0.0000
2017-12-14 15:30 18.2256 58.8065 0.0000
2017-12-14 15:45 18.2184 58.8093 0.0000
2017-12-14 16:00 18.2157 58.8107 0.0000
2017-12-14 16:15 18.2136 58.8118 0.0000
2017-12-14 16:30 18.2105 58.8132 0.0000
2017-12-14 16:45 18.2091 58.8141 0.0000
2017-12-14 17:00 18.2071 58.8152 0.0000
2017-12-14 17:15 18.2054 58.8161 0.0000
2017-12-14 17:30 18.2067 58.8169 0.0000
2017-12-14 17:45 18.2091 58.8177 0.0000
2017-12-14 18:00 18.2102 58.8187 0.0000
2017-12-14 18:15 18.2102 58.8209 0.0000
2017-12-14 18:30 18.2102 58.8225 0.0000
2017-12-14 18:45 18.2105 58.8235 0.0000
2017-12-14 19:00 18.2109 58.8246 0.0000
2017-12-14 19:15 18.2112 58.8260 0.0000
2017-12-14 19:30 18.2112 58.8274 0.0000
2017-12-14 19:45 18.2112 58.8290 0.0000
2017-12-14 20:00 18.2109 58.8303 0.0000
2017-12-14 20:15 18.2105 58.8313 0.0000
2017-12-14 20:30 18.2092 58.8328 0.0000
2017-12-14 20:45 18.2081 58.8340 0.0000
2017-12-14 21:00 18.2061 58.8351 0.0000
2017-12-14 21:15 18.2043 58.8361 0.0000
2017-12-14 21:30 18.2019 58.8370 0.0000
2017-12-14 21:45 18.1999 58.8376 0.0000
2017-12-14 22:00 18.1975 58.8384 0.0000
2017-12-14 22:15 18.1954 58.8392 0.0000
2017-12-14 22:30 18.1934 58.8397 0.0000
2017-12-14 22:45 18.1913 58.8404 0.0000
2017-12-14 23:00 18.1889 58.8409 0.0000
2017-12-14 23:15 18.1872 58.8416 0.0000
2017-12-14 23:30 18.1851 58.8424 0.0000
2017-12-14 23:45 18.1827 58.8431 0.0000
2017-12-15 00:00 18.1807 58.8436 0.0000
2017-12-15 00:15 18.1786 58.8441 0.0000
2017-12-15 00:30 18.1769 58.8448 0.0000
2017-12-15 00:45 18.1748 58.8456 0.0000
2017-12-15 01:00 18.1728 58.8461 0.0000
2017-12-15 01:15 18.1704 58.8470 0.0000
2017-12-15 01:30 18.1686 58.8477 0.0000
2017-12-15 01:45 18.1666 58.8482 0.0000
2017-12-15 02:00 18.1645 58.8489 0.0000
2017-12-15 02:15 18.1621 58.8495 0.0000
2017-12-15 02:30 18.1601 58.8502 0.0000
2017-12-15 02:45 18.1580 58.8505 0.0000
2017-12-15 03:00 18.1566 58.8514 0.0000
2017-12-15 03:15 18.1552 58.8523 0.0000
2017-12-15 03:30 18.1546 58.8534 0.0000
2017-12-15 03:45 18.1532 58.8544 0.0000
2017-12-15 04:00 18.1518 58.8557 0.0000
2017-12-15 04:15 18.1501 58.8566 0.0000
2017-12-15 04:30 18.1487 58.8574 0.0000
2017-12-15 04:45 18.1470 58.8583 0.0000
2017-12-15 05:00 18.1456 58.8592 0.0000
2017-12-15 05:15 18.1443 58.8601 0.0000
2017-12-15 05:30 18.1429 58.8610 0.0000
2017-12-15 05:45 18.1412 58.8617 0.0000
2017-12-15 06:00 18.1395 58.8624 0.0000
2017-12-15 06:15 18.1383 58.8628 0.0000
2017-12-15 06:30 18.1381 58.8630 0.0000
2017-12-15 06:45 18.1378 58.8633 0.0000
2017-12-15 07:00 18.1377 58.8636 0.0000
2017-12-15 07:15 18.1375 58.8638 0.0000
2017-12-15 07:30 18.1373 58.8641 0.0000
2017-12-15 07:45 18.1370 58.8643 0.0000
2017-12-15 08:00 18.1366 58.8645 0.0000
2017-12-15 08:15 18.1363 58.8648 0.0000
2017-12-15 08:30 18.1358 58.8649 0.0000
2017-12-15 08:45 18.1353 58.8650 0.0000
2017-12-15 09:00 18.1348 58.8652 0.0000
2017-12-15 09:15 18.1345 58.8654 0.0000
2017-12-15 09:30 18.1343 58.8656 0.0000
2017-12-15 09:45 18.1341 58.8657 0.0000
2017-12-15 10:00 18.1338 58.8659 0.0000
2017-12-15 10:15 18.1335 58.8660 0.0000
2017-12-15 10:30 18.1333 58.8661 0.0000
2017-12-15 10:45 18.1331 58.8663 0.0000
2017-12-15 11:00 18.1330 58.8664 0.0000
2017-12-15 11:15 18.1328 58.8665 0.0000
2017-12-15 11:30 18.1327 58.8666 0.0000
2017-12-15 11:45 18.1327 58.8666 0.0000
2017-12-15 12:00 18.1326 58.8667 0.0000
2017-12-15 12:15 18.1326 58.8667 0.0000
2017-12-15 12:30 18.1326 58.8667 0.0000
2017-12-15 12:45 18.1326 58.8667 0.0000
2017-12-15 13:00 18.1326 58.8667 0.0000
# Particles are distributed at the nodes of a grid formed by equilateral
# CreateHexagon: Particles are distributed at the nodes of a grid formed by equilateral
# triangles. The distance between the particles, ie the length of the sides of
# the triangles,is determined by the requirement that the area one particle
# represents times the number of particles should equal the area of the polygon
......@@ -28,8 +28,6 @@ from shapely.geometry import LineString
from shapely.strtree import STRtree
from shapely.geometry import MultiLineString
class Model(object):
def __init__(self):
return
......@@ -87,8 +85,6 @@ class Model(object):
'coordinates': coords,
'nodes': nodes
}
def createOutlet(self,geom):
nrOfParticles = 300
......@@ -140,9 +136,9 @@ class Model(object):
return featurecollection
def shorePoints(self, pointsdata, beforepoints, nowpoints, activeindex, matches):
for i in range(len(beforepoints)):
queryline = LineString([[beforepoints[i].y,beforepoints[i].x],[nowpoints[i][1],nowpoints[i][0]]])
def shorePoints(self, pointsdata, originalpoints, displacedpoints, activeindex, matches):
for i in range(len(originalpoints)):
queryline = LineString([[originalpoints[i].y,originalpoints[i].x],[displacedpoints[i][1],displacedpoints[i][0]]])
intersection = None
if (len(matches) > 0):
for match in matches:
......@@ -152,10 +148,10 @@ class Model(object):
pointsdata[activeindex[i]][1] = 7 # on shore category
if (intersection.geom_type is 'Point'):
pointsdata[activeindex[i]][0] = [intersection.y,intersection.x]
# deactive.append([intersection.y,intersection.x])
if (intersection.geom_type is 'MultiPoint'):
pointsdata[activeindex[i]][0] = [intersection.geoms[0].y,intersection.geoms[0].x]
# deactive.append([intersection.geoms[0].y,intersection.geoms[0].x])
else:
pointsdata[activeindex[i]][0] = displacedpoints[i]
return pointsdata
......@@ -169,7 +165,6 @@ class Model(object):
return radius
def displacePoints(self, pDist, points):
p = 0
xdisp = [0] * len(points)
ydisp = [0] * len(points)
......@@ -205,8 +200,6 @@ class Model(object):
xdisp[p] = xdisp[p] * maxdisp / disp
ydisp[p] = ydisp[p] * maxdisp / disp
p += 1
result = list(points)
for i, dx in enumerate(xdisp):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment