{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## ISD (AWS and NOAA)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`source` is the same for ISD: [\"ISD\", \"isd\", \"NOAA-isd\", \"noaa-isd\", \"noaa_isd\", \"NOAA-ISD\"]" ] }, { "cell_type": "code", "execution_count": 1, "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", "
USAFWBANSTATION NAMECTRYSTATEICAOLATLONELEV(M)BEGINEND
000701899999WXPOD 7018NaNNaNNaN0.000.0007018.02011030920130730
100702699999WXPOD 7026AFNaNNaN0.000.0007026.02012071320170822
200707099999WXPOD 7070AFNaNNaN0.000.0007070.02014092320150926
300826099999WXPOD8270NaNNaNNaN0.000.0000.02005010120120731
400826899999WXPOD8278AFNaNNaN32.9565.5671156.72010051920120323
\n", "
" ], "text/plain": [ " USAF WBAN STATION NAME CTRY STATE ICAO LAT LON ELEV(M) \\\n", "0 007018 99999 WXPOD 7018 NaN NaN NaN 0.00 0.000 7018.0 \n", "1 007026 99999 WXPOD 7026 AF NaN NaN 0.00 0.000 7026.0 \n", "2 007070 99999 WXPOD 7070 AF NaN NaN 0.00 0.000 7070.0 \n", "3 008260 99999 WXPOD8270 NaN NaN NaN 0.00 0.000 0.0 \n", "4 008268 99999 WXPOD8278 AF NaN NaN 32.95 65.567 1156.7 \n", "\n", " BEGIN END \n", "0 20110309 20130730 \n", "1 20120713 20170822 \n", "2 20140923 20150926 \n", "3 20050101 20120731 \n", "4 20100519 20120323 " ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from obswx import *\n", "\n", "# Get the metadata for the ISD dataset (AWS and NOAA)\n", "# AWS S3 bucket: https://noaa-isd-pds.s3.amazonaws.com/index.html\n", "# NOAA: https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database\n", "met = obswx(source='ISD')\n", "\n", "# Load the metadata\n", "met.get_meta(load=True).head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "metadata is originally from https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- get_data `source`\n", " - \"AWS\", \"aws\", \"S3\", \"s3\" is using AWS S3, \n", " - \"NOAA\", \"noaa\", \"NOAA-isd\", \"noaa-isd\", \"noaa_isd\", \"NOAA-ISD\" is using 'NOAA' source\n", "- get_data `year`, int or str is needed when obtaining ISD\n", "- get_data `station`, station name when `obswx(source='UK-hist_station')`; station id when `obswx(source='ISD')`\n", "\n", "Note! station id = ISD metadata [\"USAF\"] + ISD metadata[\"WBAN\"]; `year` must be corresponding in ISD metadata" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Getting data from NOAA ISD\n", "Here to help select station: https://envdes.github.io/obswx/isd_map\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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
STATIONDATESOURCELATITUDELONGITUDEELEVATIONNAMEREPORT_TYPECALL_SIGNQUALITY_CONTROL...CIGVISTMPDEWSLPKA1MA1OC1REMEQD
07018999992011-03-09T15:34:0040.00.07018.0WXPOD 7018FM-167018V020...22000,1,9,N004000,1,N,1+0130,1+0080,199999,9NaNNaNNaNMET072MOBOB0 METAR 7018 //199 000000 091534Z A...NaN
17018999992011-03-09T15:39:0040.00.07018.0WXPOD 7018FM-167018V020...22000,1,9,N004000,1,N,1+0130,1+0090,199999,9NaNNaNNaNMET072MOBOB0 METAR 7018 //199 000000 091539Z A...NaN
27018999992011-03-09T15:44:0040.00.07018.0WXPOD 7018FM-167018V020...22000,1,9,N004000,1,N,1+0140,1+0080,199999,9NaNNaNNaNMET072MOBOB0 METAR 7018 //199 000000 091544Z A...NaN
37018999992011-03-09T15:49:0040.00.07018.0WXPOD 7018FM-167018V020...22000,1,9,N003600,1,N,1+0140,1+0080,199999,9NaNNaNNaNMET072MOBOB0 METAR 7018 //199 000000 091549Z A...NaN
47018999992011-03-09T15:54:0040.00.07018.0WXPOD 7018FM-167018V020...22000,1,9,N004000,1,N,1+0140,1+0080,199999,9NaNNaNNaNMET072MOBOB0 METAR 7018 //199 000000 091554Z A...NaN
\n", "

5 rows × 21 columns

\n", "
" ], "text/plain": [ " STATION DATE SOURCE LATITUDE LONGITUDE ELEVATION \\\n", "0 701899999 2011-03-09T15:34:00 4 0.0 0.0 7018.0 \n", "1 701899999 2011-03-09T15:39:00 4 0.0 0.0 7018.0 \n", "2 701899999 2011-03-09T15:44:00 4 0.0 0.0 7018.0 \n", "3 701899999 2011-03-09T15:49:00 4 0.0 0.0 7018.0 \n", "4 701899999 2011-03-09T15:54:00 4 0.0 0.0 7018.0 \n", "\n", " NAME REPORT_TYPE CALL_SIGN QUALITY_CONTROL ... CIG \\\n", "0 WXPOD 7018 FM-16 7018 V020 ... 22000,1,9,N \n", "1 WXPOD 7018 FM-16 7018 V020 ... 22000,1,9,N \n", "2 WXPOD 7018 FM-16 7018 V020 ... 22000,1,9,N \n", "3 WXPOD 7018 FM-16 7018 V020 ... 22000,1,9,N \n", "4 WXPOD 7018 FM-16 7018 V020 ... 22000,1,9,N \n", "\n", " VIS TMP DEW SLP KA1 MA1 OC1 \\\n", "0 004000,1,N,1 +0130,1 +0080,1 99999,9 NaN NaN NaN \n", "1 004000,1,N,1 +0130,1 +0090,1 99999,9 NaN NaN NaN \n", "2 004000,1,N,1 +0140,1 +0080,1 99999,9 NaN NaN NaN \n", "3 003600,1,N,1 +0140,1 +0080,1 99999,9 NaN NaN NaN \n", "4 004000,1,N,1 +0140,1 +0080,1 99999,9 NaN NaN NaN \n", "\n", " REM EQD \n", "0 MET072MOBOB0 METAR 7018 //199 000000 091534Z A... NaN \n", "1 MET072MOBOB0 METAR 7018 //199 000000 091539Z A... NaN \n", "2 MET072MOBOB0 METAR 7018 //199 000000 091544Z A... NaN \n", "3 MET072MOBOB0 METAR 7018 //199 000000 091549Z A... NaN \n", "4 MET072MOBOB0 METAR 7018 //199 000000 091554Z A... NaN \n", "\n", "[5 rows x 21 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "met.get_data(year=2011, station= \"00701899999\", isd_source=\"AWS\").head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The headers darafrem and definition of each daily element included in the dataset (as available from each station) are as follows:\n", "\n", "- **STATION** - Station number (WMO/DATSAV3 possibly combined w/WBAN number) \n", "\n", "- TMP - Mean temperature (.1 Fahrenheit)\n", "- DEWP - Mean dew point (.1 Fahrenheit)\n", "- SLP - Mean sea level pressure (.1 mb)\n", "- STP - Mean station pressure (.1 mb)\n", "- VISIB - Mean visibility (.1 miles)\n", "- WDSP – Mean wind speed (.1 knots)\n", "- MXSPD - Maximum sustained wind speed (.1 knots)\n", "- GUST - Maximum wind gust (.1 knots)\n", "- MAX - Maximum temperature (.1 Fahrenheit)\n", "- MIN - Minimum temperature (.1 Fahrenheit)\n", "- PRCP - Precipitation amount (.01 inches)\n", "- SNDP - Snow depth (.1 inches)\n", "- FRSHTT – Indicator for occurrence of:\n", "\t\t Fog\t\t\n", " Rain or Drizzle\n", " Snow or Ice Pellets\n", " Hail\n", " Thunder\n", " Tornado/Funnel Cloud\n", "\n", "\n", "for more details of data discription, please refer to [Readme.txt](https://www.ncei.noaa.gov/data/global-summary-of-the-day/doc/readme.txt) and [Readme.pdf](https://www.ncei.noaa.gov/data/global-summary-of-the-day/doc/readme.pdf) from [NOAA](https://www.ncei.noaa.gov)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "save the data" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Getting data from NOAA ISD\n", "Here to help select station: https://envdes.github.io/obswx/isd_map\n" ] } ], "source": [ "df = met.get_data(year=2011, station= \"00701899999\", isd_source=\"AWS\")\n", "df.to_csv('data.csv', index=False)" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 4 }