Giter VIP home page Giter VIP logo

merced-weather's Introduction

Automated Tufte-style weather graphs

Merced weather update

This repository creates the weather graph below (inspired by Edward Tufte) using R's {{ggplot2}} package. Updated data is pulled directly from NOAA's servers in CSV format. The entire process is automated using Github Actions.

This repo may be useful in three ways.

  1. replicating or adapting this graph for a different weather station
  2. learning more about data viz with ggplot2
  3. learning more about Github Actions with R

Full disclosure: Original author is John Johnson

Daily High Temperature in Merced

About this data

NOAA provides daily data for weather stations in the Global Historical Climatological Network (GHCN).

Citation:

Menne, M.J., I. Durre, B. Korzeniewski, S. McNeal, K. Thomas, X. Yin, S. Anthony, R. Ray, R.S. Vose, B.E. Gleason, and T.G. Houston, 2012: Global Historical Climatology Network - Daily (GHCN-Daily), Version 3.26. NOAA National Climatic Data Center. http://doi.org/10.7289/V5D21VHZ [February 21, 2022].

Accessing data for a different station

For every weather station in the daily GHCN, NOAA maintains a file with the station's entire daily history. Each day, they append a new record. In my observation, records are typically lagged by a few days.

Each weather station is assigned a unique indicator. The full list of station names, coordinates, and unique IDs is available here.

I use a merged file (data/GHCN_USC00045532_USW00023257.csv) that contains daily weather reports from Merced Regional Airport stations (GHCN:USC00045532 & GHCN:USW00023257). The start date is June 1, 1899.

GHCN:USC00045532
- Historical data starting from June 1, 1899

GHCN:USW00023257
- More recent up to date data starting from August 1, 1998

Refer to R/Retrieve_GHCN_USC00045532_USW00023257.R for a demonstration of downloading and processing this dataset. See NOAA's documentation for detailed descriptions of the original variable definitions.

Replicating or altering the graph

The image graphs/DailyHighTemp_USC00045532_USW00023257.png is created by R/BuidlDailyHigh.R. See the README in /graphs for a step-by-step tutorial.

Automatic Updating with Github Actions

At a high level, the automated workflow:

(1) runs the script to retrieve the updated data

(2) commits the updated dataset to the repository

(3) runs the script to build the graph

(4) commits the graph to the repository. All this takes less than 1 minute per run.

See the README in /.github/workflows for a line-by-line discussion of the workflow file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.