Saturday, May 3, 2014

Script: Colormaps.gs; very easily create elegant color scales for your plots using GrADS

 NEW VERSION AVAILABLE HERE:
Version 2

If you are a frequent visitor to this site you probably know that I focus a lot of my effort into color scales.  I often reference the color.gs script as a must have script in ones script library.  I have additionally added the script colorset.gs to the script library for use with common remote sensing color scales.  This script here is similar to colorset.gs, but different in the sense that it gives the user control as to what number scale the color map will be set to.  colormap.gs currently includes 21 color scales (with the option of reversing them).  These scales are shown below.

Colorscales included in colormaps.gs

Optional Arguments for colormaps.gs
  • -demo             - Pulls up Demo page
  •  -flipped          - Reverses direction of color scale
  •  -name/map     - chooses colormap
  •  -levels/l          - sets scale: max min int
  • -help                - Pulls up help page (includes full list of color maps)

Example: Open WRF data and plot the 2 meter dew point using the  reversed "ocean" color map

  'sdfopen
http://nomads.ncep.noaa.gov:9090/dods/hiresw/hiresw20140503/hiresw_eastarw_00z'
  'set gxout shaded'
  'clear'
  'set mpdset hires'
  ' colormaps -flipped -l 265 310 1 -map ocean'
  'd dpt2m'

  'cbar'

This series of commands will produce the following image.

2m Dew Point using "Ocean" colormap

This is the first version, so check for bugs and please report any you find!
Enjoy!