Commit ce5b8390 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

fixes

parent a929077c
2017-12-14 10:00 26.9879 59.9743 0.0000 2017-12-14 13:00 18.3609 58.7568 0.0000
2017-12-14 10:15 26.9872 59.9767 0.0000 2017-12-14 13:15 18.3595 58.7582 0.0000
2017-12-14 10:30 26.9859 59.9794 0.0000 2017-12-14 13:30 18.3523 58.7620 0.0000
2017-12-14 10:45 26.9845 59.9815 0.0000 2017-12-14 13:45 18.3441 58.7661 0.0000
2017-12-14 11:00 26.9838 59.9835 0.0000 2017-12-14 14:00 18.3273 58.7730 0.0000
2017-12-14 11:15 26.9824 59.9856 0.0000 2017-12-14 14:15 18.3063 58.7805 0.0000
2017-12-14 11:30 26.9817 59.9877 0.0000 2017-12-14 14:30 18.2833 58.7880 0.0000
2017-12-14 11:45 26.9811 59.9897 0.0000 2017-12-14 14:45 18.2648 58.7936 0.0000
2017-12-14 12:00 26.9810 59.9921 0.0000 2017-12-14 15:00 18.2476 58.7993 0.0000
2017-12-14 12:15 26.9810 59.9949 0.0000 2017-12-14 15:15 18.2335 58.8036 0.0000
2017-12-14 12:30 26.9817 59.9973 0.0000 2017-12-14 15:30 18.2256 58.8065 0.0000
2017-12-14 12:45 26.9838 59.9993 0.0000 2017-12-14 15:45 18.2184 58.8093 0.0000
2017-12-14 13:00 26.9865 60.0014 0.0000 2017-12-14 16:00 18.2157 58.8107 0.0000
2017-12-14 13:15 26.9872 60.0035 0.0000 2017-12-14 16:15 18.2136 58.8118 0.0000
2017-12-14 13:30 26.9872 60.0058 0.0000 2017-12-14 16:30 18.2105 58.8132 0.0000
2017-12-14 13:45 26.9859 60.0079 0.0000 2017-12-14 16:45 18.2091 58.8141 0.0000
2017-12-14 14:00 26.9845 60.0100 0.0000 2017-12-14 17:00 18.2071 58.8152 0.0000
2017-12-14 14:15 26.9804 60.0107 0.0000 2017-12-14 17:15 18.2054 58.8161 0.0000
2017-12-14 14:30 26.9756 60.0117 0.0000 2017-12-14 17:30 18.2068 58.8169 0.0000
2017-12-14 14:45 26.9701 60.0117 0.0000 2017-12-14 17:45 18.2092 58.8177 0.0000
2017-12-14 15:00 26.9646 60.0117 0.0000 2017-12-14 18:00 18.2102 58.8187 0.0000
2017-12-14 15:15 26.9584 60.0117 0.0000 2017-12-14 18:15 18.2102 58.8209 0.0000
2017-12-14 15:30 26.9529 60.0117 0.0000 2017-12-14 18:30 18.2102 58.8225 0.0000
2017-12-14 15:45 26.9481 60.0117 0.0000 2017-12-14 18:45 18.2105 58.8235 0.0000
2017-12-14 16:00 26.9440 60.0120 0.0000 2017-12-14 19:00 18.2109 58.8246 0.0000
2017-12-14 16:15 26.9405 60.0134 0.0000 2017-12-14 19:15 18.2112 58.8260 0.0000
2017-12-14 16:30 26.9378 60.0155 0.0000 2017-12-14 19:30 18.2112 58.8274 0.0000
2017-12-14 16:45 26.9378 60.0182 0.0000 2017-12-14 19:45 18.2112 58.8290 0.0000
2017-12-14 17:00 26.9350 60.0199 0.0000 2017-12-14 20:00 18.2109 58.8303 0.0000
2017-12-14 17:15 26.9309 60.0213 0.0000 2017-12-14 20:15 18.2105 58.8313 0.0000
2017-12-14 17:30 26.9282 60.0230 0.0000 2017-12-14 20:30 18.2092 58.8328 0.0000
2017-12-14 17:45 26.9254 60.0247 0.0000 2017-12-14 20:45 18.2081 58.8340 0.0000
2017-12-14 18:00 26.9227 60.0268 0.0000 2017-12-14 21:00 18.2061 58.8351 0.0000
2017-12-14 18:15 26.9213 60.0288 0.0000 2017-12-14 21:15 18.2043 58.8361 0.0000
2017-12-14 18:30 26.9199 60.0309 0.0000 2017-12-14 21:30 18.2019 58.8370 0.0000
2017-12-14 18:45 26.9199 60.0333 0.0000 2017-12-14 21:45 18.1999 58.8376 0.0000
2017-12-14 19:00 26.9206 60.0357 0.0000 2017-12-14 22:00 18.1975 58.8384 0.0000
2017-12-14 19:15 26.9241 60.0378 0.0000 2017-12-14 22:15 18.1954 58.8392 0.0000
2017-12-14 19:30 26.9275 60.0395 0.0000 2017-12-14 22:30 18.1934 58.8397 0.0000
2017-12-14 19:45 26.9316 60.0408 0.0000 2017-12-14 22:45 18.1913 58.8404 0.0000
2017-12-14 20:00 26.9357 60.0419 0.0000 2017-12-14 23:00 18.1889 58.8409 0.0000
2017-12-14 20:15 26.9399 60.0432 0.0000 2017-12-14 23:15 18.1872 58.8416 0.0000
2017-12-14 20:30 26.9447 60.0446 0.0000 2017-12-14 23:30 18.1851 58.8424 0.0000
2017-12-14 20:45 26.9488 60.0453 0.0000 2017-12-14 23:45 18.1827 58.8431 0.0000
2017-12-14 21:00 26.9536 60.0460 0.0000 2017-12-15 00:00 18.1807 58.8436 0.0000
2017-12-14 21:15 26.9577 60.0470 0.0000 2017-12-15 00:15 18.1786 58.8441 0.0000
2017-12-14 21:30 26.9631 60.0476 0.0000 2017-12-15 00:30 18.1769 58.8448 0.0000
2017-12-14 21:45 26.9651 60.0478 0.0000 2017-12-15 00:45 18.1748 58.8456 0.0000
2017-12-14 22:00 26.9666 60.0478 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.1553 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.8575 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.8655 0.0000
2017-12-15 09:30 18.1343 58.8656 0.0000
2017-12-15 09:45 18.1341 58.8658 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.8662 0.0000
2017-12-15 10:45 18.1332 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
...@@ -294,20 +294,20 @@ class Model(object): ...@@ -294,20 +294,20 @@ class Model(object):
for i, coord in enumerate(linestring.coords): for i, coord in enumerate(linestring.coords):
start = time.time() start = time.time()
if (len(mp.geoms) > 0): if (len(mp.geoms) > 0):
print('active: '+str(len(mp.geoms))) # print('active: '+str(len(mp.geoms)))
points = self.centerPoints(coord, mp.centroid, mp.geoms) points = self.centerPoints(coord, mp.centroid, mp.geoms)
displacedpoints = self.displacePoints(pDist, points) displacedpoints = self.displacePoints(pDist, points)
print('displacedpoints: '+str(len(displacedpoints))) # print('displacedpoints: '+str(len(displacedpoints)))
activepoints, onlandpoints = self.onlandPoints(mp.geoms, displacedpoints, matches) activepoints, onlandpoints = self.onlandPoints(mp.geoms, displacedpoints, matches)
print('activepoints: '+str(len(activepoints))) # print('activepoints: '+str(len(activepoints)))
print('onlandpoints: '+str(len(onlandpoints))) # print('onlandpoints: '+str(len(onlandpoints)))
deactivepoints += onlandpoints deactivepoints += onlandpoints
# print('active: '+str(len(activepoints))) # print('active: '+str(len(activepoints)))
# print('onland: '+str(len(onlandpoints))) # print('onland: '+str(len(onlandpoints)))
end = time.time() end = time.time()
# print('onland: '+str(end-start)) # print('onland: '+str(end-start))
mp = geometry.MultiPoint(activepoints+deactivepoints) mp = geometry.MultiPoint(activepoints+deactivepoints)
print('active+deactive: '+str(len(mp.geoms))) # print('active+deactive: '+str(len(mp.geoms)))
level = [0] * len(mp.geoms) level = [0] * len(mp.geoms)
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)
......
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"simulation":{"forwardCalculation":true,"startDate":1513245600000,"stopDate":1513288800000,"oilclass":"Oil classes","substance":"Medium oils (100-1000 cSt)","fresh":true,"amount":"10","amountUnit":"m3","uncertainty":false,"mode":"Normal"},"primary":"PADM","type":"exercise","subtype":"instant","meanLat":59.97425688709357,"meanLng":26.987915039062504,"observation":[{"id":null,"provider":"USER","providerDataRef":null,"providerImgRef":null,"providerType":null,"type":"MANUAL","date":1513245600000}],"domain":"HELCOM","model":"NEMO"},"geometry":{"type":"Point","coordinates":[26.987915039062504,59.97425688709357]}},{"type":"Feature","properties":{"auxiliary":"exercise","time":[1513246500000,1513247400000,1513248300000,1513249200000,1513250100000,1513251000000,1513251900000,1513252800000,1513253700000,1513254600000,1513255500000,1513256400000,1513257300000,1513258200000,1513259100000,1513260000000,1513260900000,1513261800000,1513262700000,1513263600000,1513264500000,1513265400000,1513266300000,1513267200000,1513268100000,1513269000000,1513269900000,1513270800000,1513271700000,1513272600000,1513273500000,1513274400000,1513275300000,1513276200000,1513277100000,1513278000000,1513278900000,1513279800000,1513280700000,1513281600000,1513282500000,1513283400000,1513284300000,1513285200000,1513286100000,1513287000000,1513287900000,1513288800000]},"geometry":{"type":"LineString","coordinates":[[26.98722839355469,59.97666192903553],[26.985855102539062,59.979410334504294],[26.98448181152344,59.98147148888771],[26.98379516601563,59.98353251494715],[26.982421875000004,59.985593412687976],[26.98173522949219,59.9876541821155],[26.981048583984375,59.989714823235055],[26.981048583984375,59.992118742381244],[26.981048583984375,59.99486586472143],[26.98173522949219,59.997269409679994],[26.98379516601563,59.99932945209936],[26.986541748046875,60.0013893662409],[26.98722839355469,60.00344915210996],[26.98722839355469,60.00585207350879],[26.985855102539062,60.007911581472406],[26.98448181152344,60.009970961180386],[26.980361938476566,60.01065739258274],[26.975555419921875,60.01168701296785],[26.970062255859375,60.01168701296785],[26.96456909179688,60.01168701296785],[26.958389282226566,60.01168701296785],[26.952896118164066,60.01168701296785],[26.94808959960938,60.01168701296785],[26.9439697265625,60.01203021263809],[26.94053649902344,60.013402975695705],[26.93778991699219,60.01546201341474],[26.93778991699219,60.01820719756272],[26.93504333496094,60.0199228218921],[26.930923461914066,60.021295257243196],[26.928176879882812,60.023010721294156],[26.925430297851566,60.02472609630581],[26.922683715820312,60.02678442879232],[26.92131042480469,60.02884263307204],[26.919937133789066,60.030900709150345],[26.919937133789066,60.03330163588306],[26.92062377929688,60.03570238813511],[26.92405700683594,60.037760036913696],[26.927490234375004,60.039474646314986],[26.93161010742188,60.04084626974892],[26.935729980468754,60.04187494994124],[26.93984985351563,60.04324647368814],[26.944656372070316,60.044617940473216],[26.948776245117188,60.04530365250556],[26.95358276367188,60.04598935029802],[26.957702636718754,60.047017870287405],[26.963882446289066,60.047703532481066],[26.96800231933594,60.048389180435585],[26.97280883789063,60.04873199907319]]}}]} {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"simulation":{"forwardCalculation":true,"startDate":1513256400000,"stopDate":1513342800000,"oilclass":"Oil classes","substance":"Medium oils (100-1000 cSt)","fresh":true,"amount":"10","amountUnit":"m3","uncertainty":false,"mode":"Normal"},"primary":"PADM","type":"exercise","subtype":"instant","meanLat":58.75680543225761,"meanLng":18.360900878906254,"observation":[{"id":null,"provider":"USER","providerDataRef":null,"providerImgRef":null,"providerType":null,"type":"MANUAL","date":1513256400000}],"domain":"HELCOM","model":"NEMO"},"geometry":{"type":"Point","coordinates":[18.360900878906254,58.75680543225761]}},{"type":"Feature","properties":{"auxiliary":"exercise","time":[1513257300000,1513258200000,1513259100000,1513260000000,1513260900000,1513261800000,1513262700000,1513263600000,1513264500000,1513265400000,1513266300000,1513267200000,1513268100000,1513269000000,1513269900000,1513270800000,1513271700000,1513272600000,1513273500000,1513274400000,1513275300000,1513276200000,1513277100000,1513278000000,1513278900000,1513279800000,1513280700000,1513281600000,1513282500000,1513283400000,1513284300000,1513285200000,1513286100000,1513287000000,1513287900000,1513288800000,1513289700000,1513290600000,1513291500000,1513292400000,1513293300000,1513294200000,1513295100000,1513296000000,1513296900000,1513297800000,1513298700000,1513299600000,1513300500000,1513301400000,1513302300000,1513303200000,1513304100000,1513305000000,1513305900000,1513306800000,1513307700000,1513308600000,1513309500000,1513310400000,1513311300000,1513312200000,1513313100000,1513314000000,1513314900000,1513315800000,1513316700000,1513317600000,1513318500000,1513319400000,1513320300000,1513321200000,1513322100000,1513323000000,1513323900000,1513324800000,1513325700000,1513326600000,1513327500000,1513328400000,1513329300000,1513330200000,1513331100000,1513332000000,1513332900000,1513333800000,1513334700000,1513335600000,1513336500000,1513337400000,1513338300000,1513339200000,1513340100000,1513341000000,1513341900000,1513342800000]},"geometry":{"type":"LineString","coordinates":[[18.35952758789063,58.758229977465014],[18.352317810058597,58.76196913085653],[18.344078063964847,58.766063932525924],[18.32725524902344,58.773006189137675],[18.30631256103516,58.780480914164364],[18.28330993652344,58.787954030623865],[18.264770507812504,58.79364675410282],[18.24760437011719,58.79933854403445],[18.233528137207035,58.80360677390105],[18.22563171386719,58.80645196879573],[18.21842193603516,58.809296930358116],[18.21567535400391,58.810719323643475],[18.213615417480472,58.81178608032933],[18.210525512695316,58.81320837154076],[18.20915222167969,58.814097273929185],[18.207092285156254,58.81516392672157],[18.205375671386722,58.8160527789875],[18.206748962402347,58.81694160847107],[18.20915222167969,58.817652655654896],[18.21018218994141,58.81871919909263],[18.21018218994141,58.82085218755376],[18.21018218994141,58.82245184278951],[18.210525512695316,58.823518238609786],[18.210868835449222,58.82458460162793],[18.21121215820313,58.82600636796106],[18.21121215820313,58.82742807598191],[18.21121215820313,58.829027427805926],[18.210868835449222,58.830271317092986],[18.210525512695316,58.83133747237921],[18.20915222167969,58.83275896174271],[18.208122253417972,58.83400271710735],[18.206062316894535,58.83506875760534],[18.204345703125004,58.83613476530816],[18.20194244384766,58.83702308000908],[18.199882507324222,58.83755605789824],[18.19747924804688,58.83844433616154],[18.19541931152344,58.83915494237557],[18.193359375000004,58.839687887471506],[18.191299438476566,58.8403984681802],[18.188896179199222,58.84093139414738],[18.18717956542969,58.841641949351306],[18.185119628906254,58.84235248998134],[18.18271636962891,58.84306301603768],[18.180656433105472,58.84359590101607],[18.178596496582035,58.844128777796925],[18.176879882812504,58.84483926741984],[18.174819946289066,58.84554974246974],[18.17276000976563,58.84608258919371],[18.170356750488285,58.846970648851176],[18.168640136718754,58.84768108018313],[18.166580200195316,58.84821389411899],[18.16452026367188,58.84892429994956],[18.162117004394535,58.849457094759636],[18.160057067871097,58.85016747508943],[18.15799713134766,58.850522659789966],[18.156623840332035,58.851410605603746],[18.15525054931641,58.8522985286499],[18.154563903808597,58.853364006252534],[18.153190612792972,58.854429451070985],[18.151817321777347,58.85567242859108],[18.150100708007816,58.856560242357794],[18.14872741699219,58.85744803335905],[18.14701080322266,58.8583358015952],[18.145637512207035,58.859223547066584],[18.14426422119141,58.86011126977364],[18.142890930175785,58.860998969716675],[18.141174316406254,58.8617091132813],[18.139457702636722,58.862419242277376],[18.138341903686527,58.86277430131227],[18.138084411621097,58.86304059319835],[18.137826919555668,58.86330688303576],[18.137655258178714,58.863573170824544],[18.13748359680176,58.863839456564726],[18.13731193542481,58.864105740256264],[18.136968612670902,58.86432764176763],[18.136625289916996,58.86454954185634],[18.13628196716309,58.86477144052246],[18.13576698303223,58.86490457903925],[18.13525199890137,58.86503771704389],[18.134822845458988,58.86521523358677],[18.134608268737797,58.86534837039643],[18.134436607360843,58.86545931734657],[18.134222030639652,58.865548074650626],[18.133964538574222,58.86563683172708],[18.133707046508793,58.86570339938503],[18.1334924697876,58.86579215606313],[18.13323497772217,58.86588091251365],[18.132977485656742,58.86594747970213],[18.132677078247074,58.866014046762594],[18.132376670837406,58.86610280264405],[18.132076263427738,58.866191558297885],[18.13181877136231,58.86628031372411],[18.13156127929688,58.86632469135188],[18.13130378723145,58.866413446436695],[18.131089210510257,58.86652438997262],[18.130917549133304,58.86663533315288]]}}]}
\ No newline at end of file \ No newline at end of file
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