The French national meteorological service Météo-France publishes the surface synoptic observations (SYNOP) of its automated stations over the French territories. About 60 stations across the globe constantly emit data, from 1996 until today. All the data stays ready to download and include temperatures beyond various KPIs.

Displaying temperatures over a comprehensive graph

First, it is necessary to recover and clean all the available data with some simple R code. It then becomes possible to perform aggregations and visualize the data. Averaging temperatures remains a good start. This KPI provides a quick overview of the various climates of the French territories. From the polar temperatures of the Dumont d’Urville Antarctic base to the tropical rainforest climate of Saint Georges in Guyane, here is the average temperatures for each day of the 2014 year in France.

2014 Temperatures in France, overview of the different climates of France.Click to enlarge image.

Blanks over the picture mean values miss. The X axis displays months while the Y axis shows days in a descending order.

About the code used to generate this image

Here is the R code using PostgreSQL to generate the picture:

library("ggplot2")
library(RPostgreSQL)

avgTemp2014 = dbGetQuery(con,"SELECT s.\"Nom\" as station,month,day,AVG(t)-273.15 as Temperature
FROM fr_synop_data d
JOIN fr_synop_stations s ON d.numer_sta = s.\"ID\"
WHERE year = 2014
GROUP BY s.\"Nom\",month,day")

jpeg("temp.jpg",3000,2500,res=200)
p = ggplot(data=avgTemp2014, aes(x=month, y=reorder(day,-day), fill=temperature))
p = p + geom_tile()
p = p + scale_fill_gradientn(colours = rev(c('#F21A00','#E1AF00','#EBCC2A','#78B7C5','#3B9AB2','#006E89','#004B5D','#002129','#002129')))
p = p + scale_x_discrete(expand = c(0,0),limits = unique(avgTemp2014$month))
p = p + xlab("Month")
p = p + ylab("Days")
p = p + ggtitle("2014 Temperatures in France")
p = p + facet_wrap(~station,nrow = 10, ncol = 6)
p = p + theme(axis.text.y = element_text(size=3),
p = plot.title=element_text(family="Helvetica", face="bold", size=30,vjust=2))
p
dev.off()

 

SHARE

LEAVE A REPLY

Please enter your comment!
Please enter your name here