bashrc/tempgraph2
Commandline tool to plot global temperature data using data from the Global Historical Climatology Network.
- Python 98.9%
- Shell 1.1%
| img | Add image to readme | |
| anomaly.py | Update for 2025 | |
| baseline.py | Apply latitude range | |
| grid.py | File encoding | |
| LICENSE | Initial | |
| parseCountries.py | File encoding | |
| parseData.py | Load all years so that baseline can always be calculated | |
| parseStations.py | File encoding | |
| README.md | Markdown headings | |
| static_analysis | Initial | |
| tempgraph2.py | Update for 2025 | |
| tests.py | Snake case | |
This is a commandline tool to plot global temperature data using data from the Global Historical Climatology Network.
See https://www.ncei.noaa.gov/pub/data/ghcn/v4
Installation
To compile from source first install the prerequisites:
On a Debian based system:
sudo apt install build-essential gnuplot wget marble python3
On Arch/Parabola:
sudo pacman -S gnuplot wget marble python
Obtaining the data
Before you begin you'll need to download the latest version of the GHCN version 4 data. tempgraph needs three files: the country codes, the weather stations and the temperature data itself. These files can be obtained here:
mkdir data
cd data
wget https://www.ncei.noaa.gov/pub/data/ghcn/v4/ghcnm.tavg.latest.qcf.tar.gz
wget https://www.ncei.noaa.gov/pub/data/ghcn/v4/ghcnm-countries.txt
tar -xzvf ghcnm.tavg.latest.qcf.tar.gz
cd ..
The compressed archive contains two files, one which is the temperature data (.dat) and the other which contains details of the weather stations (.inv). I typically rename these to:
cp data/ghcnm.v4*/*.dat data/v4.mean
cp data/ghcnm.v4*/*.inv data/wmo.txt
cp data/ghcnm-countries.txt data/v4.country.codes
Usage
python3 tempgraph2.py
ls *.kml *.jpg