{ "cells": [ { "cell_type": "markdown", "id": "fd8eb7de-9988-4586-a121-f907fe30e372", "metadata": {}, "source": [ "# Explore point data availability" ] }, { "cell_type": "markdown", "id": "60f9f62d", "metadata": {}, "source": [ "To launch this notebook interactively in a Jupyter notebook-like browser interface, please click the \"Launch Binder\" button below. Note that Binder may take several minutes to launch.\n", "\n", "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/hydroframe/subsettools-binder/HEAD?labpath=hf_hydrodata/point/example_explore_data.ipynb)" ] }, { "cell_type": "markdown", "id": "12d66ee0-12f8-45ce-a934-8f870e817750", "metadata": {}, "source": [ "This notebook walks through how to explore what data is available using hf_hydrodata's `get_site_variables`. Please see the full [point module](https://hf-hydrodata.readthedocs.io) documentation for information on what data is available, our data collection process, and new features we are working on! Our [Metadata Description](https://hf-hydrodata.readthedocs.io/en/latest/available_metadata.html#point-observations-metadata) page itemizes the fields that get returned from `get_point_metadata`." ] }, { "cell_type": "code", "execution_count": 1, "id": "d91fdbce-4da5-443c-8365-c9c98013dcb3", "metadata": {}, "outputs": [], "source": [ "# Import packages\n", "from hf_hydrodata import register_api_pin, get_point_data, get_point_metadata, get_site_variables" ] }, { "cell_type": "code", "execution_count": null, "id": "10768ca7-6983-40ee-9bf5-e26dc1970349", "metadata": {}, "outputs": [], "source": [ "# You need to register on https://hydrogen.princeton.edu/pin \n", "# and run the following with your registered information\n", "# before you can use the hydrodata utilities\n", "register_api_pin(\"your_email\", \"your_pin\")" ] }, { "cell_type": "markdown", "id": "fa2b70fa-fefb-44df-93b4-dfc8bbecc630", "metadata": {}, "source": [ "## Example 1: What streamflow sites are available in Colorado that were operational during Water Year 2019?" ] }, { "cell_type": "markdown", "id": "642327a3-4ecb-4ab2-b261-b5087f9e98d5", "metadata": {}, "source": [ "The `get_site_variables` function accepts any number of supported parameters. \n", "\n", "In this example, we want to know information about streamflow sites, so we will supply `variable='streamflow'`. We are specifically interested in the state of Colorado, so we will supply `state='CO'`. Finally, we only want sites that were operational during Water Year 2019. We will set `date_start='2018-10-01'` and `date_end='2019-09-30'`. " ] }, { "cell_type": "code", "execution_count": 2, "id": "255adabe-cf9e-4191-ac0a-16002bb7bdf6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of records: 691\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatevariable_nameunitsfirst_date_data_availablelast_date_data_availablerecord_countlatitudelongitudesite_query_urldate_metadata_last_updatedtz_cddoi
006614800MICHIGAN RIVER NEAR CAMERON PASS, COstream gaugeUSGSCOHourly average streamflowm3/s1986-10-012023-12-0222423540.496094-105.865012https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
106614800MICHIGAN RIVER NEAR CAMERON PASS, COstream gaugeUSGSCODaily average streamflowm3/s1973-10-012023-12-011832240.496094-105.865012https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
206620000NORTH PLATTE RIVER NEAR NORTHGATE, COstream gaugeUSGSCOHourly average streamflowm3/s1990-10-012023-12-0217784340.936639-106.339194https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
306620000NORTH PLATTE RIVER NEAR NORTHGATE, COstream gaugeUSGSCODaily average streamflowm3/s1904-06-012023-12-013978240.936639-106.339194https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
406659580SAND CREEK AT COLORADO-WYOMING STATE LINEstream gaugeUSGSCOHourly average streamflowm3/s1996-04-012020-09-0210438240.993650-105.759703https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
\n", "
" ], "text/plain": [ " site_id site_name site_type agency \\\n", "0 06614800 MICHIGAN RIVER NEAR CAMERON PASS, CO stream gauge USGS \n", "1 06614800 MICHIGAN RIVER NEAR CAMERON PASS, CO stream gauge USGS \n", "2 06620000 NORTH PLATTE RIVER NEAR NORTHGATE, CO stream gauge USGS \n", "3 06620000 NORTH PLATTE RIVER NEAR NORTHGATE, CO stream gauge USGS \n", "4 06659580 SAND CREEK AT COLORADO-WYOMING STATE LINE stream gauge USGS \n", "\n", " state variable_name units first_date_data_available \\\n", "0 CO Hourly average streamflow m3/s 1986-10-01 \n", "1 CO Daily average streamflow m3/s 1973-10-01 \n", "2 CO Hourly average streamflow m3/s 1990-10-01 \n", "3 CO Daily average streamflow m3/s 1904-06-01 \n", "4 CO Hourly average streamflow m3/s 1996-04-01 \n", "\n", " last_date_data_available record_count latitude longitude \\\n", "0 2023-12-02 224235 40.496094 -105.865012 \n", "1 2023-12-01 18322 40.496094 -105.865012 \n", "2 2023-12-02 177843 40.936639 -106.339194 \n", "3 2023-12-01 39782 40.936639 -106.339194 \n", "4 2020-09-02 104382 40.993650 -105.759703 \n", "\n", " site_query_url \\\n", "0 https://waterservices.usgs.gov/nwis/site/?form... \n", "1 https://waterservices.usgs.gov/nwis/site/?form... \n", "2 https://waterservices.usgs.gov/nwis/site/?form... \n", "3 https://waterservices.usgs.gov/nwis/site/?form... \n", "4 https://waterservices.usgs.gov/nwis/site/?form... \n", "\n", " date_metadata_last_updated tz_cd doi \n", "0 2023-05-30 MST None \n", "1 2023-05-30 MST None \n", "2 2023-05-30 MST None \n", "3 2023-05-30 MST None \n", "4 2023-05-30 MST None " ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Let's use the above input parameters.\n", "df = get_site_variables(variable=\"streamflow\", state=\"CO\", date_start=\"2018-10-01\", date_end=\"2019-09-30\")\n", "\n", "print(f'Number of records: {len(df)}') \n", "df.head(5)" ] }, { "cell_type": "markdown", "id": "7eafae10-eb71-4e40-b8a4-09df92cdd100", "metadata": {}, "source": [ "Above, we can see that 691 records were returned. Note that a site could collect data at multiple temporal resolutions (such as daily and hourly). The data availability range for each might be different, as a site could have started collecting hourly and daily data at different times. The above DataFrame will be unique for unique combinations of `site_id` and `variable_name`.\n", "\n", "The fields `first_date_data_available` and `last_date_data_available` refer to the earliest and latest dates we have available for the site. The `record_count` field reports on the total number of records over that entire time span and does not relate to the specific `date_start` and `date_end` parameters supplied." ] }, { "cell_type": "markdown", "id": "3df5d6d4-8aba-4191-b7a9-33818dc41d9f", "metadata": {}, "source": [ "Let's narrow our search down to only sites that have daily streamflow data by adding `temporal_resolution='daily'`. Let's further refine things so that we only get sites with a latitude between 40 and 40.5 degrees." ] }, { "cell_type": "code", "execution_count": 3, "id": "89ed3bf2-e6ea-4722-8ed1-d6de3920fbb8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of records: 47\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatevariable_nameunitsfirst_date_data_availablelast_date_data_availablerecord_countlatitudelongitudesite_query_urldate_metadata_last_updatedtz_cddoi
30909032990MEADOW CREEK BLW MEADOW CREEK RES NR TABERNASH...stream gaugeUSGSCODaily average streamflowm3/s2018-06-012023-10-31107340.052028-105.754167https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
31109033010MEADOW CREEK DIVERSION NEAR TABERNASH, COstream gaugeUSGSCODaily average streamflowm3/s2018-06-292023-10-31104540.050286-105.779706https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
31209040500TROUBLESOME CREEK NEAR TROUBLESOME, CO.stream gaugeUSGSCODaily average streamflowm3/s1904-10-012023-12-01931840.058664-106.305178https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
314401723105400000ANDREWS CREEK-LOCH VALE-RMNPstream gaugeUSGSCODaily average streamflowm3/s1991-09-302023-12-011158240.290000-105.666667https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
316401727105400000ANDREWS SPRING 1stream gaugeUSGSCODaily average streamflowm3/s2019-04-102023-10-09134140.290818-105.667227https://waterservices.usgs.gov/nwis/site/?form...2023-05-30MSTNone
\n", "
" ], "text/plain": [ " site_id site_name \\\n", "309 09032990 MEADOW CREEK BLW MEADOW CREEK RES NR TABERNASH... \n", "311 09033010 MEADOW CREEK DIVERSION NEAR TABERNASH, CO \n", "312 09040500 TROUBLESOME CREEK NEAR TROUBLESOME, CO. \n", "314 401723105400000 ANDREWS CREEK-LOCH VALE-RMNP \n", "316 401727105400000 ANDREWS SPRING 1 \n", "\n", " site_type agency state variable_name units \\\n", "309 stream gauge USGS CO Daily average streamflow m3/s \n", "311 stream gauge USGS CO Daily average streamflow m3/s \n", "312 stream gauge USGS CO Daily average streamflow m3/s \n", "314 stream gauge USGS CO Daily average streamflow m3/s \n", "316 stream gauge USGS CO Daily average streamflow m3/s \n", "\n", " first_date_data_available last_date_data_available record_count \\\n", "309 2018-06-01 2023-10-31 1073 \n", "311 2018-06-29 2023-10-31 1045 \n", "312 1904-10-01 2023-12-01 9318 \n", "314 1991-09-30 2023-12-01 11582 \n", "316 2019-04-10 2023-10-09 1341 \n", "\n", " latitude longitude site_query_url \\\n", "309 40.052028 -105.754167 https://waterservices.usgs.gov/nwis/site/?form... \n", "311 40.050286 -105.779706 https://waterservices.usgs.gov/nwis/site/?form... \n", "312 40.058664 -106.305178 https://waterservices.usgs.gov/nwis/site/?form... \n", "314 40.290000 -105.666667 https://waterservices.usgs.gov/nwis/site/?form... \n", "316 40.290818 -105.667227 https://waterservices.usgs.gov/nwis/site/?form... \n", "\n", " date_metadata_last_updated tz_cd doi \n", "309 2023-05-30 MST None \n", "311 2023-05-30 MST None \n", "312 2023-05-30 MST None \n", "314 2023-05-30 MST None \n", "316 2023-05-30 MST None " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = get_site_variables(variable=\"streamflow\", state=\"CO\", date_start=\"2018-10-01\", date_end=\"2019-09-30\", temporal_resolution=\"daily\",\n", " latitude_range=(40, 40.5))\n", " \n", "print(f'Number of records: {len(df)}') \n", "df.tail(5)" ] }, { "cell_type": "markdown", "id": "4cc96d7a-4021-4132-bb5b-ccdef21d807e", "metadata": {}, "source": [ "Now we 47 sites. We can extract this site list and pass it in to the `site_ids` parameter of `get_point_data` and `get_point_metadata` functions to get data for WY2019 for only these sites.\n", "\n", "Note that `get_point_data` and `get_point_metadata` require the parameters `dataset`, `variable`, `temporal_resolution` and `aggregation` to be supplied to be able to uniquely identify a single data series. For daily average streamflow, we want `dataset='usgs_nwis'`, `variable='streamflow'`, `temporal_resolution='daily'`, and `aggregation='mean'`." ] }, { "cell_type": "code", "execution_count": 4, "id": "1d5a650c-6a1a-4f0b-911b-1725a8b5ff57", "metadata": {}, "outputs": [], "source": [ "# Get list of site IDs from the above exploratory DataFrame\n", "co_streamflow_site_ids = list(df['site_id'])\n", "assert len(co_streamflow_site_ids) == len(df)" ] }, { "cell_type": "code", "execution_count": 5, "id": "b2e40dcb-cdff-475d-a3f4-6938c91cf513", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
date066148000672099006721000067249700672741006727500067301600673020006730500...093042000930450009304800093062220930625509306290401723105400000401727105400000401733105392404402114105350101
02018-09-300.0110371.245204.66950.044148NaN0.0067920.01.004650.51506...4.35825.71667.18820.0249040.0084906.25430.019244NaN0.0540530.185931
12018-10-010.0113201.126345.06570.043582NaNNaNNaN0.984840.72731...4.81105.88647.41460.0251870.0084906.53730.018961NaN0.0506570.178290
22018-10-020.0113200.452805.12230.056600NaNNaNNaN0.933900.66222...5.00916.05627.55610.0291490.0096226.90520.019244NaN0.0517890.203194
32018-10-030.0118860.430165.12230.048110NaNNaNNaN0.817870.54902...5.54686.67888.17870.0353750.0110377.69760.023772NaN0.0563170.232626
42018-10-040.0138670.407525.03740.049808NaNNaNNaN0.817870.52072...6.11287.697610.49930.0597130.02490410.64080.022357NaN0.0591470.252153
\n", "

5 rows × 48 columns

\n", "
" ], "text/plain": [ " date 06614800 06720990 06721000 06724970 06727410 06727500 \\\n", "0 2018-09-30 0.011037 1.24520 4.6695 0.044148 NaN 0.006792 \n", "1 2018-10-01 0.011320 1.12634 5.0657 0.043582 NaN NaN \n", "2 2018-10-02 0.011320 0.45280 5.1223 0.056600 NaN NaN \n", "3 2018-10-03 0.011886 0.43016 5.1223 0.048110 NaN NaN \n", "4 2018-10-04 0.013867 0.40752 5.0374 0.049808 NaN NaN \n", "\n", " 06730160 06730200 06730500 ... 09304200 09304500 09304800 09306222 \\\n", "0 0.0 1.00465 0.51506 ... 4.3582 5.7166 7.1882 0.024904 \n", "1 NaN 0.98484 0.72731 ... 4.8110 5.8864 7.4146 0.025187 \n", "2 NaN 0.93390 0.66222 ... 5.0091 6.0562 7.5561 0.029149 \n", "3 NaN 0.81787 0.54902 ... 5.5468 6.6788 8.1787 0.035375 \n", "4 NaN 0.81787 0.52072 ... 6.1128 7.6976 10.4993 0.059713 \n", "\n", " 09306255 09306290 401723105400000 401727105400000 401733105392404 \\\n", "0 0.008490 6.2543 0.019244 NaN 0.054053 \n", "1 0.008490 6.5373 0.018961 NaN 0.050657 \n", "2 0.009622 6.9052 0.019244 NaN 0.051789 \n", "3 0.011037 7.6976 0.023772 NaN 0.056317 \n", "4 0.024904 10.6408 0.022357 NaN 0.059147 \n", "\n", " 402114105350101 \n", "0 0.185931 \n", "1 0.178290 \n", "2 0.203194 \n", "3 0.232626 \n", "4 0.252153 \n", "\n", "[5 rows x 48 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Request point observations data\n", "data_df = get_point_data(dataset=\"usgs_nwis\", variable=\"streamflow\", temporal_resolution=\"daily\", aggregation=\"mean\",\n", " date_start=\"2018-09-30\", date_end=\"2019-10-01\",\n", " site_ids=co_streamflow_site_ids)\n", "\n", "# View first five records\n", "data_df.head()" ] }, { "cell_type": "code", "execution_count": 6, "id": "2e763de8-e985-4f42-985b-adfc5f353df1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatelatitudelongitudefirst_date_data_availablelast_date_data_availablerecord_count...doihuc8conus1_xconus1_yconus2_xconus2_ygagesii_drainage_areagagesii_classgagesii_site_elevationusgs_drainage_area
006614800MICHIGAN RIVER NEAR CAMERON PASS, COstream gaugeUSGSCO40.496094-105.8650121973-10-012023-12-0118322...None101800011054818148117644.0284Ref3188.01.54
106720990BIG DRY CREEK AT MOUTH NEAR FORT LUPTON, COstream gaugeUSGSCO40.068833-104.8319861991-10-012023-12-0111734...None10190003nannan15611705272.4498Non-ref1494.0107.00
206721000SOUTH PLATTE RIVER AT FORT LUPTON, CO.stream gaugeUSGSCO40.116094-104.8185831929-04-292023-12-0117668...None10190003nannan1563171513064.8200Non-ref1485.05043.00
306724970LEFT HAND CREEK AT HOVER ROAD NEAR LONGMONT, COstream gaugeUSGSCO40.134278-105.1308192014-03-052023-12-013557...None10190005nannan15401718NaNnanNaN71.60
406727410FOURMILE CREEK AT LOGAN MILL ROAD NEAR CRISMAN...stream gaugeUSGSCO40.042028-105.3649172011-04-012023-09-301125...None10190005nannannannanNaNnanNaN19.20
\n", "

5 rows × 23 columns

\n", "
" ], "text/plain": [ " site_id site_name site_type \\\n", "0 06614800 MICHIGAN RIVER NEAR CAMERON PASS, CO stream gauge \n", "1 06720990 BIG DRY CREEK AT MOUTH NEAR FORT LUPTON, CO stream gauge \n", "2 06721000 SOUTH PLATTE RIVER AT FORT LUPTON, CO. stream gauge \n", "3 06724970 LEFT HAND CREEK AT HOVER ROAD NEAR LONGMONT, CO stream gauge \n", "4 06727410 FOURMILE CREEK AT LOGAN MILL ROAD NEAR CRISMAN... stream gauge \n", "\n", " agency state latitude longitude first_date_data_available \\\n", "0 USGS CO 40.496094 -105.865012 1973-10-01 \n", "1 USGS CO 40.068833 -104.831986 1991-10-01 \n", "2 USGS CO 40.116094 -104.818583 1929-04-29 \n", "3 USGS CO 40.134278 -105.130819 2014-03-05 \n", "4 USGS CO 40.042028 -105.364917 2011-04-01 \n", "\n", " last_date_data_available record_count ... doi huc8 conus1_x \\\n", "0 2023-12-01 18322 ... None 10180001 1054 \n", "1 2023-12-01 11734 ... None 10190003 nan \n", "2 2023-12-01 17668 ... None 10190003 nan \n", "3 2023-12-01 3557 ... None 10190005 nan \n", "4 2023-09-30 1125 ... None 10190005 nan \n", "\n", " conus1_y conus2_x conus2_y gagesii_drainage_area gagesii_class \\\n", "0 818 1481 1764 4.0284 Ref \n", "1 nan 1561 1705 272.4498 Non-ref \n", "2 nan 1563 1715 13064.8200 Non-ref \n", "3 nan 1540 1718 NaN nan \n", "4 nan nan nan NaN nan \n", "\n", " gagesii_site_elevation usgs_drainage_area \n", "0 3188.0 1.54 \n", "1 1494.0 107.00 \n", "2 1485.0 5043.00 \n", "3 NaN 71.60 \n", "4 NaN 19.20 \n", "\n", "[5 rows x 23 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Request site-level attributes for these sites\n", "metadata_df = get_point_metadata(dataset=\"usgs_nwis\", variable=\"streamflow\", temporal_resolution=\"daily\", aggregation=\"mean\",\n", " date_start=\"2018-09-30\", date_end=\"2019-10-01\",\n", " site_ids=co_streamflow_site_ids)\n", "\n", "# View first five records\n", "metadata_df.head()" ] }, { "cell_type": "markdown", "id": "8c9a5afa-b5c7-4d3b-be57-e654cef3c5b0", "metadata": {}, "source": [ "This workflow shows how to quickly identify sites of interest based on location and temporal filters. The `state`, `date_start`, and `date_end` parameters can also be passed in to `get_point_data` and `get_point_metadata` directly. This `get_site_variables` offers a quick look-up for getting variable-level metadata without having to pre-specify the variable of interest (see additional example below)" ] }, { "cell_type": "markdown", "id": "4e2e53c8-c639-47af-a4e0-319b2969d6f9", "metadata": {}, "source": [ "## Example 2: What data is available within the Raritan watershed in New Jersey (HUC8='02030105')?" ] }, { "cell_type": "markdown", "id": "62ddc925-bf1b-4283-a31f-0142d17b0597", "metadata": {}, "source": [ "Please see the example notebook [Filter sites by USGS HUC boundary](https://hf-hydrodata.readthedocs.io/en/latest/point_data/examples/example_shapefile.html) for a more detailed walk-through on the following procedure. You may also supply an existing shapefile and CRS if you have one for your domain." ] }, { "cell_type": "code", "execution_count": 7, "id": "34424ca7-e210-46bb-bedf-c3d658ee5435", "metadata": {}, "outputs": [], "source": [ "# Import additional packages\n", "import requests\n", "from zipfile import ZipFile\n", "from io import BytesIO\n", "import shapefile\n", "from shapely.geometry import shape" ] }, { "cell_type": "code", "execution_count": 8, "id": "be5c0203-8a53-4551-8132-256a063cf431", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CRS: GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]\n", "Record #72: ['NJ', '02030105', 'Raritan']\n" ] } ], "source": [ "# Download and subset HUC02 boundary file from the USGS\n", "\n", "# Send request for data\n", "url = 'https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/WBD/HU2/Shape/WBD_02_HU2_Shape.zip'\n", "url_response = requests.get(url) # note this might take a minute or so to run\n", "\n", "# In this example, we will extract only the files with the HUC8 level watersheds\n", "# This code saves these files to the local directory where this notebook is being run\n", "myzipfile = ZipFile(BytesIO(url_response.content))\n", "myzipfile.extractall(members=['Shape/WBDHU8.shp', 'Shape/WBDHU8.shx', 'Shape/WBDHU8.dbf', 'Shape/WBDHU8.prj'])\n", "\n", "# Read in shapefile\n", "huc02_shp = shapefile.Reader('Shape/WBDHU8.shp')\n", "\n", "# Read in projection file\n", "with open('Shape/WBDHU8.prj') as f:\n", " usgs_huc_crs = f.readlines()[0]\n", "print(f\"CRS: {usgs_huc_crs}\")\n", "\n", "# We want to use the Raritan watershed, HUC8='02030105'. This is at index 72\n", "print(huc02_shp.shapeRecord(i=72, fields=['states', 'huc8', 'name']).record)\n", "\n", "# Extract the shape and record information for this index\n", "raritan_shape = huc02_shp.shapeRecord(i=72).shape\n", "raritan_record = huc02_shp.shapeRecord(i=72).record\n", "\n", "# Save as shapefile, to be passed in to hf_hydrodata functions below\n", "with shapefile.Writer('Shape/raritan_watershed') as w:\n", " w.fields = huc02_shp.fields[1:]\n", "\n", " w.record(raritan_record)\n", " w.shape(raritan_shape)" ] }, { "cell_type": "code", "execution_count": 9, "id": "1d644e6e-9507-4bfd-a6a5-8e3d56df25a1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CRS: GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]\n" ] } ], "source": [ "with open('Shape/WBDHU8.prj') as f:\n", " usgs_huc_crs = f.readlines()[0]\n", "print(f\"CRS: {usgs_huc_crs}\")" ] }, { "cell_type": "markdown", "id": "34c5f9f7-4157-4a36-8ae2-6223c698ebbc", "metadata": {}, "source": [ "We will use this shapefile to see all of the sites with available data within that watershed. Again, if you have your own domain shapefile and CRS you can supply that here instead with the `polygon` and `polygon_crs` parameters." ] }, { "cell_type": "code", "execution_count": 10, "id": "8fc3af2a-7e51-48eb-9da4-f246b4cdd1ca", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of records: 1013\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatevariable_nameunitsfirst_date_data_availablelast_date_data_availablerecord_countlatitudelongitudesite_query_urldate_metadata_last_updatedtz_cddoi
001396091South Br Raritan River at Rt 46 at Budd Lake NJstream gaugeUSGSNJHourly average streamflowm3/s2008-06-012014-03-305092540.859444-74.760833https://waterservices.usgs.gov/nwis/site/?form...2023-05-30ESTNone
101396190South Branch Raritan River at Four Bridges NJstream gaugeUSGSNJHourly average streamflowm3/s1999-01-202012-09-3011612740.806111-74.740556https://waterservices.usgs.gov/nwis/site/?form...2023-05-30ESTNone
201396500South Branch Raritan River near High Bridge NJstream gaugeUSGSNJHourly average streamflowm3/s1981-10-012023-12-0235371140.677778-74.879167https://waterservices.usgs.gov/nwis/site/?form...2023-05-30ESTNone
301396580Spruce Run at Glen Gardner NJstream gaugeUSGSNJHourly average streamflowm3/s1981-10-012005-08-3115386740.693333-74.939722https://waterservices.usgs.gov/nwis/site/?form...2023-05-30ESTNone
401396582Spruce Run at Main Street at Glen Gardner NJstream gaugeUSGSNJHourly average streamflowm3/s2005-10-012023-12-0215173740.691389-74.936944https://waterservices.usgs.gov/nwis/site/?form...2023-05-30ESTNone
\n", "
" ], "text/plain": [ " site_id site_name site_type \\\n", "0 01396091 South Br Raritan River at Rt 46 at Budd Lake NJ stream gauge \n", "1 01396190 South Branch Raritan River at Four Bridges NJ stream gauge \n", "2 01396500 South Branch Raritan River near High Bridge NJ stream gauge \n", "3 01396580 Spruce Run at Glen Gardner NJ stream gauge \n", "4 01396582 Spruce Run at Main Street at Glen Gardner NJ stream gauge \n", "\n", " agency state variable_name units first_date_data_available \\\n", "0 USGS NJ Hourly average streamflow m3/s 2008-06-01 \n", "1 USGS NJ Hourly average streamflow m3/s 1999-01-20 \n", "2 USGS NJ Hourly average streamflow m3/s 1981-10-01 \n", "3 USGS NJ Hourly average streamflow m3/s 1981-10-01 \n", "4 USGS NJ Hourly average streamflow m3/s 2005-10-01 \n", "\n", " last_date_data_available record_count latitude longitude \\\n", "0 2014-03-30 50925 40.859444 -74.760833 \n", "1 2012-09-30 116127 40.806111 -74.740556 \n", "2 2023-12-02 353711 40.677778 -74.879167 \n", "3 2005-08-31 153867 40.693333 -74.939722 \n", "4 2023-12-02 151737 40.691389 -74.936944 \n", "\n", " site_query_url \\\n", "0 https://waterservices.usgs.gov/nwis/site/?form... \n", "1 https://waterservices.usgs.gov/nwis/site/?form... \n", "2 https://waterservices.usgs.gov/nwis/site/?form... \n", "3 https://waterservices.usgs.gov/nwis/site/?form... \n", "4 https://waterservices.usgs.gov/nwis/site/?form... \n", "\n", " date_metadata_last_updated tz_cd doi \n", "0 2023-05-30 EST None \n", "1 2023-05-30 EST None \n", "2 2023-05-30 EST None \n", "3 2023-05-30 EST None \n", "4 2023-05-30 EST None " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = get_site_variables(polygon=\"Shape/raritan_watershed.shp\", polygon_crs=usgs_huc_crs)\n", "\n", "print(f\"Number of records: {len(df)}\")\n", "df.head(5)" ] }, { "cell_type": "markdown", "id": "c3c10491-a184-4405-a026-77a64ea1718b", "metadata": {}, "source": [ "Let's see what types of sites are included here." ] }, { "cell_type": "code", "execution_count": 11, "id": "5cbd6f24-8bff-4fad-ae31-d22b4c8c35b2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Site types: ['stream gauge' 'groundwater well']\n" ] } ], "source": [ "print(f\"Site types: {df['site_type'].unique()}\")" ] }, { "cell_type": "markdown", "id": "eaa650f3-7dea-4b0c-8ee3-7d8c8350c262", "metadata": {}, "source": [ "Let's look at the groundwater wells to see how many data records each well has." ] }, { "cell_type": "code", "execution_count": 12, "id": "6420b9e4-9b6d-486e-8817-83b4f2d1439d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatevariable_nameunitsfirst_date_data_availablelast_date_data_availablerecord_countlatitudelongitudesite_query_urldate_metadata_last_updatedtz_cddoi
63402109074301301230291-- Forsgate 1 Obsgroundwater wellUSGSNJHourly average water table depthm2007-10-012023-08-1013859040.352608-74.503209https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
64402109074301302230292-- Forsgate 2 Obsgroundwater wellUSGSNJHourly average water table depthm2007-10-012023-08-1013822140.352608-74.502931https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
65402138074435801210365-- Carter Rd Obsgroundwater wellUSGSNJHourly average water table depthm2007-10-012023-09-2914008740.360662-74.732383https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
66402143074185201230104-- Morrell 1 Obsgroundwater wellUSGSNJHourly average water table depthm2007-10-012023-12-0214065640.362053-74.313203https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
67402151074525301190251-- Corsalo Rd 1 Obsgroundwater wellUSGSNJHourly average water table depthm2007-10-012023-12-0214107440.364273-74.880999https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
...................................................
967405325074363901271651-- 1963groundwater wellUSGSNJWater table depthm1963-07-171989-09-22440.890377-74.610437https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
968405330074363801271123-- Kenvil Newcrete 1 Obsgroundwater wellUSGSNJWater table depthm1989-02-271991-01-012040.891766-74.610160https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
969405330074363802271124-- Kenvil Newcrete 2 Obsgroundwater wellUSGSNJWater table depthm1989-03-211997-10-082040.891766-74.610160https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
970405330074363803271183-- Kenvil Newcrete 7 Obsgroundwater wellUSGSNJWater table depthm1989-10-051990-09-301340.891766-74.610160https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
971405355074380801271787-- Stierli Way 1Agroundwater wellUSGSNJWater table depthm1989-09-081989-09-08140.898710-74.635160https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
\n", "

909 rows × 16 columns

\n", "
" ], "text/plain": [ " site_id site_name site_type agency \\\n", "63 402109074301301 230291-- Forsgate 1 Obs groundwater well USGS \n", "64 402109074301302 230292-- Forsgate 2 Obs groundwater well USGS \n", "65 402138074435801 210365-- Carter Rd Obs groundwater well USGS \n", "66 402143074185201 230104-- Morrell 1 Obs groundwater well USGS \n", "67 402151074525301 190251-- Corsalo Rd 1 Obs groundwater well USGS \n", ".. ... ... ... ... \n", "967 405325074363901 271651-- 1963 groundwater well USGS \n", "968 405330074363801 271123-- Kenvil Newcrete 1 Obs groundwater well USGS \n", "969 405330074363802 271124-- Kenvil Newcrete 2 Obs groundwater well USGS \n", "970 405330074363803 271183-- Kenvil Newcrete 7 Obs groundwater well USGS \n", "971 405355074380801 271787-- Stierli Way 1A groundwater well USGS \n", "\n", " state variable_name units first_date_data_available \\\n", "63 NJ Hourly average water table depth m 2007-10-01 \n", "64 NJ Hourly average water table depth m 2007-10-01 \n", "65 NJ Hourly average water table depth m 2007-10-01 \n", "66 NJ Hourly average water table depth m 2007-10-01 \n", "67 NJ Hourly average water table depth m 2007-10-01 \n", ".. ... ... ... ... \n", "967 NJ Water table depth m 1963-07-17 \n", "968 NJ Water table depth m 1989-02-27 \n", "969 NJ Water table depth m 1989-03-21 \n", "970 NJ Water table depth m 1989-10-05 \n", "971 NJ Water table depth m 1989-09-08 \n", "\n", " last_date_data_available record_count latitude longitude \\\n", "63 2023-08-10 138590 40.352608 -74.503209 \n", "64 2023-08-10 138221 40.352608 -74.502931 \n", "65 2023-09-29 140087 40.360662 -74.732383 \n", "66 2023-12-02 140656 40.362053 -74.313203 \n", "67 2023-12-02 141074 40.364273 -74.880999 \n", ".. ... ... ... ... \n", "967 1989-09-22 4 40.890377 -74.610437 \n", "968 1991-01-01 20 40.891766 -74.610160 \n", "969 1997-10-08 20 40.891766 -74.610160 \n", "970 1990-09-30 13 40.891766 -74.610160 \n", "971 1989-09-08 1 40.898710 -74.635160 \n", "\n", " site_query_url \\\n", "63 https://waterservices.usgs.gov/nwis/site/?form... \n", "64 https://waterservices.usgs.gov/nwis/site/?form... \n", "65 https://waterservices.usgs.gov/nwis/site/?form... \n", "66 https://waterservices.usgs.gov/nwis/site/?form... \n", "67 https://waterservices.usgs.gov/nwis/site/?form... \n", ".. ... \n", "967 https://waterservices.usgs.gov/nwis/site/?form... \n", "968 https://waterservices.usgs.gov/nwis/site/?form... \n", "969 https://waterservices.usgs.gov/nwis/site/?form... \n", "970 https://waterservices.usgs.gov/nwis/site/?form... \n", "971 https://waterservices.usgs.gov/nwis/site/?form... \n", "\n", " date_metadata_last_updated tz_cd doi \n", "63 2023-03-08 EST None \n", "64 2023-03-08 EST None \n", "65 2023-03-08 EST None \n", "66 2023-03-08 EST None \n", "67 2023-03-08 EST None \n", ".. ... ... ... \n", "967 2023-03-08 EST None \n", "968 2023-03-08 EST None \n", "969 2023-03-08 EST None \n", "970 2023-03-08 EST None \n", "971 2023-03-08 EST None \n", "\n", "[909 rows x 16 columns]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[df['site_type'] == 'groundwater well']" ] }, { "cell_type": "markdown", "id": "364abcf3-4b8e-484c-90d9-cb44abdadad0", "metadata": {}, "source": [ "It looks like some of these have a lot of records, and some have only a couple of sparse measurements. Let's see what sites have regular, daily water table depth observations." ] }, { "cell_type": "code", "execution_count": 13, "id": "5baba579-c97d-4773-acd0-37b930519cf3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatevariable_nameunitsfirst_date_data_availablelast_date_data_availablerecord_countlatitudelongitudesite_query_urldate_metadata_last_updatedtz_cddoi
78401518074223001250216-- PW 1groundwater wellUSGSNJDaily average water table depthm1972-10-061975-07-3169740.255111-74.374593https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
79401819074351601210395-- MW-2 Obsgroundwater wellUSGSNJDaily average water table depthm1993-09-181994-08-2834540.301775-74.592100https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
80402015074275701230228-- Forsgate 3 Obsgroundwater wellUSGSNJDaily average water table depthm1972-11-011975-02-2177240.337608-74.465430https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
81402015074275702230229-- Forsgate 4 Obsgroundwater wellUSGSNJDaily average water table depthm1972-11-012005-07-1667840.337608-74.465430https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
82402023074391901210358-- Princeton 1-Brick Rd Obsgroundwater wellUSGSNJDaily average water table depthm1989-06-281990-10-2146040.339829-74.654880https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
83402032074392501210359-- Princeton 2-Chill Pl Obsgroundwater wellUSGSNJDaily average water table depthm1989-11-181992-02-1678440.342329-74.656547https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
84402058074355901230796-- Test 5 Obsgroundwater wellUSGSNJDaily average water table depthm1986-03-141992-02-20217040.349552-74.599323https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
85402058074355902230800-- Test 9 Obsgroundwater wellUSGSNJDaily average water table depthm1986-03-141992-02-20215240.349552-74.599323https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
86402109074301301230291-- Forsgate 1 Obsgroundwater wellUSGSNJDaily average water table depthm1973-02-072023-08-09727840.352608-74.503209https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
87402109074301302230292-- Forsgate 2 Obsgroundwater wellUSGSNJDaily average water table depthm1972-12-062023-08-09743540.352608-74.502931https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
88402131074461201210088-- Honey Br 10 Obsgroundwater wellUSGSNJDaily average water table depthm1972-10-011995-03-05403740.358718-74.769329https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
89402138074435801210365-- Carter Rd Obsgroundwater wellUSGSNJDaily average water table depthm1987-02-252023-09-281313440.360662-74.732383https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
90402143074185201230104-- Morrell 1 Obsgroundwater wellUSGSNJDaily average water table depthm1985-01-242023-12-021393040.362053-74.313203https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
91402151074525301190251-- Corsalo Rd 1 Obsgroundwater wellUSGSNJDaily average water table depthm1989-06-282023-12-021229940.364273-74.880999https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
92402208074145201250272-- Marlboro 1 Obsgroundwater wellUSGSNJDaily average water table depthm1973-01-222023-09-101684240.368998-74.247367https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
93402208074505801210705-- Gomez Tract Obsgroundwater wellUSGSNJDaily average water table depthm2007-12-052012-09-29169040.368889-74.849444https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
94402450074181801230182-- Domgroundwater wellUSGSNJDaily average water table depthm1972-12-041975-08-1198140.413718-74.304869https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
95402458074200401230184-- Runyon A4groundwater wellUSGSNJDaily average water table depthm1972-12-041975-03-2552940.416218-74.334037https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
96402510074411601350028-- Sevengroundwater wellUSGSNJDaily average water table depthm1986-12-251989-09-1988840.419550-74.687382https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
97402512074414301350139-- MW109groundwater wellUSGSNJDaily average water table depthm2003-06-182023-09-28718340.420105-74.694882https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
98402525074195401230189-- Runyon R50groundwater wellUSGSNJDaily average water table depthm1972-12-041975-07-2285140.423718-74.331259https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
99402536074201801230194-- Runyon 1 Obsgroundwater wellUSGSNJDaily average water table depthm1972-11-021975-08-1275140.426774-74.337926https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
100402553074203301230343-- Sun Biscuit 5groundwater wellUSGSNJDaily average water table depthm1972-12-041975-08-1292140.431496-74.342093https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
101402553074271701230070-- Fischer Obsgroundwater wellUSGSNJDaily average water table depthm1972-12-062023-12-021490840.432050-74.454874https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
102402555074213301230433-- So River 4groundwater wellUSGSNJDaily average water table depthm1972-11-291973-03-1210440.432051-74.358760https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
103402558074201301230344-- Sayreville 2 Obsgroundwater wellUSGSNJDaily average water table depthm1972-12-041975-08-1288540.432884-74.336537https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
104402633074220001230439-- South River 2 Obsgroundwater wellUSGSNJDaily average water table depthm1973-01-241975-08-1252940.442606-74.366260https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
105402704074213901231058-- Hess Bros #1groundwater wellUSGSNJDaily average water table depthm1987-03-181988-12-2757340.451217-74.360427https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
106402743074221601231056-- Monitoring #3groundwater wellUSGSNJDaily average water table depthm1987-03-281987-11-226240.462050-74.370705https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
107402831074212001231077-- Jcp&L-Saygroundwater wellUSGSNJDaily average water table depthm1987-03-261988-07-1144240.475383-74.355149https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
108403119074290301231165-- Golf 13 Obsgroundwater wellUSGSNJDaily average water table depthm1992-05-082002-01-27267340.518993-74.469597https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
109403135074274401231330-- MW-12Agroundwater wellUSGSNJDaily average water table depthm1998-12-052002-01-27113140.526493-74.461819https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
110403135074274402231331-- MW-12Bgroundwater wellUSGSNJDaily average water table depthm1998-12-052002-01-27114040.526493-74.461819https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
111403135074274403231332-- MW-12Cgroundwater wellUSGSNJDaily average water table depthm1998-12-052002-01-27105340.526493-74.461819https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
112403200074420601350138-- MW110groundwater wellUSGSNJDaily average water table depthm2003-06-182023-09-28724640.533250-74.701806https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
113403455074514801190276-- Environmental Ctr 1 Obsgroundwater wellUSGSNJDaily average water table depthm1992-05-202023-12-021141640.577325-74.860443https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
114403517074452501190270-- Readington 11 Obsgroundwater wellUSGSNJDaily average water table depthm1990-04-252023-12-021224740.588158-74.756551https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
115404014074585401190495-- NJWSA TW-Bgroundwater wellUSGSNJDaily average water table depthm2006-10-142023-09-14617440.670444-74.981778https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
116404452074493101271302-- Jenkinson Farm 1 Obsgroundwater wellUSGSNJDaily average water table depthm1989-10-061991-01-3148340.747878-74.824888https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
117404705074463801271085-- TW Obsgroundwater wellUSGSNJDaily average water table depthm1988-04-021991-02-0791940.784822-74.776831https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
118404712074454701271303-- Drew University Farm Obsgroundwater wellUSGSNJDaily average water table depthm1990-09-142000-07-26357840.786766-74.762664https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
119404809074415501271126-- Black River 4 Obsgroundwater wellUSGSNJDaily average water table depthm1989-03-221991-01-3159240.802600-74.698217https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
120404809074415502271164-- Black River 5 Obsgroundwater wellUSGSNJDaily average water table depthm1989-10-061991-01-2241640.802600-74.698217https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
121404934074400501271190-- Black River 10 Obsgroundwater wellUSGSNJDaily average water table depthm1992-05-212023-12-021146240.817877-74.680995https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
122404954074412201271084-- Preliminary TW 2 Obsgroundwater wellUSGSNJDaily average water table depthm1988-04-021990-03-0169740.831766-74.689051https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
123405005074410101271083-- Test 1 Obsgroundwater wellUSGSNJDaily average water table depthm1988-04-021990-05-2378240.834822-74.683217https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
124405047074392901271597-- Kennedy School MWgroundwater wellUSGSNJDaily average water table depthm1990-09-271990-12-238840.846488-74.657661https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
125405330074363801271123-- Kenvil Newcrete 1 Obsgroundwater wellUSGSNJDaily average water table depthm1989-03-231991-02-0757440.891766-74.610160https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
126405330074363803271183-- Kenvil Newcrete 7 Obsgroundwater wellUSGSNJDaily average water table depthm1989-10-061990-09-3035940.891766-74.610160https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
\n", "
" ], "text/plain": [ " site_id site_name site_type \\\n", "78 401518074223001 250216-- PW 1 groundwater well \n", "79 401819074351601 210395-- MW-2 Obs groundwater well \n", "80 402015074275701 230228-- Forsgate 3 Obs groundwater well \n", "81 402015074275702 230229-- Forsgate 4 Obs groundwater well \n", "82 402023074391901 210358-- Princeton 1-Brick Rd Obs groundwater well \n", "83 402032074392501 210359-- Princeton 2-Chill Pl Obs groundwater well \n", "84 402058074355901 230796-- Test 5 Obs groundwater well \n", "85 402058074355902 230800-- Test 9 Obs groundwater well \n", "86 402109074301301 230291-- Forsgate 1 Obs groundwater well \n", "87 402109074301302 230292-- Forsgate 2 Obs groundwater well \n", "88 402131074461201 210088-- Honey Br 10 Obs groundwater well \n", "89 402138074435801 210365-- Carter Rd Obs groundwater well \n", "90 402143074185201 230104-- Morrell 1 Obs groundwater well \n", "91 402151074525301 190251-- Corsalo Rd 1 Obs groundwater well \n", "92 402208074145201 250272-- Marlboro 1 Obs groundwater well \n", "93 402208074505801 210705-- Gomez Tract Obs groundwater well \n", "94 402450074181801 230182-- Dom groundwater well \n", "95 402458074200401 230184-- Runyon A4 groundwater well \n", "96 402510074411601 350028-- Seven groundwater well \n", "97 402512074414301 350139-- MW109 groundwater well \n", "98 402525074195401 230189-- Runyon R50 groundwater well \n", "99 402536074201801 230194-- Runyon 1 Obs groundwater well \n", "100 402553074203301 230343-- Sun Biscuit 5 groundwater well \n", "101 402553074271701 230070-- Fischer Obs groundwater well \n", "102 402555074213301 230433-- So River 4 groundwater well \n", "103 402558074201301 230344-- Sayreville 2 Obs groundwater well \n", "104 402633074220001 230439-- South River 2 Obs groundwater well \n", "105 402704074213901 231058-- Hess Bros #1 groundwater well \n", "106 402743074221601 231056-- Monitoring #3 groundwater well \n", "107 402831074212001 231077-- Jcp&L-Say groundwater well \n", "108 403119074290301 231165-- Golf 13 Obs groundwater well \n", "109 403135074274401 231330-- MW-12A groundwater well \n", "110 403135074274402 231331-- MW-12B groundwater well \n", "111 403135074274403 231332-- MW-12C groundwater well \n", "112 403200074420601 350138-- MW110 groundwater well \n", "113 403455074514801 190276-- Environmental Ctr 1 Obs groundwater well \n", "114 403517074452501 190270-- Readington 11 Obs groundwater well \n", "115 404014074585401 190495-- NJWSA TW-B groundwater well \n", "116 404452074493101 271302-- Jenkinson Farm 1 Obs groundwater well \n", "117 404705074463801 271085-- TW Obs groundwater well \n", "118 404712074454701 271303-- Drew University Farm Obs groundwater well \n", "119 404809074415501 271126-- Black River 4 Obs groundwater well \n", "120 404809074415502 271164-- Black River 5 Obs groundwater well \n", "121 404934074400501 271190-- Black River 10 Obs groundwater well \n", "122 404954074412201 271084-- Preliminary TW 2 Obs groundwater well \n", "123 405005074410101 271083-- Test 1 Obs groundwater well \n", "124 405047074392901 271597-- Kennedy School MW groundwater well \n", "125 405330074363801 271123-- Kenvil Newcrete 1 Obs groundwater well \n", "126 405330074363803 271183-- Kenvil Newcrete 7 Obs groundwater well \n", "\n", " agency state variable_name units \\\n", "78 USGS NJ Daily average water table depth m \n", "79 USGS NJ Daily average water table depth m \n", "80 USGS NJ Daily average water table depth m \n", "81 USGS NJ Daily average water table depth m \n", "82 USGS NJ Daily average water table depth m \n", "83 USGS NJ Daily average water table depth m \n", "84 USGS NJ Daily average water table depth m \n", "85 USGS NJ Daily average water table depth m \n", "86 USGS NJ Daily average water table depth m \n", "87 USGS NJ Daily average water table depth m \n", "88 USGS NJ Daily average water table depth m \n", "89 USGS NJ Daily average water table depth m \n", "90 USGS NJ Daily average water table depth m \n", "91 USGS NJ Daily average water table depth m \n", "92 USGS NJ Daily average water table depth m \n", "93 USGS NJ Daily average water table depth m \n", "94 USGS NJ Daily average water table depth m \n", "95 USGS NJ Daily average water table depth m \n", "96 USGS NJ Daily average water table depth m \n", "97 USGS NJ Daily average water table depth m \n", "98 USGS NJ Daily average water table depth m \n", "99 USGS NJ Daily average water table depth m \n", "100 USGS NJ Daily average water table depth m \n", "101 USGS NJ Daily average water table depth m \n", "102 USGS NJ Daily average water table depth m \n", "103 USGS NJ Daily average water table depth m \n", "104 USGS NJ Daily average water table depth m \n", "105 USGS NJ Daily average water table depth m \n", "106 USGS NJ Daily average water table depth m \n", "107 USGS NJ Daily average water table depth m \n", "108 USGS NJ Daily average water table depth m \n", "109 USGS NJ Daily average water table depth m \n", "110 USGS NJ Daily average water table depth m \n", "111 USGS NJ Daily average water table depth m \n", "112 USGS NJ Daily average water table depth m \n", "113 USGS NJ Daily average water table depth m \n", "114 USGS NJ Daily average water table depth m \n", "115 USGS NJ Daily average water table depth m \n", "116 USGS NJ Daily average water table depth m \n", "117 USGS NJ Daily average water table depth m \n", "118 USGS NJ Daily average water table depth m \n", "119 USGS NJ Daily average water table depth m \n", "120 USGS NJ Daily average water table depth m \n", "121 USGS NJ Daily average water table depth m \n", "122 USGS NJ Daily average water table depth m \n", "123 USGS NJ Daily average water table depth m \n", "124 USGS NJ Daily average water table depth m \n", "125 USGS NJ Daily average water table depth m \n", "126 USGS NJ Daily average water table depth m \n", "\n", " first_date_data_available last_date_data_available record_count \\\n", "78 1972-10-06 1975-07-31 697 \n", "79 1993-09-18 1994-08-28 345 \n", "80 1972-11-01 1975-02-21 772 \n", "81 1972-11-01 2005-07-16 678 \n", "82 1989-06-28 1990-10-21 460 \n", "83 1989-11-18 1992-02-16 784 \n", "84 1986-03-14 1992-02-20 2170 \n", "85 1986-03-14 1992-02-20 2152 \n", "86 1973-02-07 2023-08-09 7278 \n", "87 1972-12-06 2023-08-09 7435 \n", "88 1972-10-01 1995-03-05 4037 \n", "89 1987-02-25 2023-09-28 13134 \n", "90 1985-01-24 2023-12-02 13930 \n", "91 1989-06-28 2023-12-02 12299 \n", "92 1973-01-22 2023-09-10 16842 \n", "93 2007-12-05 2012-09-29 1690 \n", "94 1972-12-04 1975-08-11 981 \n", "95 1972-12-04 1975-03-25 529 \n", "96 1986-12-25 1989-09-19 888 \n", "97 2003-06-18 2023-09-28 7183 \n", "98 1972-12-04 1975-07-22 851 \n", "99 1972-11-02 1975-08-12 751 \n", "100 1972-12-04 1975-08-12 921 \n", "101 1972-12-06 2023-12-02 14908 \n", "102 1972-11-29 1973-03-12 104 \n", "103 1972-12-04 1975-08-12 885 \n", "104 1973-01-24 1975-08-12 529 \n", "105 1987-03-18 1988-12-27 573 \n", "106 1987-03-28 1987-11-22 62 \n", "107 1987-03-26 1988-07-11 442 \n", "108 1992-05-08 2002-01-27 2673 \n", "109 1998-12-05 2002-01-27 1131 \n", "110 1998-12-05 2002-01-27 1140 \n", "111 1998-12-05 2002-01-27 1053 \n", "112 2003-06-18 2023-09-28 7246 \n", "113 1992-05-20 2023-12-02 11416 \n", "114 1990-04-25 2023-12-02 12247 \n", "115 2006-10-14 2023-09-14 6174 \n", "116 1989-10-06 1991-01-31 483 \n", "117 1988-04-02 1991-02-07 919 \n", "118 1990-09-14 2000-07-26 3578 \n", "119 1989-03-22 1991-01-31 592 \n", "120 1989-10-06 1991-01-22 416 \n", "121 1992-05-21 2023-12-02 11462 \n", "122 1988-04-02 1990-03-01 697 \n", "123 1988-04-02 1990-05-23 782 \n", "124 1990-09-27 1990-12-23 88 \n", "125 1989-03-23 1991-02-07 574 \n", "126 1989-10-06 1990-09-30 359 \n", "\n", " latitude longitude site_query_url \\\n", "78 40.255111 -74.374593 https://waterservices.usgs.gov/nwis/site/?form... \n", "79 40.301775 -74.592100 https://waterservices.usgs.gov/nwis/site/?form... \n", "80 40.337608 -74.465430 https://waterservices.usgs.gov/nwis/site/?form... \n", "81 40.337608 -74.465430 https://waterservices.usgs.gov/nwis/site/?form... \n", "82 40.339829 -74.654880 https://waterservices.usgs.gov/nwis/site/?form... \n", "83 40.342329 -74.656547 https://waterservices.usgs.gov/nwis/site/?form... \n", "84 40.349552 -74.599323 https://waterservices.usgs.gov/nwis/site/?form... \n", "85 40.349552 -74.599323 https://waterservices.usgs.gov/nwis/site/?form... \n", "86 40.352608 -74.503209 https://waterservices.usgs.gov/nwis/site/?form... \n", "87 40.352608 -74.502931 https://waterservices.usgs.gov/nwis/site/?form... \n", "88 40.358718 -74.769329 https://waterservices.usgs.gov/nwis/site/?form... \n", "89 40.360662 -74.732383 https://waterservices.usgs.gov/nwis/site/?form... \n", "90 40.362053 -74.313203 https://waterservices.usgs.gov/nwis/site/?form... \n", "91 40.364273 -74.880999 https://waterservices.usgs.gov/nwis/site/?form... \n", "92 40.368998 -74.247367 https://waterservices.usgs.gov/nwis/site/?form... \n", "93 40.368889 -74.849444 https://waterservices.usgs.gov/nwis/site/?form... \n", "94 40.413718 -74.304869 https://waterservices.usgs.gov/nwis/site/?form... \n", "95 40.416218 -74.334037 https://waterservices.usgs.gov/nwis/site/?form... \n", "96 40.419550 -74.687382 https://waterservices.usgs.gov/nwis/site/?form... \n", "97 40.420105 -74.694882 https://waterservices.usgs.gov/nwis/site/?form... \n", "98 40.423718 -74.331259 https://waterservices.usgs.gov/nwis/site/?form... \n", "99 40.426774 -74.337926 https://waterservices.usgs.gov/nwis/site/?form... \n", "100 40.431496 -74.342093 https://waterservices.usgs.gov/nwis/site/?form... \n", "101 40.432050 -74.454874 https://waterservices.usgs.gov/nwis/site/?form... \n", "102 40.432051 -74.358760 https://waterservices.usgs.gov/nwis/site/?form... \n", "103 40.432884 -74.336537 https://waterservices.usgs.gov/nwis/site/?form... \n", "104 40.442606 -74.366260 https://waterservices.usgs.gov/nwis/site/?form... \n", "105 40.451217 -74.360427 https://waterservices.usgs.gov/nwis/site/?form... \n", "106 40.462050 -74.370705 https://waterservices.usgs.gov/nwis/site/?form... \n", "107 40.475383 -74.355149 https://waterservices.usgs.gov/nwis/site/?form... \n", "108 40.518993 -74.469597 https://waterservices.usgs.gov/nwis/site/?form... \n", "109 40.526493 -74.461819 https://waterservices.usgs.gov/nwis/site/?form... \n", "110 40.526493 -74.461819 https://waterservices.usgs.gov/nwis/site/?form... \n", "111 40.526493 -74.461819 https://waterservices.usgs.gov/nwis/site/?form... \n", "112 40.533250 -74.701806 https://waterservices.usgs.gov/nwis/site/?form... \n", "113 40.577325 -74.860443 https://waterservices.usgs.gov/nwis/site/?form... \n", "114 40.588158 -74.756551 https://waterservices.usgs.gov/nwis/site/?form... \n", "115 40.670444 -74.981778 https://waterservices.usgs.gov/nwis/site/?form... \n", "116 40.747878 -74.824888 https://waterservices.usgs.gov/nwis/site/?form... \n", "117 40.784822 -74.776831 https://waterservices.usgs.gov/nwis/site/?form... \n", "118 40.786766 -74.762664 https://waterservices.usgs.gov/nwis/site/?form... \n", "119 40.802600 -74.698217 https://waterservices.usgs.gov/nwis/site/?form... \n", "120 40.802600 -74.698217 https://waterservices.usgs.gov/nwis/site/?form... \n", "121 40.817877 -74.680995 https://waterservices.usgs.gov/nwis/site/?form... \n", "122 40.831766 -74.689051 https://waterservices.usgs.gov/nwis/site/?form... \n", "123 40.834822 -74.683217 https://waterservices.usgs.gov/nwis/site/?form... \n", "124 40.846488 -74.657661 https://waterservices.usgs.gov/nwis/site/?form... \n", "125 40.891766 -74.610160 https://waterservices.usgs.gov/nwis/site/?form... \n", "126 40.891766 -74.610160 https://waterservices.usgs.gov/nwis/site/?form... \n", "\n", " date_metadata_last_updated tz_cd doi \n", "78 2023-03-08 EST None \n", "79 2023-03-08 EST None \n", "80 2023-03-08 EST None \n", "81 2023-03-08 EST None \n", "82 2023-03-08 EST None \n", "83 2023-03-08 EST None \n", "84 2023-03-08 EST None \n", "85 2023-03-08 EST None \n", "86 2023-03-08 EST None \n", "87 2023-03-08 EST None \n", "88 2023-03-08 EST None \n", "89 2023-03-08 EST None \n", "90 2023-03-08 EST None \n", "91 2023-03-08 EST None \n", "92 2023-03-08 EST None \n", "93 2023-03-08 EST None \n", "94 2023-03-08 EST None \n", "95 2023-03-08 EST None \n", "96 2023-03-08 EST None \n", "97 2023-03-08 EST None \n", "98 2023-03-08 EST None \n", "99 2023-03-08 EST None \n", "100 2023-03-08 EST None \n", "101 2023-03-08 EST None \n", "102 2023-03-08 EST None \n", "103 2023-03-08 EST None \n", "104 2023-03-08 EST None \n", "105 2023-03-08 EST None \n", "106 2023-03-08 EST None \n", "107 2023-03-08 EST None \n", "108 2023-03-08 EST None \n", "109 2023-03-08 EST None \n", "110 2023-03-08 EST None \n", "111 2023-03-08 EST None \n", "112 2023-03-08 EST None \n", "113 2023-03-08 EST None \n", "114 2023-03-08 EST None \n", "115 2023-03-08 EST None \n", "116 2023-03-08 EST None \n", "117 2023-03-08 EST None \n", "118 2023-03-08 EST None \n", "119 2023-03-08 EST None \n", "120 2023-03-08 EST None \n", "121 2023-03-08 EST None \n", "122 2023-03-08 EST None \n", "123 2023-03-08 EST None \n", "124 2023-03-08 EST None \n", "125 2023-03-08 EST None \n", "126 2023-03-08 EST None " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[(df['site_type'] == 'groundwater well') & (df['variable_name'] == 'Daily average water table depth')]" ] }, { "cell_type": "markdown", "id": "d526a95e-29dc-467f-89c6-8130c9334ed3", "metadata": {}, "source": [ "This looks good, but several of these sites only have data through the 1980s or 1990s. Let's say we only want to include sites that have data past at least 2000. We can specify `date_start='2000-01-01'` to make sure we capture only sites that are operational after that date. Let's formalize this query more and also add `variable='water_table_depth'`, `temporal_resolution='daily'` to the `get_site_variables` query." ] }, { "cell_type": "code", "execution_count": 14, "id": "fcdc90d1-6c81-40f3-8c97-a974a405027a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of records: 20\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatevariable_nameunitsfirst_date_data_availablelast_date_data_availablerecord_countlatitudelongitudesite_query_urldate_metadata_last_updatedtz_cddoi
0402015074275702230229-- Forsgate 4 Obsgroundwater wellUSGSNJDaily average water table depthm1972-11-012005-07-1667840.337608-74.465430https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
1402109074301301230291-- Forsgate 1 Obsgroundwater wellUSGSNJDaily average water table depthm1973-02-072023-08-09727840.352608-74.503209https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
2402109074301302230292-- Forsgate 2 Obsgroundwater wellUSGSNJDaily average water table depthm1972-12-062023-08-09743540.352608-74.502931https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
3402138074435801210365-- Carter Rd Obsgroundwater wellUSGSNJDaily average water table depthm1987-02-252023-09-281313440.360662-74.732383https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
4402143074185201230104-- Morrell 1 Obsgroundwater wellUSGSNJDaily average water table depthm1985-01-242023-12-021393040.362053-74.313203https://waterservices.usgs.gov/nwis/site/?form...2023-03-08ESTNone
\n", "
" ], "text/plain": [ " site_id site_name site_type agency state \\\n", "0 402015074275702 230229-- Forsgate 4 Obs groundwater well USGS NJ \n", "1 402109074301301 230291-- Forsgate 1 Obs groundwater well USGS NJ \n", "2 402109074301302 230292-- Forsgate 2 Obs groundwater well USGS NJ \n", "3 402138074435801 210365-- Carter Rd Obs groundwater well USGS NJ \n", "4 402143074185201 230104-- Morrell 1 Obs groundwater well USGS NJ \n", "\n", " variable_name units first_date_data_available \\\n", "0 Daily average water table depth m 1972-11-01 \n", "1 Daily average water table depth m 1973-02-07 \n", "2 Daily average water table depth m 1972-12-06 \n", "3 Daily average water table depth m 1987-02-25 \n", "4 Daily average water table depth m 1985-01-24 \n", "\n", " last_date_data_available record_count latitude longitude \\\n", "0 2005-07-16 678 40.337608 -74.465430 \n", "1 2023-08-09 7278 40.352608 -74.503209 \n", "2 2023-08-09 7435 40.352608 -74.502931 \n", "3 2023-09-28 13134 40.360662 -74.732383 \n", "4 2023-12-02 13930 40.362053 -74.313203 \n", "\n", " site_query_url \\\n", "0 https://waterservices.usgs.gov/nwis/site/?form... \n", "1 https://waterservices.usgs.gov/nwis/site/?form... \n", "2 https://waterservices.usgs.gov/nwis/site/?form... \n", "3 https://waterservices.usgs.gov/nwis/site/?form... \n", "4 https://waterservices.usgs.gov/nwis/site/?form... \n", "\n", " date_metadata_last_updated tz_cd doi \n", "0 2023-03-08 EST None \n", "1 2023-03-08 EST None \n", "2 2023-03-08 EST None \n", "3 2023-03-08 EST None \n", "4 2023-03-08 EST None " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = get_site_variables(polygon=\"Shape/raritan_watershed.shp\", polygon_crs=usgs_huc_crs,\n", " variable=\"water_table_depth\", temporal_resolution=\"daily\", date_start=\"2000-01-01\")\n", "\n", "print(f\"Number of records: {len(df)}\")\n", "df.head(5)" ] }, { "cell_type": "markdown", "id": "f64e5134-62cb-458a-8ede-eb9c60b63feb", "metadata": {}, "source": [ "Great! It looks like we have 20 sites left that fulfill our query. Let's request the full daily, water table depth data series for those sites, starting from 2000-01-01. \n", "\n", "Again, `get_point_data` and `get_point_metadata` require the parameters `dataset`, `variable`, `temporal_resolution` and `aggregation` to be supplied to be able to uniquely identify a single data series. For daily average water table depth, we want `dataset='usgs_nwis'`, `variable='water_table_depth'`, `temporal_resolution='daily'`, and `aggregation='mean'`." ] }, { "cell_type": "code", "execution_count": 15, "id": "76500a3f-7fab-44aa-8e14-a9584d45df1a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
date402015074275702402109074301301402109074301302402138074435801402143074185201402151074525301402208074145201402208074505801402512074414301...403119074290301403135074274401403135074274402403135074274403403200074420601403455074514801403517074452501404014074585401404712074454701404934074400501
02000-01-01NaNNaNNaN3.4777680.7772400.79857637.956744NaNNaN...NaN3.7612322.7066242.368296NaN2.9230325.660136NaN16.0050483.691128
12000-01-02NaNNaNNaN3.4655760.7772400.74676037.911024NaNNaN...NaN3.7581842.6883362.343912NaN2.9047445.690616NaN15.9959043.691128
22000-01-03NaNNaNNaN3.4533840.7802880.65836837.874448NaNNaN...NaN3.7612322.6883362.334768NaN2.9047445.727192NaN16.0020003.688080
32000-01-04NaNNaNNaN3.4076640.7650480.50901637.828728NaNNaN...NaN3.7429442.6548082.298192NaN2.8834085.739384NaN15.9898083.681984
42000-01-05NaNNaNNaN3.3802320.6461760.52120837.853112NaNNaN...NaN3.7246562.6670002.289048NaN2.8895045.760720NaN16.0294323.678936
\n", "

5 rows × 21 columns

\n", "
" ], "text/plain": [ " date 402015074275702 402109074301301 402109074301302 \\\n", "0 2000-01-01 NaN NaN NaN \n", "1 2000-01-02 NaN NaN NaN \n", "2 2000-01-03 NaN NaN NaN \n", "3 2000-01-04 NaN NaN NaN \n", "4 2000-01-05 NaN NaN NaN \n", "\n", " 402138074435801 402143074185201 402151074525301 402208074145201 \\\n", "0 3.477768 0.777240 0.798576 37.956744 \n", "1 3.465576 0.777240 0.746760 37.911024 \n", "2 3.453384 0.780288 0.658368 37.874448 \n", "3 3.407664 0.765048 0.509016 37.828728 \n", "4 3.380232 0.646176 0.521208 37.853112 \n", "\n", " 402208074505801 402512074414301 ... 403119074290301 403135074274401 \\\n", "0 NaN NaN ... NaN 3.761232 \n", "1 NaN NaN ... NaN 3.758184 \n", "2 NaN NaN ... NaN 3.761232 \n", "3 NaN NaN ... NaN 3.742944 \n", "4 NaN NaN ... NaN 3.724656 \n", "\n", " 403135074274402 403135074274403 403200074420601 403455074514801 \\\n", "0 2.706624 2.368296 NaN 2.923032 \n", "1 2.688336 2.343912 NaN 2.904744 \n", "2 2.688336 2.334768 NaN 2.904744 \n", "3 2.654808 2.298192 NaN 2.883408 \n", "4 2.667000 2.289048 NaN 2.889504 \n", "\n", " 403517074452501 404014074585401 404712074454701 404934074400501 \n", "0 5.660136 NaN 16.005048 3.691128 \n", "1 5.690616 NaN 15.995904 3.691128 \n", "2 5.727192 NaN 16.002000 3.688080 \n", "3 5.739384 NaN 15.989808 3.681984 \n", "4 5.760720 NaN 16.029432 3.678936 \n", "\n", "[5 rows x 21 columns]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# This DataFrame will contain data from 2000-01-01 onwards. If sites do not have data that early, they will have NaN values\n", "# for dates until the site became operational.\n", "data_df = get_point_data(dataset=\"usgs_nwis\", variable=\"water_table_depth\", temporal_resolution=\"daily\", aggregation=\"mean\",\n", " date_start=\"2000-01-01\", \n", " polygon=\"Shape/raritan_watershed.shp\", polygon_crs=usgs_huc_crs)\n", "\n", "# View the first five records\n", "data_df.head()" ] }, { "cell_type": "code", "execution_count": 16, "id": "4f8d21a4-8683-4162-8641-00345b16e1ac", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
site_idsite_namesite_typeagencystatelatitudelongitudefirst_date_data_availablelast_date_data_availablerecord_count...conus1_xconus1_yconus2_xconus2_yusgs_nat_aqfr_cdusgs_aqfr_cdusgs_aqfr_type_cdusgs_well_depthusgs_hole_depthusgs_hole_depth_src_cd
0402015074275702230229-- Forsgate 4 Obsgroundwater wellUSGSNJ40.337608-74.4654301972-11-012005-07-16678...NoneNone40351964S100NATLCP211FRNGC330.0NaNnan
1402109074301301230291-- Forsgate 1 Obsgroundwater wellUSGSNJ40.352608-74.5032091973-02-072023-08-097278...NoneNone40321964S100NATLCP211FRNGC203.0NaNnan
2402109074301302230292-- Forsgate 2 Obsgroundwater wellUSGSNJ40.352608-74.5029311972-12-062023-08-097435...NoneNone40321964S100NATLCP211ODBGC104.0130.0D
3402138074435801210365-- Carter Rd Obsgroundwater wellUSGSNJ40.360662-74.7323831987-02-252023-09-2813134...NoneNone40131960N300ERLMZC227PSSCU99.0NaNZ
4402143074185201230104-- Morrell 1 Obsgroundwater wellUSGSNJ40.362053-74.3132031985-01-242023-12-0213930...NoneNone40461970S100NATLCP211EGLSU11.011.0R
\n", "

5 rows × 25 columns

\n", "
" ], "text/plain": [ " site_id site_name site_type agency state \\\n", "0 402015074275702 230229-- Forsgate 4 Obs groundwater well USGS NJ \n", "1 402109074301301 230291-- Forsgate 1 Obs groundwater well USGS NJ \n", "2 402109074301302 230292-- Forsgate 2 Obs groundwater well USGS NJ \n", "3 402138074435801 210365-- Carter Rd Obs groundwater well USGS NJ \n", "4 402143074185201 230104-- Morrell 1 Obs groundwater well USGS NJ \n", "\n", " latitude longitude first_date_data_available last_date_data_available \\\n", "0 40.337608 -74.465430 1972-11-01 2005-07-16 \n", "1 40.352608 -74.503209 1973-02-07 2023-08-09 \n", "2 40.352608 -74.502931 1972-12-06 2023-08-09 \n", "3 40.360662 -74.732383 1987-02-25 2023-09-28 \n", "4 40.362053 -74.313203 1985-01-24 2023-12-02 \n", "\n", " record_count ... conus1_x conus1_y conus2_x conus2_y usgs_nat_aqfr_cd \\\n", "0 678 ... None None 4035 1964 S100NATLCP \n", "1 7278 ... None None 4032 1964 S100NATLCP \n", "2 7435 ... None None 4032 1964 S100NATLCP \n", "3 13134 ... None None 4013 1960 N300ERLMZC \n", "4 13930 ... None None 4046 1970 S100NATLCP \n", "\n", " usgs_aqfr_cd usgs_aqfr_type_cd usgs_well_depth usgs_hole_depth \\\n", "0 211FRNG C 330.0 NaN \n", "1 211FRNG C 203.0 NaN \n", "2 211ODBG C 104.0 130.0 \n", "3 227PSSC U 99.0 NaN \n", "4 211EGLS U 11.0 11.0 \n", "\n", " usgs_hole_depth_src_cd \n", "0 nan \n", "1 nan \n", "2 D \n", "3 Z \n", "4 R \n", "\n", "[5 rows x 25 columns]" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Request site-level attributes for these sites\n", "metadata_df = get_point_metadata(dataset=\"usgs_nwis\", variable=\"water_table_depth\", temporal_resolution=\"daily\", aggregation=\"mean\",\n", " date_start=\"2000-01-01\", \n", " polygon=\"Shape/raritan_watershed.shp\", polygon_crs=usgs_huc_crs)\n", "\n", "# View the first five records\n", "metadata_df.head()" ] }, { "cell_type": "markdown", "id": "19be352e-e2d3-45c4-9041-fcbac19f45c7", "metadata": {}, "source": [ "Now let's visualize these points on a map to see what we ended up with. We'll use the [bokeh](https://bokeh.org/) package to do this. If you do not have `bokeh` installed into your environment, you may need to `pip install bokeh` first." ] }, { "cell_type": "code", "execution_count": 17, "id": "af8e5cc7-01e4-456d-8eb1-2d456b9a3d77", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "(function(root) {\n function now() {\n return new Date();\n }\n\n const force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\nconst JS_MIME_TYPE = 'application/javascript';\n const HTML_MIME_TYPE = 'text/html';\n const EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n const CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n const script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n function drop(id) {\n const view = Bokeh.index.get_by_id(id)\n if (view != null) {\n view.model.document.clear()\n Bokeh.index.delete(view)\n }\n }\n\n const cell = handle.cell;\n\n const id = cell.output_area._bokeh_element_id;\n const server_id = cell.output_area._bokeh_server_id;\n\n // Clean up Bokeh references\n if (id != null) {\n drop(id)\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n const cmd_clean = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd_clean, {\n iopub: {\n output: function(msg) {\n const id = msg.content.text.trim()\n drop(id)\n }\n }\n });\n // Destroy server and session\n const cmd_destroy = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd_destroy);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n const output_area = handle.output_area;\n const output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n const toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n const bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n const script_attrs = bk_div.children[0].attributes;\n for (let i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n const toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n const props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n const events = require('base/js/events');\n const OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n const NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n const el = document.getElementById(\"a98460ca-216b-4ea5-9719-4a906fcd4ce7\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.3.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.3.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.3.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.3.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-3.3.0.min.js\"];\n const css_urls = [];\n\n const inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {\n }\n ];\n\n function run_inline_js() {\n if (root.Bokeh !== undefined || force === true) {\n for (let i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\nif (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n const cell = $(document.getElementById(\"a98460ca-216b-4ea5-9719-4a906fcd4ce7\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "(function(root) {\n function embed_document(root) {\n const docs_json = {\"f80b2342-9d4b-4248-9eb4-f57121f4a5eb\":{\"version\":\"3.3.0\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"Figure\",\"id\":\"p1004\",\"attributes\":{\"x_range\":{\"type\":\"object\",\"name\":\"Range1d\",\"id\":\"p1013\",\"attributes\":{\"start\":-8242915.233550446,\"end\":-8369197.21940265}},\"y_range\":{\"type\":\"object\",\"name\":\"Range1d\",\"id\":\"p1014\",\"attributes\":{\"start\":4885959.309547473,\"end\":5014978.933984525}},\"x_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1015\"},\"y_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1016\"},\"title\":{\"type\":\"object\",\"name\":\"Title\",\"id\":\"p1011\"},\"renderers\":[{\"type\":\"object\",\"name\":\"TileRenderer\",\"id\":\"p1035\",\"attributes\":{\"tile_source\":{\"type\":\"object\",\"name\":\"WMTSTileSource\",\"id\":\"p1034\",\"attributes\":{\"url\":\"https://tile.openstreetmap.org/{z}/{x}/{y}.png\",\"max_zoom\":19,\"attribution\":\"© OpenStreetMap contributors\"}}}},{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1043\",\"attributes\":{\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1001\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1002\",\"attributes\":{\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1003\"},\"data\":{\"type\":\"map\",\"entries\":[[\"x\",[-8289453.715906311,-8293659.25494899,-8293628.3415263975,-8319170.821327895,-8272507.894913272,-8335714.634243832,-8265179.131709102,-8332202.036767443,-8314996.229103657,-8288278.683021244,-8289917.6599217,-8289051.8191487,-8289051.8191487,-8289051.8191487,-8315766.960730113,-8333426.4487522375,-8321861.235309184,-8346933.321243996,-8322541.675696658,-8313450.313071111]],[\"y\",[4915124.539545458,4917315.329496577,4917315.329496577,4918491.961527475,4918695.151032458,4919019.479573913,4919709.788012262,4919693.904420512,4927179.990668847,4928926.735856218,4941650.016952579,4942748.343184867,4942748.343184867,4942748.343184867,4943738.010362881,4950195.653586993,4951783.571749068,4963853.147214062,4980940.465464774,4985515.621908162]],[\"site_id\",[\"402015074275702\",\"402109074301301\",\"402109074301302\",\"402138074435801\",\"402143074185201\",\"402151074525301\",\"402208074145201\",\"402208074505801\",\"402512074414301\",\"402553074271701\",\"403119074290301\",\"403135074274401\",\"403135074274402\",\"403135074274403\",\"403200074420601\",\"403455074514801\",\"403517074452501\",\"404014074585401\",\"404712074454701\",\"404934074400501\"]],[\"site_name\",[\"230229-- Forsgate 4 Obs\",\"230291-- Forsgate 1 Obs\",\"230292-- Forsgate 2 Obs\",\"210365-- Carter Rd Obs\",\"230104-- Morrell 1 Obs\",\"190251-- Corsalo Rd 1 Obs\",\"250272-- Marlboro 1 Obs\",\"210705-- Gomez Tract Obs\",\"350139-- MW109\",\"230070-- Fischer Obs\",\"231165-- Golf 13 Obs\",\"231330-- MW-12A\",\"231331-- MW-12B\",\"231332-- MW-12C\",\"350138-- MW110\",\"190276-- Environmental Ctr 1 Obs\",\"190270-- Readington 11 Obs\",\"190495-- NJWSA TW-B\",\"271303-- Drew University Farm Obs\",\"271190-- Black River 10 Obs\"]]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1044\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1045\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Circle\",\"id\":\"p1040\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":15},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_color\":{\"type\":\"value\",\"value\":\"red\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.8}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Circle\",\"id\":\"p1041\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":15},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"red\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Circle\",\"id\":\"p1042\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":15},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"red\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}}],\"toolbar\":{\"type\":\"object\",\"name\":\"Toolbar\",\"id\":\"p1012\",\"attributes\":{\"tools\":[{\"type\":\"object\",\"name\":\"PanTool\",\"id\":\"p1027\"},{\"type\":\"object\",\"name\":\"WheelZoomTool\",\"id\":\"p1028\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"BoxZoomTool\",\"id\":\"p1029\",\"attributes\":{\"overlay\":{\"type\":\"object\",\"name\":\"BoxAnnotation\",\"id\":\"p1030\",\"attributes\":{\"syncable\":false,\"level\":\"overlay\",\"visible\":false,\"left_units\":\"canvas\",\"right_units\":\"canvas\",\"top_units\":\"canvas\",\"bottom_units\":\"canvas\",\"line_color\":\"black\",\"line_alpha\":1.0,\"line_width\":2,\"line_dash\":[4,4],\"fill_color\":\"lightgrey\",\"fill_alpha\":0.5}}}},{\"type\":\"object\",\"name\":\"SaveTool\",\"id\":\"p1031\"},{\"type\":\"object\",\"name\":\"ResetTool\",\"id\":\"p1032\"},{\"type\":\"object\",\"name\":\"HelpTool\",\"id\":\"p1033\"}]}},\"left\":[{\"type\":\"object\",\"name\":\"MercatorAxis\",\"id\":\"p1022\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"MercatorTicker\",\"id\":\"p1023\",\"attributes\":{\"mantissas\":[1,2,5],\"dimension\":\"lat\"}},\"formatter\":{\"type\":\"object\",\"name\":\"MercatorTickFormatter\",\"id\":\"p1024\",\"attributes\":{\"dimension\":\"lat\"}},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1025\"}}}],\"below\":[{\"type\":\"object\",\"name\":\"MercatorAxis\",\"id\":\"p1017\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"MercatorTicker\",\"id\":\"p1018\",\"attributes\":{\"mantissas\":[1,2,5],\"dimension\":\"lon\"}},\"formatter\":{\"type\":\"object\",\"name\":\"MercatorTickFormatter\",\"id\":\"p1019\",\"attributes\":{\"dimension\":\"lon\"}},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1020\"}}}],\"center\":[{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1021\",\"attributes\":{\"axis\":{\"id\":\"p1017\"}}},{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1026\",\"attributes\":{\"dimension\":1,\"axis\":{\"id\":\"p1022\"}}}]}}]}};\n const render_items = [{\"docid\":\"f80b2342-9d4b-4248-9eb4-f57121f4a5eb\",\"roots\":{\"p1004\":\"a0c9d939-e688-429e-bd89-139feac9f0a7\"},\"root_ids\":[\"p1004\"]}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "p1004" } }, "output_type": "display_data" } ], "source": [ "from bokeh.plotting import figure, output_notebook, show\n", "from bokeh.models import ColumnDataSource\n", "import numpy as np\n", "\n", "output_notebook()\n", "\n", "# First let's define a function to convert lon/lat to mercator coordinates for Bokeh mapping procedure\n", "def wgs84_to_web_mercator(lon, lat):\n", "\n", " k = 6378137\n", " x = lon * (k * np.pi/180.0)\n", " y = np.log(np.tan((90 + lat) * np.pi/360.0)) * k\n", "\n", " return x, y\n", "\n", "# Calculate and add mercator coordinates to metadata DataFrame\n", "metadata_df['x'] = metadata_df.apply(lambda x: wgs84_to_web_mercator(x['longitude'], x['latitude'])[0], axis=1)\n", "metadata_df['y'] = metadata_df.apply(lambda x: wgs84_to_web_mercator(x['longitude'], x['latitude'])[1], axis=1)\n", "\n", "# Define data source for point overlays\n", "source = ColumnDataSource(\n", " data=dict(x=list(metadata_df['x']),\n", " y=list(metadata_df['y']),\n", " site_id=list(metadata_df['site_id']),\n", " site_name=list(metadata_df['site_name']))\n", ")\n", "\n", "# Range bounds supplied in web mercator coordinates\n", "# Translate min and max bounding values from metadata\n", "buffer = 0.2\n", "p = figure(x_range=(wgs84_to_web_mercator((metadata_df['longitude'].max()+buffer), (metadata_df['latitude'].max()+buffer))[0], \n", " wgs84_to_web_mercator((metadata_df['longitude'].min()-buffer), (metadata_df['latitude'].min()-buffer))[0]),\n", " y_range=(wgs84_to_web_mercator((metadata_df['longitude'].min()-buffer), (metadata_df['latitude'].min()-buffer))[1], \n", " wgs84_to_web_mercator((metadata_df['longitude'].max()+buffer), (metadata_df['latitude'].max()+buffer))[1]),\n", " x_axis_type=\"mercator\", y_axis_type=\"mercator\")\n", "p.add_tile('OSM')\n", "\n", "# Overlay red circles onto map for site locations\n", "p.circle(x=\"x\", y=\"y\", size=15, fill_color=\"red\", fill_alpha=0.8, source=source)\n", "\n", "show(p)" ] } ], "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.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }