You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"We iterate over closed contours and sort with regards of shape error\n\n"
55
+
]
56
+
},
57
+
{
58
+
"cell_type": "code",
59
+
"execution_count": null,
60
+
"metadata": {
61
+
"collapsed": false
62
+
},
63
+
"outputs": [],
64
+
"source": [
65
+
"g = RegularGridDataset(\n data.get_path(\"dt_med_allsat_phy_l4_20160515_20190101.nc\"), \"longitude\", \"latitude\"\n)\nc = Contours(g.x_c, g.y_c, g.grid(\"adt\") * 100, arange(-50, 50, 0.2))\ncontours = dict()\nfor coll in c.iter():\n for current_contour in coll.get_paths():\n _, _, _, aerr = current_contour.fit_circle()\n i = int(aerr // 4) + 1\n if i not in contours:\n contours[i] = list()\n contours[i].append(current_contour)"
66
+
]
67
+
},
68
+
{
69
+
"cell_type": "markdown",
70
+
"metadata": {},
71
+
"source": [
72
+
"Shape error gallery\n-------------------\nFor each contour display, we display circle fitted, we work at different latitude circle could have distorsion\n\n"
73
+
]
74
+
},
75
+
{
76
+
"cell_type": "code",
77
+
"execution_count": null,
78
+
"metadata": {
79
+
"collapsed": false
80
+
},
81
+
"outputs": [],
82
+
"source": [
83
+
"fig = plt.figure(figsize=(12, 12))\nfor i in range(1, 26):\n e_min, e_max = (i - 1) * 4, i * 4\n ax = plt.subplot(5, 5, i, title=f\" {e_min} < err < {e_max}\")\n ax.xaxis.set_ticklabels([])\n ax.yaxis.set_ticklabels([])\n ax.set_aspect(\"equal\")\n ax.grid()\n if i in contours:\n for contour in contours[i]:\n x, y = contour.lon, contour.lat\n x0, y0, radius, _ = contour.fit_circle()\n if x.shape[0] > 30 and 30000 < radius < 70000:\n # Plot only first contour found\n m = ax.plot(x, y, \"r\")[0]\n ax.plot(*build_circle(x0, y0, radius), \"g--\")\n ax.plot(x0, y0, \"k.\")\n break\nplt.tight_layout()"
0 commit comments