{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# USGS Data Loading " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Import the libraries and USGS TEEHR module." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime\n", "from pathlib import Path\n", "\n", "from teehr.loading.usgs.usgs import usgs_to_parquet" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define the input parameters." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "OUTPUT_ROOT = Path(Path().home(), \"temp\")\n", "OUTPUT_DIR = Path(OUTPUT_ROOT, \"usgs\")\n", "\n", "START_DATE = datetime(2023, 2, 20)\n", "END_DATE = datetime(2023, 3, 25)\n", "CHUNK_BY = \"month\"\n", "OVERWRITE = True\n", "\n", "SITES = [\n", " \"02449838\",\n", " \"02450825\"\n", "]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Fetch and load the data." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "usgs_to_parquet(\n", " sites=SITES,\n", " start_date=START_DATE,\n", " end_date=END_DATE,\n", " output_parquet_dir=OUTPUT_DIR,\n", " chunk_by=CHUNK_BY,\n", " overwrite_output=OVERWRITE\n", ")" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 2 }