viernes, 16 de noviembre de 2012

Our First Map

We are happy to announce that we have our first Climate Visualization Map

http://innova-t.appspot.com/marovi/listPoints/

The Process
We have created a semi-automatic process.  We download the GRIB file to a local linux box. We then process that file so that we extract:
  • initial timestamp
  • latitude and longitude
  • temperature in Kelvin
The excel that is generated is the input to the datastore in GAE.

Styles and Heatmap Layer
Maps are good if they display what we want clearly. That´s why we were inspired by several talks of the Google Maps Developer team to include some of their recommendations on the maps. Of course, we turned on the Heatmap layer -- which is a part of the Google Maps API. We configured the terrain, inverted the lightness to display water masses and countries more clearly. We also specified the opacity in a custom format. The data points were also important and we turned off the dissipation for a better effect of the temperature.

And of course, we used the Style Map Wizard for testing our styles.

Content
The map displays only 1000 data points from a set of 150K temperature measurements taken during the first four months of 2012. We plan to integrate more than 30 years worth of data. So this is a good start. We are able to validate that the coordinates are correct (displays temperature on top of land masses) and that they make sense. The points displayed show that in Australia is is warmer than America due probably to the hour of the day.

lunes, 5 de noviembre de 2012

Understanding GRID files

Abstract
Notes on the interpretation of GRIB and HDF5 file formats for EOS.

Grid Data
Our files are mostly grids which means they represents data points taken at some point in time and contains a set of projection equations. Although we do not care that much about the different type of projection used (Mercartor, for example) due to libraries that do the hard work for us. However, we are interested in how to extract the actual value taken along with the relevant latitude and longitude. I try to explain what I did with the files in order not to forget in the future.

Basics
There are three important features of a grid file: data fields, dimensions, and the projection. The data fields are rectilinear arrays of two or more dimensions and are related to each other by common geolocation.

Dimensions are used to relate data fields to each other and to the geolocation information. To be interpreted properly, each data field must make use of two predefined dimensions "XDim" and "YDim".

Projections are used to encode and interpret. It provides with a convenient way to encode geolocation information as a set of math equations capable of transforming earth coordinates to x-y coordinates on a sheet of paper.

Most sources of data files are websites like Giovanni and provide with GRIB or HDF-EOS file formats. We use those file formats to extract the values we are interested: average surface temperature.

Extracting Values
Thanks to libraries like pygrib we are able to read the GRIB files and extract:
- lat,lng
- measurement

The files that we are currently processing are taken at 3 hours intervals so we just have to take the first measurement and iterate forward. The date is given by the file name.

You can read the "headers" of the file that will tell you which index to use to extract the measurement of interest.