| ipygrads (version 1.0.6) | index /Users/dasilva/src/pygrads/ipygrads.py |
This module defines "magic commands" for using GrADS interactively
from within iPython. This module is usually imported from the
configuration file "ipythonrc-grads". At any time, on-line help is
available with these commands:
help(ipygrads) This document
qref PyGrADS quick reference
examples Some PyGrADS examples
Based on command line arguments supplied by the user, the top level
script "pygrads" defines key environments variables necessary for this
module to start a GrADS connection, defining the global object "ga".
You can use "ga" to interact with GrADS directly:
ga("q config")
However, a number of shortcuts are provided so that rarely one needs
to explicitly type "ga.cmd(...)". The following generic GrADS commands
are available:
clear/c, define, disable, display/d, draw, enable,
Open/o, Print/pp, printim/pim, Set/s, query/q, reinit
Notice that some commands (e.g., "Open") are capitalized to avoid
conflict with standard Python keywords.
In addition, any generic GrADS command can be entered by starting the
line with a period and a space ('. '), for example example
. open model.ctl
. display ps
The following convenience aliases are provided:
cb run cbarn (for color bar script)
sh set gxout shaded
yat run gxyat
These shortcuts run specific methods from module "grads" on the GrADS
object "ga":
dd $name runs the "imp" method, displaying a NumPy array in
GrADS; this is equivalent to
ga.imp('<display>',$name)
eof $name compute EOS using Singular Value Decomposition; the
*time* dimension contains the eofs; this equivalent to:
$name,$name_d,$name_c = ga.eof('$name')
ii $name runs the "imp" method, importing a NumPy array into
GrADS; this is equivalent to
ga.imp("$name",$name)
oo $fname runs the "open" method, setting "fh"
qq $what runs the "query" method, setting "qh"
xx $name runs the "exp" method, returning a NumPy array and an
associated grid with coordinate information.
This magic command is equivalent to
$name = ga.exp("$name")
$lon = $name.grid.lon
$lat = $name.grid.lat
$lev = $name.grid.lev
$time = $name.grid.time
The shortcuts "dd/ii/xx" are somewhat limited interfaces to the
"imp"/"exp" methods as they do not work on expressions; use
"ga.imp()"/"ga.exp()" directly for a more flexible alternative.
For additional information on these and other methods, consult the
documnentation for the main classes:
help('grads')
help('GrADS')
help('GaNum')
help('GaLab')
help('gacm')
| Modules | ||||||
| ||||||
| Functions | ||
| ||
| Data | ||
| HAS_GACM = True HAS_GALAB = True HAS_PIL = True StringTypes = (<type 'str'>, <type 'unicode'>) __version__ = '1.0.6' ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz' ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' cos = <ufunc 'cos'> digits = '0123456789' hexdigits = '0123456789abcdefABCDEF' ip = None letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' lowercase = 'abcdefghijklmnopqrstuvwxyz' newaxis = None octdigits = '01234567' pi = 3.1415926535897931 printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c' punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' sqrt = <ufunc 'sqrt'> uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' whitespace = '\t\n\x0b\x0c\r ' | ||