|
83 | 83 | " icon_url = \"https://maps.google.com/mapfiles/kml/paddle/grn-blank.png\"\n",
|
84 | 84 | " html = '<a target=\"_blank\" href=\"https://sideshow.jpl.nasa.gov/post/links/{site}.html\"><img src=\"https://sideshow.jpl.nasa.gov/post/plots/{site}.jpg\" width=\"300\" height=\"300\"></a>'\n",
|
85 | 85 | " for cord, disp, site in zip(zip(df[lat_col], df[lon_col]), df[data_col], df[site_col]):\n",
|
86 |
| - " folium.Circle(\n", |
87 |
| - " location=cord,\n", |
88 |
| - " radius=abs(disp)*scale,\n", |
| 86 | + " theta = 0\n", |
| 87 | + " coords = []\n", |
| 88 | + " for k in range(0,31):\n", |
| 89 | + " vrad = disp\n", |
| 90 | + " lat = cord[0]\n", |
| 91 | + " lon = cord[1]\n", |
| 92 | + " angle = k/30*2*math.pi\n", |
| 93 | + " elon = vrad*math.cos(angle)*math.cos(theta)-vrad*math.sin(angle)*math.sin(theta)\n", |
| 94 | + " elat = vrad*math.cos(angle)*math.sin(theta)+vrad*math.sin(angle)*math.cos(theta)\n", |
| 95 | + " elon = (elon+0)/scale/math.cos(lat*math.pi/180.)\n", |
| 96 | + " elat = (elat+0)/scale\n", |
| 97 | + " coords.append([lat + elat,lon + elon])\n", |
| 98 | + " if (disp > 0):\n", |
| 99 | + " lcolor = 'red'\n", |
| 100 | + " else:\n", |
| 101 | + " lcolor = 'blue'\n", |
| 102 | + " folium.Polygon(\n", |
| 103 | + " locations=coords,\n", |
| 104 | + " fillColor=lcolor,\n", |
89 | 105 | " fill=True,\n",
|
90 |
| - " color=colormap(disp),\n", |
| 106 | + " fillOpacity=0.9,\n", |
| 107 | + " color=lcolor,\n", |
| 108 | + " weight=2,\n", |
91 | 109 | " popup=f'Vertical Displacement:{\"{:10.4f}\".format(disp)} mm, Site:{site}',\n",
|
92 |
| - " stroke=True,\n", |
93 |
| - " weight=1,\n", |
94 |
| - " fill_opacity=.8\n", |
95 |
| - " ).add_to(vertical)\n", |
| 110 | + " ).add_to(vertical)\n", |
| 111 | + "# folium.Circle(\n", |
| 112 | + "# location=cord,\n", |
| 113 | + "# radius=abs(disp)*scale,\n", |
| 114 | + "# fill=True,\n", |
| 115 | + "# color=colormap(disp),\n", |
| 116 | + "# popup=f'Vertical Displacement:{\"{:10.4f}\".format(disp)} mm, Site:{site}',\n", |
| 117 | + "# stroke=True,\n", |
| 118 | + "# weight=1,\n", |
| 119 | + "# fill_opacity=.8\n", |
| 120 | + "# ).add_to(vertical)\n", |
| 121 | + " \n", |
| 122 | + " \n", |
96 | 123 | " icon = folium.features.CustomIcon(icon_url,icon_size=(16, 16),icon_anchor=(8,16))\n",
|
97 | 124 | " #iframe = folium.element.IFrame(html=html, width=500, height=300)\n",
|
98 | 125 | " s_html = html.format(site=site)\n",
|
|
342 | 369 | {
|
343 | 370 | "data": {
|
344 | 371 | "application/vnd.jupyter.widget-view+json": {
|
345 |
| - "model_id": "72fbff5266044cc5819c63cf92614446", |
| 372 | + "model_id": "8254138517d549418c2db180ac830fa1", |
346 | 373 | "version_major": 2,
|
347 | 374 | "version_minor": 0
|
348 | 375 | },
|
|
447 | 474 | "name": "python",
|
448 | 475 | "nbconvert_exporter": "python",
|
449 | 476 | "pygments_lexer": "ipython3",
|
450 |
| - "version": "3.9.2" |
| 477 | + "version": "3.8.2" |
451 | 478 | }
|
452 | 479 | },
|
453 | 480 | "nbformat": 4,
|
|
0 commit comments