{ "cells": [ { "cell_type": "markdown", "id": "de5f6c08-fefc-4f48-a7c4-3a0647524da5", "metadata": {}, "source": [ "# Loading TempestExtremes data\n", "If you are running TempestExtremes, we would recommend outputting your tracks as CSV. However, if you use the\n", "default output or want to read output that has been produced in this format then huracanpy can load that." ] }, { "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", "The tracks can be loaded providing the file path and the `tracker=tempestextremes` option." ] }, { "cell_type": "code", "execution_count": null, "id": "8b838fc3-fe6a-4f3d-afc1-9b5f9ec19bce", "metadata": {}, "outputs": [], "source": [ "# Embedded TempestExtremes example file\n", "filename = huracanpy.example_TE_file\n", "# Load the tracks\n", "huracanpy.load(filename, source=\"tempestextremes\")" ] }, { "cell_type": "markdown", "id": "8552aaa4-81c3-4b05-b8ec-be7cf44b1331", "metadata": {}, "source": [ "## Dealing with metadata\n", "TempestExtremes files can include more data than just time, longitude and latitude.\n", "However, the ASCII format does not embed metadata, you need to obtain the name of the variables\n", "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=\"tempestextremes\",\n", " variable_names=[\n", " \"mslp\",\n", " \"vmax\",\n", " ],\n", ")" ] } ], "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 }