Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wdbm/awrs
Automated Weather Reporting System -- Python weather utilities
https://github.com/wdbm/awrs
icao metar python taf weather
Last synced: 27 days ago
JSON representation
Automated Weather Reporting System -- Python weather utilities
- Host: GitHub
- URL: https://github.com/wdbm/awrs
- Owner: wdbm
- License: gpl-3.0
- Created: 2017-06-09T12:30:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-14T11:53:33.000Z (over 5 years ago)
- Last Synced: 2024-04-25T17:05:37.392Z (8 months ago)
- Topics: icao, metar, python, taf, weather
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.ipynb
- License: LICENSE
Awesome Lists containing this project
README
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# AWRS: Automated Weather Reporting System\n",
"\n",
"Python weather utilities\n",
"\n",
"# setup"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```Bash\n",
"pip install AWRS\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import AWRS"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An ICAO identifier is used to set location. For example, EGPF is Glasgow Airport.\n",
"\n",
"# METAR: Meteorological Terminal Aviation Routine"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'METAR': 'EGPF 141120Z AUTO 10008KT 060V130 8000 -RA BKN017 BKN027 OVC037 14/12 Q1007',\n",
" 'QNH': 1007,\n",
" 'datetime': datetime.datetime(2019, 8, 14, 11, 20),\n",
" 'dewpoint': 12,\n",
" 'identifier': 'EGPF',\n",
" 'rain': True,\n",
" 'temperature': 14,\n",
" 'time_UTC': '2019-08-14T1120Z',\n",
" 'visibility': 8000,\n",
" 'wind_direction': 100,\n",
" 'wind_speed': 8}"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"report = AWRS.METAR(identifier='EGPF')\n",
"del report['raw']\n",
"report"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# TAF: Terminal Aerodrome Forecast"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'TAF': 'EGPF 140927Z 1409/1506 11008KT 9999 SCT030 PROB30 TEMPO 1409/1418 4800 -RADZ BKN007 TEMPO 1418/1506 6000 RA BKN010 PROB30 TEMPO 1418/1423 3000 +RA BKN005 BECMG 1500/1503 24010KT BECMG 1503/1506 30012KT',\n",
" 'identifier': 'EGPF',\n",
" 'rain_TAF_datetimes': [('1409', '1418'), ('1418', '1506'), ('1418', '1423')],\n",
" 'rain_datetimes': [(datetime.datetime(2019, 8, 14, 9, 0),\n",
" datetime.datetime(2019, 8, 14, 18, 0)),\n",
" (datetime.datetime(2019, 8, 14, 18, 0),\n",
" datetime.datetime(2019, 8, 15, 6, 0)),\n",
" (datetime.datetime(2019, 8, 14, 18, 0),\n",
" datetime.datetime(2019, 8, 14, 23, 0))],\n",
" 'rain_human_readable_datetimes': ['2019-08-14T0900Z--2019-08-14T1800Z',\n",
" '2019-08-14T1800Z--2019-08-15T0600Z',\n",
" '2019-08-14T1800Z--2019-08-14T2300Z']}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"report = AWRS.TAF(identifier='EGPF')\n",
"del report['raw']\n",
"report"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## When is rain predicted by TAF?\n",
"\n",
"Each tuple is a forcast time window during which rain is predicted:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[(datetime.datetime(2019, 8, 14, 9, 0), datetime.datetime(2019, 8, 14, 18, 0)),\n",
" (datetime.datetime(2019, 8, 14, 18, 0), datetime.datetime(2019, 8, 15, 6, 0)),\n",
" (datetime.datetime(2019, 8, 14, 18, 0),\n",
" datetime.datetime(2019, 8, 14, 23, 0))]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"AWRS.rain_datetimes(identifier='EGPF')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"What time is it?"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"datetime.datetime(2019, 8, 14, 11, 51, 18, 123901)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import datetime\n",
"datetime.datetime.utcnow()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Is it predicted by TAF to rain soon?"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"AWRS.rain_soon(identifier='EGPF', minutes=30)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}