{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Download NWM Retrospective Gridded Data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Import the TEEHR module and any required libraries." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "from teehr.loading.nwm.retrospective_grids import nwm_retro_grids_to_parquet\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Specify the input parameters." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "OUTPUT_ROOT = Path(Path().home(), \"temp\")\n", "OUTPUT_DIR = Path(OUTPUT_ROOT, \"gridded_retro\")\n", "\n", "ZONAL_WEIGHTS = Path(\n", " \"tests\", \"data\", \"nwm22\", \"onehuc10_weights_retro.parquet\"\n", ")\n", "\n", "NWM_VERSION = \"nwm30\"\n", "VARIABLE_NAME = \"RAINRATE\"\n", "START_DATE = \"2008-05-23 09:00\"\n", "END_DATE = \"2008-05-23 10:00\"\n", "OVERWRITE = True\n", "CHUNK_BY = None\n", "LOCATION_ID_PREFIX = \"ngen\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Fetch and load the data." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "nwm_retro_grids_to_parquet(\n", " nwm_version=NWM_VERSION,\n", " variable_name=VARIABLE_NAME,\n", " zonal_weights_filepath=ZONAL_WEIGHTS,\n", " start_date=START_DATE,\n", " end_date=END_DATE,\n", " output_parquet_dir=OUTPUT_DIR,\n", " overwrite_output=OVERWRITE,\n", " chunk_by=CHUNK_BY,\n", " location_id_prefix=LOCATION_ID_PREFIX\n", ")" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 2 }