{ "cells": [ { "cell_type": "markdown", "id": "de5f6c08-fefc-4f48-a7c4-3a0647524da5", "metadata": {}, "source": [ "# Loading TRACK data\n", "TRACK is Kevin Hodges' vortex tracker. It provides track files in an ASCII format than HuracanPy has functions to support." ] }, { "cell_type": "code", "execution_count": null, "id": "9f71474b-3616-4395-9a0f-2e8d6ce2e2e4", "metadata": {}, "outputs": [], "source": [ "import huracanpy" ] }, { "cell_type": "markdown", "id": "3e0f24d3-4e0f-42c9-bf11-21c012f277ad", "metadata": {}, "source": [ "## Basic functionnality\n", "TRACK file can be loaded providing the file path and the `tracker=TRACK` option." ] }, { "cell_type": "code", "execution_count": null, "id": "8b838fc3-fe6a-4f3d-afc1-9b5f9ec19bce", "metadata": {}, "outputs": [], "source": [ "# Embedded TRACK example file\n", "filename = huracanpy.example_TRACK_file\n", "# Load the tracks\n", "huracanpy.load(filename, source=\"TRACK\")" ] }, { "cell_type": "markdown", "id": "8552aaa4-81c3-4b05-b8ec-be7cf44b1331", "metadata": {}, "source": [ "## Dealing with metadata\n", "TRACK files using include more data than just time, longitude and latitude. However, because ASCII format cannot embed metadata, you need to obtain the name of the variables that were appended to the file from the person that produced it. \n", "Then, you can give them to the `load` function to be used as variable names, as illustrated below." ] }, { "cell_type": "code", "execution_count": null, "id": "bd198241-9621-4c00-8b29-3fdfd2a42d6e", "metadata": {}, "outputs": [], "source": [ "# Load the tracks with metadata\n", "huracanpy.load(\n", " filename,\n", " source=\"TRACK\",\n", " variable_names=[\n", " \"vor850\",\n", " \"vor700\",\n", " \"vor600\",\n", " \"vor500\",\n", " \"vor400\",\n", " \"vor300\",\n", " \"vor200\",\n", " \"mslp\",\n", " \"925_wind\",\n", " \"10m_wind\",\n", " ],\n", ")" ] }, { "cell_type": "markdown", "id": "95b8dbac-f8cb-494c-9cde-fdfbba265f93", "metadata": {}, "source": [ "## Netcdf TRACK files\n", "Sometimes, TRACK data is provided in NetCDF.\n", "In that case, you can load them this way." ] }, { "cell_type": "code", "execution_count": null, "id": "19e58a72-207e-4c60-8b01-87eae846e5f7", "metadata": {}, "outputs": [], "source": [ "# Embedded TRACK example file\n", "filename = huracanpy.example_TRACK_netcdf_file\n", "# Load the tracks\n", "huracanpy.load(filename)" ] } ], "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 }