Category Archives: RClimate Script

Animated Images of Arctic Sea Ice Extent Decline

This post shows how to download and animate a series of Arctic Sea Ice Extent images using R and the animation package.

In my previous post, I showed how to download the daily arctic sea ice extent  data and generate an animation of the time series plots. In this post I show how to animate the monthly images provided by NOAA’s Nation Snow and Ice Data Center.


###### RClimate Script: NSIDC_Monthly_Sea_Ice_Extent_Images.R
## Download and process 1981 to 2012 Monthly Arctic SIE Images
## Sept. 5, 2012: http://chartsgraphs.wordpress.com; DK O'Day
##############################################################
  library(animation)
## Establish work dir to place downloaded images and gif file
  setwd(getwd())
  where <- getwd()

## Monthly NSIDC Extent Immage Link
# ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/Aug/N_198108_extn.png
  part_1 <- "ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/Aug/N_"
  part_3 <- "08_extn.png"

# Specify month number for animation
  m <- "08"

# Loop through years to create link and download images
  for (y in 1981:2012) {
     file_name <- paste(part_1, y, part_3, sep="")
     copy_name <- paste(where, "//asie",y,m,".png",sep="")
     download.file(file_name, copy_name, mode="wb")
     }

## copy last file c times to extend gif animation
    for (c in 1:2)
    {
     file_name <- paste("asie2012",c, ".png",sep="")
     file.copy(from= copy_name, to = file_name, overwrite=T)
    }

## Use animation package to generate gif file
  ani.options(convert=shQuote('C:\\Program Files (x86)\\ImageMagick-6.7.9-Q16\\convert.exe'))
  ani.options(outdir = getwd()) # direct gif output file to working dir
  ani.options(interval= 0.70)
  im.convert("asie*.png", "asie_image_animation.gif")

Here is a link to the R script file.

R Script to Build Animation of Arctic Sea Ice Extent – Update 9/3/12

In my previous post I showed an animation of Arctic Sea Ice Extent from the 1980′s through August, 2012 (link).  In this post, I show how to build this Arctic Sea ice Extent  animated chart.

Source Data

The Arctic Ice Sea Monitor (link)   updates their daily csv file with the latest satellite based arctic sea ice measurements.  Here is the daily csv file link.

R script

To develop my animation of the daily Arctic Sea Ice extent, I decided to produce a plot for each year that showed the current year in red and the previous years in grey.  I go this idea from Tamino at Open Mind.

Here is my R script: link.

Once I have the individual png files for each year, I use Photoshop Elements to generate my animation.

After getting Pierre’s comment about using the animation package, I gave it another try. The 2nd time,  I got it to work with ease.

I can now update the daily ASIE plot automatically without any Photoshop Elements involvement.

Thanks Pierre.

Visualizing the Arctic Sea Ice Extent Decline

Understanding what is happening to Arctic sea ice is critical to recognizing the serious consequences of global warming. So I want to help people visualize the 30+ year trend in Arctic sea ice extent.

The source data file is here:  http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv

Comparison of GISS LOTAs During 5 El Nino – La Nina Cycles

In this post I compare GISS LOTAs during 5 El Nino – La Nina cycles (2010, 1998, 19883, 1973 and 1970).

El Nino – La Nina Cycles

In a previous post I showed the Nino 34 SSTA cycles for 2010, 1998, 1983, 1973 and 1970 here. In this post, I want to see how GISS Land Ocean Temperature Anomalies (LOTA) vary over El Nino – La Nina cycles.  Here is my RClimate chart showing GISS anomalies for 6 months prior to cycle year,the cycle year and the 12 months after cycle year (30 month period).

Click chart to enlarge

While the 2010 cycle is only partially complete, there are a number of interesting aspects in this chart. The average temperatures during the cycles have clearly risen with the latest cycle showing the highest maximum anomaly. All 5 cycles all have similar patterns, with a buildup in 6 months prior to cycle year. The maximum – minimum range for the 5 cycles are comparable, ranging from 0.45 (2010) to 0.60 (1998).

Here is a data summary of the 5 cycles.

RClimate Links

Atmospheric Temperature Structure : 2 – Stratospheric Cooling

In this  post I review the temperature structure of the atmosphere and lower stratosphere temperature (TLS) anomaly trends.

Temperature Structure in the Atmosphere

In post 1 of this series, I developed this RClimate chart of temperature soundings which I update daily: (Click to enlarge)

Continue reading

Climate Time Series In a Single CSV File: Update 1

I am pleased to announce my CTS.csv file which includes 18 climate monthly time series in one easy to access csv file. This is part of  my goal of having a user friendly way for do-it-yourself citizen climate scientists to get up-to-date agency climate time series in a painless way.

Update 1: Reader Scott asked if I could provide meta data for the columns in my CTS.csv. This page lists the source agency and data links for the climate data series.

Here’s a snap shot of the first 6 rows of my  CTS.csv file. The data extends from 1880 until the most recent month.  Click image to enlarge

My hope is to make the CTS.csv the go-to file for citizen climate scientists who may want to:

  • Check temperature anomalies trends by series (GISS, HAD, NOAA, RSS, UAH)
  • Assess climate oscillations(AMO, AO, MEI, Nino34,  PDO)  trends
  • Evaluate  CO2 versus temperature anomaly relationships
  • Evaluate relationship between Sunspot numbers and anomaly temperature anomaly trends
  • Compare atmospheric transmission, SATO index  and volcanic activity
  • Assess impact of volcanoes on temperature anomaly trends
  • Compare MEI versus Nino ENSO 34 indicators
  • Assess lower stratospheric trends using RSS’s TLS series

By having these climate time series in a single csv file, R and Excel users can work with up to date data in a convenient form. The file will be automatically updated monthly as the climate agencies release their latest data.

How can CTS.csv Help Do-It-Yourself Citizen Climate Scientists?

Interested climate observers who want to compare global SSTA versus Nino34 trends, for example, have to follow a multiphase process:

  1. Find data file – even with Google this can take time
  2. Download files
  3. Merge 2 or more files to get data  into a usable format – source files all have different formats
  4. Perform analysis

Steps 1-3 can be very time consuming, so many users don’t bother checking out their ideas. Rather, they may rely on climate blog  comments. With CTS.csv and some R or Excel analysis, they can find the facts themselves rather than just having opinions.  They can submit their analysis and charts to blog posts, hopefully increasing the rigor of blog discussions.

Climate bloggers can request that their readers submit charts to back up their climate trend claims.

Data & RClimate Scripts Are All Open Book

All of the RClimate script that I use to produce the CTS.csv is available on-line at this link. Source data links are included in the function for each series.

Using RClimate To Retrieve Climate Series Data

This post shows how to use RClimate.txt to retrieve a climate time series and write a csv file in 5 lines of R script.

One of my readers, Robert, wants to be able to download climate time series data and write it to a csv file.  The R script below shows how to  download the MEI data series and write a csv file.  For this example I will use the RClimate function (func_MEI) to retrieve the data. I then simply specify the path and file name link for the output file (note quotes around the output file name and then write  a csv file.

source("http://processtrends.com/files/RClimate.txt"
m <- func_MEI()
head(m)
output_link <- "C://R_Home/mei.csv"
write.csv(m, output_link, quote=FALSE, row.names = F)

Continue reading

Volcanic Solar Dimming, ENSO and Temperature Anomalies

In previous posts I have shown plots of global temperature anomaly, volcano and Nino34 trends (here , here). In this post , I want to further  explore the role of volcanic eruptions and Nino34 phases (El Nino, La Nina) on temperature anomalies.

This post shows a 5-panel chart of monthly climate trend data: 1) time line of major volcanoes and Volcanic Explosivity Index (VEI),  2) Mauna Loa Observatory (MLO) Atmospheric  Transmission  (AT) measurements,  3) Stratospheric Aerosol Optical Thickness (SATO) Index,   4) , Nino 34 as an indicator of ENSO and 5)  GISS land-ocean temperature anomaly.

The RClimate script and Climate Time Series data file (CTS.csv) links are provided.

First, here is  the 5-panel chart that I have made showing the monthly volcano time line with Volcano Explosivity Index (VEI) , Atmospheric Transmission at Mauna Loa Observatory, SATO Index as well as the Nino34 SSTA and GISS LOTA. (Click Image to Enlarge)

Continue reading

Climate Charts, Data and RClimate Scripts

While there are many online climate data resources, the source data files are in numerous data formats, presenting a challenge to climate citizen scientists who want to retrieve and analyze several climate indicators at the same time.

I have been working to develop a consolidated open access data file and RClimate scripts that users can use to retrieve climate data, conduct their own analysis  and generate their own climate charts.  My goal is to make it easier for climate citizen scientists to get their hands on the data in a simple,  usable format (CSV). This post updates the status of my RClimate efforts.

Continue reading

Nov 2010 Year-To-Date Global Temperature Anomaly 1st in 2 Series, 2nd in 3 Series: Update

This post shows the YTD global land – ocean temperature anomaly (LOTA) trends for the 5 major series through November, 2010 and how  2010 YTD ranks over the entire record for each series.  The source data  file link is provided.

Continue reading