Plot trends in atmospheric gasses such as carbon dioxide and methane
C++ HTML Makefile Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ccgview-build
data
desktop
emissions
man
src
LICENSE
Makefile
README.md

README.md

Introduction

ccg is a program which enables you to plot ERSL atmospheric gas data from the US National Oceanic and Atmospheric Administration (NOAA) web site.

Example data sources:

mkdir data
cd data
wget ftp://ftp.cmdl.noaa.gov/data/trace_gases/co2/flask/co2_flask_surface.tar.gz
wget ftp://ftp.cmdl.noaa.gov/data/trace_gases/ch4/flask/ch4_flask_surface.tar.gz
tar -xzvf co2_flask_surface.tar.gz
tar -xzvf ch4_flask_surface.tar.gz

The compressed files should be unzipped to a directory, then the name of the directory can be specified as a parameter.

Also you will need the list of observation sites:

wget http://www.esrl.noaa.gov/gmd/dv/site/site_table.html

And emissions data:

wget http://cdiac.ornl.gov/ftp/ndp030/CSV-FILES/global.1751_2010.csv

Installation

To install the software you can either download and install the deb package directly, or compile from source, whichever best suits your needs.

To install the package:

sudo dpkg -i ccg-x.x.deb

or to compile from source first install the prerequisites:

sudo apt-get install gnuplot qt4-qmake libqt4-dev libqtcore4 libqtgui4 libqt4-xml libqt4-script

Compile the GUI. The location of the mkspecs directory may vary on different systems. On Fedora see fedora.sh for an alternative example.

cd ccgview-build
qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile ../src/ccgview/ccgview.pro
cd ..

Something which might be useful to know here is that the Makefile within the ccgview-build directory is a file which is generated by the Qt Creator IDE if you set the build diectory for the project to ccgview-build.

To compile the command line program:

make
sudo make install

If you don't care about the GUI, or don't have Qt version 4.8 or later installed, then you can compile only the command line program with:

make cmd
sudo make install

Packaging

To create a debian package see https://github.com/bashrc/ccg-debian

Examples

In these examples the CO2 events were uncompressed to a directory called "co2" and the CH4 events were uncompressed to a directory called "ch4".

To plot methane in the northern hemisphere:

ccg --sites site_table.html --dir ch4 --filename methane.png --gas ch4 --start 1985 --end 2011 --latitudes "0N,90N" --label "nmol mol-1"

or to plot the same data monthly:

ccg --sites site_table.html --dir ch4 --filename methane.png --gas ch4 --start 1985 --end 2011 --latitudes "0N,90N" --monthly --label "nmol mol-1"

or the rate of change:

ccg --sites site_table.html --dir ch4 --filename methane.png --gas ch4 --start 1985 --end 2011 --latitudes "0N,90N" --change --label "nmol mol-1"

To plot CO2 between 1970 and 2011:

ccg --sites site_table.html --dir co2 --filename co2.png --gas co2 --start 1970 --end 2011 --label "Parts Per Million"

To plot the relationship between CO2 and altitude:

ccg --sites site_table.html --dir co2 --filename co2.png --gas co2 --start 1970 --end 2011 --altitudes --label "Parts Per Million"

A distribution scatter plot can also be produced so that you can get an idea of the range of measurements:

ccg --sites site_table.html --dir co2 --filename test.png --gas co2 --start 2007 --end 2011 --distribution --latitudes "10N,90N" --label "Parts Per Million"

Google Earth

To export the sampling sites in KML format so that they can be viewed with Google Earth:

ccg --sites site_table.html --kmlsites sites.kml

The Graphical User Interface

To run the program search for "ccg" and you should see its icon appear, or alternatively you can type:

ccgview

on the command line. The first thing which you will be prompted for is to specify the directory in which the gas event data is stored, and also a file listing the sampling sites. If you've downloaded the data for multiple gasses then you may want to place them all into a single directory and specify it here. Since the units of measurement are not given in the data files you can optionally also specify a name for the label of the vertical axis of the graph.

You can then select the gas type, the type of graph to be produced, time period and region. There are a couple of checkboxes, one to show minimum and maximum values and the other to show a running average. These options don't necessarily work with all graph types (such as the scatter plot and altitudes).

When you are ready then hit the calculate button and the new graph with be calculated. This may take some time, depending upon how much data there is available. The resulting graph might not be rendered very well in the area below, so to get a clearer view of it just click on it and the full resolution image will be displayed using your default image viewing program.

If you wish to save the graph then a save option is available on the File menu.