{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "c1243de4-747a-4191-baa7-0443e68edd33", "metadata": {}, "outputs": [], "source": [ "from cartopy.crs import EqualEarth, Geodetic\n", "import huracanpy\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "id": "5c0affa9-8f83-4eb1-a87b-d5466b31feaa", "metadata": {}, "source": [ "# Cyclone stalling\n", "## Corral radius\n", "[Trepanier et al. (2024)](https://doi.org/10.1175/JAMC-D-23-0229.1) defined a stalled\n", "cyclone as one that had a 72-hour corral radius of less than 200km. The corral radius\n", "is defined as the smallest radius circle that contains all of the track points within\n", "the given window. This can be calculated with\n", "[huracanpy.calc.corral_radius](../api/_autosummary/huracanpy.calc.corral_radius.rst)\n", "\n", "Below is an example of calculating the corral radius and stalled points for Hurricane\n", "Harvey in 2017, an infamously slow moving tropical cyclone that produced extreme\n", "rainfall totals." ] }, { "cell_type": "code", "execution_count": null, "id": "1e99d365-0674-4638-b604-fd7fc360a9af", "metadata": {}, "outputs": [], "source": [ "tracks = huracanpy.load(source=\"ibtracs\")\n", "harvey = tracks.hrcn.sel_id(\"2017228N14314\")" ] }, { "cell_type": "code", "execution_count": null, "id": "3b30a46c-a702-40b4-b2ec-9733cec9c423", "metadata": {}, "outputs": [], "source": [ "# The window is taken backward and forward from the centre point, so 36 gives a 72-hour\n", "# window\n", "corral_radius = harvey.hrcn.get_corral_radius(window=36)\n", "\n", "# Stalled points are where the corral radius is less that 200km\n", "# note that units are in metres\n", "stalled_points = corral_radius < 200e3" ] }, { "cell_type": "code", "execution_count": null, "id": "cbe28937-ea41-4270-9e5c-d4d3d80bfbd1", "metadata": {}, "outputs": [], "source": [ "ax = plt.axes(projection=EqualEarth())\n", "im = huracanpy.plot.fancyline(\n", " harvey.lon, harvey.lat, colors=corral_radius, vmin=0, linewidths=5\n", ")\n", "plt.plot(\n", " harvey.lon[stalled_points], harvey.lat[stalled_points], \"xk\", transform=Geodetic()\n", ")\n", "plt.colorbar(im, label=\"Corral Radius (m)\", orientation=\"horizontal\")\n", "\n", "ax.stock_img()\n", "ax.coastlines()\n", "ax.gridlines(draw_labels=[\"left\", \"bottom\"])\n", "ax.set_title(\"Hurricane Harvey - 2017\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 5 }