Commit 8aadeb67 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

printouts

parent 1f13a2d8
2017-12-13 08:00 27.0119 60.0031 0.0000 2017-12-13 08:00 27.0119 60.0031 0.0000
2017-12-13 08:15 27.0112 60.0034 0.0000 2017-12-13 08:15 27.0113 60.0034 0.0000
2017-12-13 08:30 27.0103 60.0036 0.0000
2017-12-13 08:45 27.0094 60.0039 0.0000
2017-12-13 09:00 27.0083 60.0043 0.0000
2017-12-13 09:15 27.0075 60.0046 0.0000
2017-12-13 09:30 27.0065 60.0052 0.0000
2017-12-13 09:45 27.0059 60.0057 0.0000
2017-12-13 10:00 27.0052 60.0061 0.0000
2017-12-13 10:15 27.0047 60.0066 0.0000
2017-12-13 10:30 27.0041 60.0072 0.0000
2017-12-13 10:45 27.0034 60.0077 0.0000
2017-12-13 11:00 27.0028 60.0082 0.0000
2017-12-13 11:15 27.0025 60.0088 0.0000
2017-12-13 11:30 27.0022 60.0093 0.0000
2017-12-13 11:45 27.5613 59.4504 0.0000
2017-12-13 12:00 32.4847 54.5275 0.0000
2017-12-13 12:15 40.9888 46.0239 0.0000
2017-12-13 12:30 50.3883 36.6248 0.0000
2017-12-13 12:45 58.3332 28.6800 0.0000
2017-12-13 13:00 60.0117 27.0015 0.0000
2017-12-13 13:15 60.0117 27.0015 0.0000
2017-12-13 13:30 60.0117 27.0015 0.0000
2017-12-13 13:45 60.0117 27.0015 0.0000
2017-12-13 14:00 60.0117 27.0015 0.0000
2017-12-13 14:15 60.0117 27.0015 0.0000
2017-12-13 14:30 60.0117 27.0015 0.0000
2017-12-13 14:45 60.0117 27.0015 0.0000
2017-12-13 15:00 60.0117 27.0015 0.0000
2017-12-13 15:15 60.0117 27.0015 0.0000
2017-12-13 15:30 60.0117 27.0015 0.0000
2017-12-13 15:45 60.0117 27.0015 0.0000
2017-12-13 16:00 60.0117 27.0015 0.0000
2017-12-13 16:15 60.0117 27.0015 0.0000
2017-12-13 16:30 60.0117 27.0015 0.0000
2017-12-13 16:45 60.0117 27.0015 0.0000
2017-12-13 17:00 60.0117 27.0015 0.0000
2017-12-13 17:15 60.0117 27.0015 0.0000
2017-12-13 17:30 60.0117 27.0015 0.0000
2017-12-13 17:45 60.0117 27.0015 0.0000
2017-12-13 18:00 60.0117 27.0015 0.0000
2017-12-13 18:15 60.0117 27.0015 0.0000
2017-12-13 18:30 60.0117 27.0015 0.0000
2017-12-13 18:45 60.0117 27.0015 0.0000
2017-12-13 19:00 60.0117 27.0015 0.0000
2017-12-13 19:15 60.0117 27.0015 0.0000
2017-12-13 19:30 60.0117 27.0015 0.0000
2017-12-13 19:45 60.0117 27.0015 0.0000
2017-12-13 20:00 60.0117 27.0015 0.0000
...@@ -100,9 +100,9 @@ def run(): ...@@ -100,9 +100,9 @@ def run():
outputfeaturecollection['properties']['status'] = 'COMPLETE' outputfeaturecollection['properties']['status'] = 'COMPLETE'
outputfeaturecollection['properties']['simulation'] = outletproperties['simulation'] outputfeaturecollection['properties']['simulation'] = outletproperties['simulation']
#Cloudtrack.write(outputfeaturecollection) Cloudtrack.write(outputfeaturecollection)
#Particletrack.write(outputfeaturecollection) Particletrack.write(outputfeaturecollection)
Output.write(outputfeaturecollection) # Output.write(outputfeaturecollection)
print("COMPLETE") print("COMPLETE")
sys.exit(0) sys.exit(0)
......
# intersect.py
#
# Demonstrate how Shapely can be used to analyze and plot the intersection of
# a trajectory and regions in space.
from functools import partial
import random
import pylab
from shapely.geometry import LineString, Point
from shapely.ops import cascaded_union
# Build patches as in dissolved.py
r = partial(random.uniform, -20.0, 20.0)
points = [Point(r(), r()) for i in range(100)]
spots = [p.buffer(2.5) for p in points]
patches = cascaded_union(spots)
# Represent the following geolocation parameters
#
# initial position: -25, -25
# heading: 45.0
# speed: 50*sqrt(2)
#
# as a line
vector = LineString(((-25.0, -25.0), (25.0, 25.0)))
# Find intercepted and missed patches. List the former so we can count them
# later
intercepts = [patch for patch in patches.geoms if vector.intersects(patch)]
misses = (patch for patch in patches.geoms if not vector.intersects(patch))
# Plot the intersection
intersection = vector.intersection(patches)
print(intersection)
assert intersection.geom_type in ['MultiLineString']
if __name__ == "__main__":
# Illustrate the results using matplotlib's pylab interface
pylab.figure(num=None, figsize=(4, 4), dpi=180)
# Plot the misses
for spot in misses:
x, y = spot.exterior.xy
pylab.fill(x, y, color='#cccccc', aa=True)
pylab.plot(x, y, color='#999999', aa=True, lw=1.0)
# Do the same for the holes of the patch
for hole in spot.interiors:
x, y = hole.xy
pylab.fill(x, y, color='#ffffff', aa=True)
pylab.plot(x, y, color='#999999', aa=True, lw=1.0)
# Plot the intercepts
for spot in intercepts:
x, y = spot.exterior.xy
pylab.fill(x, y, color='red', alpha=0.25, aa=True)
pylab.plot(x, y, color='red', alpha=0.5, aa=True, lw=1.0)
# Do the same for the holes of the patch
for hole in spot.interiors:
x, y = hole.xy
pylab.fill(x, y, color='#ffffff', aa=True)
pylab.plot(x, y, color='red', alpha=0.5, aa=True, lw=1.0)
# Draw the projected trajectory
pylab.arrow(-25, -25, 50, 50, color='#999999', aa=True,
head_width=1.0, head_length=1.0)
for segment in intersection.geoms:
x, y = segment.xy
pylab.plot(x, y, color='red', aa=True, lw=1.5)
# Write the number of patches and the total patch area to the figure
pylab.text(-28, 25,
"Patches: %d/%d (%d), total length: %.1f" \
% (len(intercepts), len(patches.geoms),
len(intersection.geoms), intersection.length))
pylab.savefig('intersect.png')
\ No newline at end of file
...@@ -303,9 +303,9 @@ class Model(object): ...@@ -303,9 +303,9 @@ class Model(object):
category = [2] * len(mp.geoms) category = [2] * len(mp.geoms)
properties = self.createProperties((i+2), timearray[i], mp.centroid, level, category) properties = self.createProperties((i+2), timearray[i], mp.centroid, level, category)
features.append(self.createFeature(mp, properties)) features.append(self.createFeature(mp, properties))
# if (i % 10 == 0): if (i % 10 == 0):
# Cloudtrack.write(featurecollection) Cloudtrack.write(featurecollection)
# Particletrack.write(featurecollection) Particletrack.write(featurecollection)
mp = geometry.MultiPoint(activepoints) mp = geometry.MultiPoint(activepoints)
print('deactivepoints: '+str(len(deactivepoints))) print('deactivepoints: '+str(len(deactivepoints)))
......
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