Thursday, May 2, 2013

A list of a few (very) useful GrADS scripts

As my second post, I am including a list of what I consider to be essential GrADS scripts for everyone's script library.  This list of scripts is not a master list containing script useful for a large number of unique GrADS applications, but rather a list of general scripts that are applicable to a wide range of uses.  Basically, scripts that everyone should have in their script folder.

Now, often times its nice to just put these scripts in the main GrADS folder, but I have a lot of my own scripts in there, so I made a separate sub-folder to contain these scripts, as they are often used in ALL of my other scripts, so it's nice to separate them.  Just remember, if you do this, you will need to include to full file path in your GrADS script; e.g., your command would be: 'useful_scripts/script.gs' vs. 'script.gs'.


Colors and Color definition
  • Rgbset.gs 
    • This script is a basic script that defines a number of different colors and color shades, greatly increasing your color options is included with the basic color set defined when you start the program.
  • Color.gs
    • This is perhaps the most useful script for defining colors for GrADS available on the internet.  This script makes it easy to construct detailed and continuous color scales without having to write out long and complicated lists using the 'set clevs' and 'set ccols' command.  Color.gs can be used to make the plot below using the following set of commands:
                    'color -30 110 1 -kind white->fuchsia->indigo->blue->cyan->yellow->red->darkred'  
                    'd sfctemp' 
Surface temperature plotted on a continuous scale using color.gs


Color Bars
  •  Cbar.gs
    • This script plots a very basic color bar either below, or to the right of your plot based on where you have the most available space.  This is perhaps the simplest way to plot a color bar in GrADS as it does not require you to pass any additional information.  However with simplicity comes limitations, more advanced color bar options will be addressed later on.
      • Other basic color bar scripts include:
        • cbarn.gs (plots color bar with triangular ends -also a few command options)
        • cbarm.gs   (same as cbarn, but better used with lots of colors -also a few command options)
        • cbarc.gs (plots color bar as a fan in the corner. Example Here)
        • diamondbar.gs (recently added to the GrADS-aholic script library.)
      • While you certainly do not need all of these scripts in your library, they can certainly be useful from time to time 
       

  • Xcbar.gs 
    • This is another script from the folks who brought you color.gs, this script is very useful as it gives you nearly fully control of your color bar, from where it goes, to the type of ends it has, to how even text is plotted next to it, to whether or not it has lines, etc.  As you may have guessed, the color bar plotted in the surface temperature image was made with xcbar.gs.

Other Useful Scripts
  • Hatch.gs 
    • This is another script from the group that developed color.gs and xcbar.gs.  This script is very useful if you want to include "hatching" in your plots.  This script is great, and includes a lot of versatility regarding the hatching style.  I included an example image made using hatch.gs.  The major disadvantage to this script is that it is obnoxiously slow.  Therefore I don't recommend it for use with operational plotting (as this will take forever with more than one or two timesteps), but rather for making figures for papers or presentations.
       
      Example of Hatched plot using hatch.gs

  • Basemap.gs
    • Basemap.gs is great for plotting base maps (more on base maps here).  This script (with associated .asc files) fills in land and water with different colors.  
That's all the basic scripts that I can think of for now.  Again, these are not necessarily scripts that are designed for specific purposes (e.g., plotting a sounding), but rather scripts that can be used to expand the plotting capability of the program itself.  Furthermore, many of the scripts that I upload to this site will require these scripts to function properly.  A more extensive list of scripts can be found here.

No comments:

Post a Comment