Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

GRACE map layout and media export

Introduction

This post presents a processing chain for creating map layouts and export media for data from the Gravity Recovery and Climate Experiment (GRACE) mission in Kartur’s GeoImagine Framework.

Prerequisites

You must have completed the data processing of GRACE data in the previous post.

GRACE

Project module

The project module file (projGRACE.py) is available in the Project package projects.

Process chain

The project file links to an ASCII text file that contains a list of the xml files to execute. The layout and export processes are under the folder Layout.

projFN ='doc/Layout/grace-layout_20190216.txt'

As the path to the project file does not start with a slash “\”, the path must be relative to the project module itself. The project package available on Karttur’s GitHub page contains the path and the files required for running the process chain.

Layout

To produce a color map, you need to scale your original map to range between 0 and 250 (or lower), and then assign the palette. To create and export a layout map or image, you must pre-define the scaling for the composition to export. All exported images (maps) are scaled to Byte range (0 to 255), and the scaling should achieve that while preserving a relevant distribution of numerical cell values. By default, the Framework assumes that null (nodata) will equal 255 in the scaled export, and that the values 251 to 254 represent colors for overlays, frames and text etc. Values in the range 0 to 250 (or lower) should represent the thematic feature of the layer.

Scaling

The GRACE data is strongly skewed because of the glacier melt in Greenland and West Antarctica. The melting of the glaciers causes a loss in water and thus gravitational pull. Using a linear scale for representing the global change in water equivalent thickness that include the melting glacier thus becomes tricky. I choose to use a solution with a power function to capture both large and small changes. This, however, can be deceptive but you need to choose some legend scaling in order to show your map. The process createscaling adds the scaling to the database.

Palette

Grace palette

If you want to produce color maps showing the GRACE data and the results of your trend analysis, you also need to create the palette(s) to use. All palettes must be saved to the database before use, with the process addrasterpalette. Glancing at the color ramp of the online GRACE data at the official homepage, I set the following palette:

Create Legend

The process createlegend defines the legend layout for compositions. When producing the legends the colors and denominations of the actual legend items are taken from the definition of palettes and scalings respectively.

Export legend

Grace palette

With the process exportlegend you can create stand alone legends. To work you mtust have defined the scaling, the palette and the legend in the previous steps. The process produces two legends, as a Scalable Vector Graphics (.svg file) and a .png file. The svg is saved as a www compliant xml, and you can use it either for editing in a graphics program or inclusion in a web-page (or both).

Export overlay

When you export the actual data as maps in the next step, you can add a vector overlay. In the Framework you can convert any vector to an svg and then include it as an overlay. Only a single svg file can be used as overlay when exporting raster data to image maps. But you can manually compose an svg from multiple svg exported vectors, e.g. using a graphics editor.

For the GRACE data a graticule is exported from a vector file including longitude and latitude lines for each 45 degrees.

Export color map

Having defined the scaling and a palette for the different layers, you can export the layers as color maps (colored GeoTiff images). The process for doing that is exporttobyteancillary.

Maps of the change in water equivalent thickness 2003 to 2016. The top row shows the Ordinary Least Square (OLS) slope and the Theil-Sen (TS) median slope. The bottom row shows the lower and higher 95 % confidence limit for TS slope.