395 lines (367 with data), 37.3 kB
@header@
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.<a href="matplotlib.toolkits.html"><font color="#ffffff">toolkits</font></a>.<a href="matplotlib.toolkits.basemap.html"><font color="#ffffff">basemap</font></a>.basemap</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py">/usr/lib/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="matplotlib.numerix.ma.html">matplotlib.numerix.ma</a><br>
<a href="math.html">math</a><br>
</td><td width="25%" valign=top><a href="numarray.nd_image.html">numarray.nd_image</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="pylab.html">pylab</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="matplotlib.toolkits.basemap.basemap.html#Basemap">Basemap</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Basemap">class <strong>Basemap</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt> Set up a basemap with one of 17 supported map projections<br>
(cylindrical equidistant, mercator, polyconic, oblique mercator,<br>
transverse mercator, miller cylindrical, lambert conformal conic,<br>
azimuthal equidistant, equidistant conic, lambert azimuthal equal area,<br>
albers equal area conic, gnomonic, orthographic, mollweide,<br>
robinson, cassini-soldner or stereographic).<br>
Doesn't actually draw anything, but sets up the map projection class and<br>
creates the coastline and political boundary polygons in native map <br>
projection coordinates. Requires matplotlib and numarray.<br>
Uses a pyrex interface to C-code from proj.4 (<a href="http://proj.maptools.org">http://proj.maptools.org</a>).<br>
<br>
Useful instance variables:<br>
<br>
projection - map projection ('cyl','merc','mill','lcc','eqdc','aea','aeqd',<br>
'laea', 'tmerc', 'omerc', 'cass', 'gnom', 'poly', 'ortho', 'robin',<br>
'moll' or 'stere')<br>
aspect - map aspect ratio (size of y dimension / size of x dimension).<br>
llcrnrlon - longitude of lower left hand corner of the desired map domain.<br>
llcrnrlon - latitude of lower left hand corner of the desired map domain. <br>
urcrnrlon - longitude of upper right hand corner of the desired map domain.<br>
urcrnrlon - latitude of upper right hand corner of the desired map domain.<br>
llcrnrx,llcrnry,urcrnrx,urcrnry - corners of map domain in projection coordinates.<br>
rmajor,rminor - equatorial and polar radii of ellipsoid used (in meters).<br>
<br>
Example Usage:<br>
(this example plus others can be found in the examples directory of<br>
the source distribution)<br>
<br>
>>> from matplotlib.toolkits.basemap import <a href="#Basemap">Basemap</a><br>
>>> import cPickle<br>
>>> from pylab import *<br>
>>> # read in topo data from pickle (on a regular lat/lon grid)<br>
>>> topodict = cPickle.load(open('etopo20.pickle','rb'))<br>
>>> etopo = topodict['data']; lons = topodict['lons']; lats = topodict['lats']<br>
>>> # create <a href="#Basemap">Basemap</a> instance for Robinson projection.<br>
>>> m = <a href="#Basemap">Basemap</a>(projection='robin',lon_0=0.5*(lons[0]+lons[-1]))<br>
>>> # compute native map projection coordinates for lat/lon grid.<br>
>>> x, y = m(*meshgrid(lons,lats))<br>
>>> # create figure with same aspect ratio as map.<br>
>>> figure(figsize=(10,m.aspect*10)).add_axes([0.1,0.1,0.8,0.8],frameon=False)<br>
>>> # make filled contour plot.<br>
>>> levels, colls = m.<a href="#Basemap-contourf">contourf</a>(x,y,etopo,30,cmap=cm.jet,colors=None)<br>
>>> m.<a href="#Basemap-drawcoastlines">drawcoastlines</a>() # draw coastlines<br>
>>> m.<a href="#Basemap-drawmapboundary">drawmapboundary</a>() # draw a line around the map region<br>
>>> m.<a href="#Basemap-drawparallels">drawparallels</a>(arange(-90.,120.,30.),labels=[1,0,0,0]) # draw parallels<br>
>>> m.<a href="#Basemap-drawmeridians">drawmeridians</a>(arange(0.,420.,60.),labels=[0,0,0,1]) # draw meridians<br>
>>> title('Robinson Projection') # add a title<br>
>>> show()<br>
<br>
Version: 0.5 (20050602)<br>
Contact: Jeff Whitaker <jeffrey.s.whitaker@noaa.gov><br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Basemap-__call__"><strong>__call__</strong></a>(self, x, y, inverse<font color="#909090">=False</font>)</dt><dd><tt>Calling a <a href="#Basemap">Basemap</a> class instance with the arguments lon, lat will<br>
convert lon/lat (in degrees) to x/y native map projection <br>
coordinates (in meters). If optional keyword 'inverse' is<br>
True (default is False), the inverse transformation from x/y<br>
to lon/lat is performed.<br>
<br>
For cylindrical equidistant projection ('cyl'), this<br>
does nothing (i.e. x,y == lon,lat).<br>
<br>
lon,lat can be either scalar floats or N arrays.</tt></dd></dl>
<dl><dt><a name="Basemap-__init__"><strong>__init__</strong></a>(self, llcrnrlon<font color="#909090">=-180.0</font>, llcrnrlat<font color="#909090">=-90.0</font>, urcrnrlon<font color="#909090">=180.0</font>, urcrnrlat<font color="#909090">=90.0</font>, projection<font color="#909090">='cyl'</font>, resolution<font color="#909090">='c'</font>, area_thresh<font color="#909090">=10000.0</font>, rsphere<font color="#909090">=6370997</font>, lat_ts<font color="#909090">=None</font>, lat_1<font color="#909090">=None</font>, lat_2<font color="#909090">=None</font>, lat_0<font color="#909090">=None</font>, lon_0<font color="#909090">=None</font>, lon_1<font color="#909090">=None</font>, lon_2<font color="#909090">=None</font>, suppress_ticks<font color="#909090">=True</font>)</dt><dd><tt>create a <a href="#Basemap">Basemap</a> instance.<br>
<br>
arguments:<br>
<br>
projection - map projection. 'cyl' - cylindrical equidistant, 'merc' -<br>
mercator, 'lcc' - lambert conformal conic, 'stere' - stereographic,<br>
'aea' - albers equal area conic, 'tmerc' - transverse mercator, <br>
'aeqd' - azimuthal equidistant, 'mill' - miller cylindrical,<br>
'eqdc' - equidistant conic, 'laea' - lambert azimuthal equal area,<br>
'cass' - cassini-soldner (transverse cylindrical equidistant),<br>
'poly' - polyconic, 'omerc' - oblique mercator, 'ortho' - orthographic,<br>
'moll' - mollweide, 'robin' - robinson,<br>
and 'gnom' - gnomonic are currently available. Default 'cyl'.<br>
<br>
llcrnrlon - longitude of lower left hand corner of the desired map domain<br>
(Default -180).<br>
llcrnrlat - latitude of lower left hand corner of the desired map domain <br>
(Default -90).<br>
urcrnrlon - longitude of upper right hand corner of the desired map domain<br>
(Default 180).<br>
urcrnrlat - latitude of upper right hand corner of the desired map domain<br>
(Default 90).<br>
<br>
If the orthographic, mollweide or robinson projection is chosen <br>
the values of llcrnrlon,llcrnrlat,urcrnrlon and urcrnrlat are ignored,<br>
and the entire projection domain will be always be plotted.<br>
<br>
resolution - resolution of coastline database to use. Can be 'c' (crude), <br>
'l' (low), or 'i' (intermediate). Resolution drops off by roughly 80%<br>
between datasets. Higher res datasets are much slower to draw.<br>
Default 'c'. Coastline data is from the GSHHS<br>
(<a href="http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html">http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html</a>).<br>
<br>
area_thresh - coastline with an area smaller than area_thresh in km^2<br>
will not be plotted. Default 10,000.<br>
<br>
rsphere - radius of the sphere used to define map projection (default<br>
6370997 meters, close to the arithmetic mean radius of the earth). If<br>
given as a sequence, the first two elements are interpreted as<br>
the the radii of the major and minor axes of an ellipsoid. Note: sometimes<br>
an ellipsoid is specified by the major axis and an 'inverse flattening<br>
parameter' (if). The minor axis (b) can be computed from the major axis (a) <br>
and the inverse flattening parameter using the formula if = a/(a-b).<br>
<br>
suppress_ticks - suppress automatic drawing of axis ticks and labels<br>
in map projection coordinates. Default False, so parallels and meridians<br>
can be labelled instead. If parallel or meridian labelling is requested<br>
(using drawparallels and drawmeridians methods), automatic tick labelling<br>
will be supressed even is suppress_ticks=False. Typically, you will<br>
only want to override the default if you want to label the axes in meters<br>
using native map projection coordinates.<br>
<br>
The following parameters are map projection parameters which all default to <br>
None. Not all parameters are used by all projections, some are ignored.<br>
<br>
lat_ts - latitude of natural origin (used for mercator and stereographic<br>
projections).<br>
lat_1 - first standard parallel for lambert conformal, albers<br>
equal area projection and equidistant conic projections. Latitude of one<br>
of the two points on the projection centerline for oblique mercator.<br>
lat_2 - second standard parallel for lambert conformal, albers<br>
equal area projection and equidistant conic projections. Latitude of one<br>
of the two points on the projection centerline for oblique mercator.<br>
lon_1 - Longitude of one of the two points on the projection centerline<br>
for oblique mercator.<br>
lon_2 - Longitude of one of the two points on the projection centerline<br>
for oblique mercator.<br>
lat_0 - central latitude (y-axis origin) - used by stereographic, polyconic, <br>
transverse mercator, miller cylindrical, cassini-soldner, oblique mercator,<br>
gnomonic, equidistant conic, orthographic and lambert azimuthal projections).<br>
lon_0 - central meridian (x-axis origin) - used by stereographic, polyconic, <br>
transverse mercator, miller cylindrical, cassini-soldner, mollweide, robinson,<br>
gnomonic, equidistant conic, orthographic and lambert azimuthal projections).</tt></dd></dl>
<dl><dt><a name="Basemap-contour"><strong>contour</strong></a>(self, x, y, data, *args, **kwargs)</dt><dd><tt>Make a contour plot over the map (see pylab contour documentation).</tt></dd></dl>
<dl><dt><a name="Basemap-contourf"><strong>contourf</strong></a>(self, x, y, data, *args, **kwargs)</dt><dd><tt>Make a filled contour plot over the map (see pylab documentation).</tt></dd></dl>
<dl><dt><a name="Basemap-drawcoastlines"><strong>drawcoastlines</strong></a>(self, linewidth<font color="#909090">=1.0</font>, color<font color="#909090">='k'</font>, antialiased<font color="#909090">=1</font>)</dt><dd><tt>Draw coastlines.<br>
<br>
linewidth - coastline width (default 1.)<br>
color - coastline color (default black)<br>
antialiased - antialiasing switch for coastlines (default True).</tt></dd></dl>
<dl><dt><a name="Basemap-drawcountries"><strong>drawcountries</strong></a>(self, linewidth<font color="#909090">=0.5</font>, color<font color="#909090">='k'</font>, antialiased<font color="#909090">=1</font>)</dt><dd><tt>Draw country boundaries.<br>
<br>
linewidth - country boundary line width (default 0.5)<br>
color - country boundary line color (default black)<br>
antialiased - antialiasing switch for country boundaries (default True).</tt></dd></dl>
<dl><dt><a name="Basemap-drawgreatcircle"><strong>drawgreatcircle</strong></a>(self, lon1, lat1, lon2, lat2, dtheta<font color="#909090">=0.02</font>, **kwargs)</dt><dd><tt>draw a great circle on the map.<br>
<br>
lon1,lat1 - longitude,latitude of one endpoint of the great circle.<br>
lon2,lat2 - longitude,latitude of the other endpoint of the great circle.<br>
dtheta - points on great circle computed every dtheta radians (default 0.02).<br>
<br>
Other keyword arguments (**kwargs) control plotting of great circle line,<br>
see pylab plot documentation for details.<br>
<br>
Note: cannot handle situations in which the great circle intersects<br>
the edge of the map projection domain, and then re-enters the domain.</tt></dd></dl>
<dl><dt><a name="Basemap-drawmapboundary"><strong>drawmapboundary</strong></a>(self, color<font color="#909090">='k'</font>, linewidth<font color="#909090">=1.0</font>)</dt><dd><tt>draw boundary around map projection region</tt></dd></dl>
<dl><dt><a name="Basemap-drawmeridians"><strong>drawmeridians</strong></a>(self, meridians, color<font color="#909090">='k'</font>, linewidth<font color="#909090">=1.0</font>, linestyle<font color="#909090">='--'</font>, dashes<font color="#909090">=[1, 1]</font>, labels<font color="#909090">=[0, 0, 0, 0]</font>, font<font color="#909090">='rm'</font>, fontsize<font color="#909090">=12</font>, xoffset<font color="#909090">=None</font>, yoffset<font color="#909090">=None</font>)</dt><dd><tt>draw meridians (longitude lines).<br>
<br>
meridians - list containing longitude values to draw (in degrees).<br>
color - color to draw meridians (default black).<br>
linewidth - line width for meridians (default 1.)<br>
linestyle - line style for meridians (default '--', i.e. dashed).<br>
dashes - dash pattern for meridians (default [1,1], i.e. 1 pixel on,<br>
1 pixel off).<br>
labels - list of 4 values (default [0,0,0,0]) that control whether<br>
meridians are labelled where they intersect the left, right, top or <br>
bottom of the plot. For example labels=[1,0,0,1] will cause meridians<br>
to be labelled where they intersect the left and bottom of the plot,<br>
but not the right and top. Labels are drawn using mathtext.<br>
font - mathtext font used for labels ('rm','tt','it' or 'cal', default 'rm').<br>
fontsize - font size in points for labels (default 12).<br>
xoffset - label offset from edge of map in x-direction<br>
(default is 0.01 times width of map in map projection coordinates).<br>
yoffset - label offset from edge of map in y-direction<br>
(default is 0.01 times height of map in map projection coordinates).</tt></dd></dl>
<dl><dt><a name="Basemap-drawparallels"><strong>drawparallels</strong></a>(self, circles, color<font color="#909090">='k'</font>, linewidth<font color="#909090">=1.0</font>, linestyle<font color="#909090">='--'</font>, dashes<font color="#909090">=[1, 1]</font>, labels<font color="#909090">=[0, 0, 0, 0]</font>, font<font color="#909090">='rm'</font>, fontsize<font color="#909090">=12</font>, xoffset<font color="#909090">=None</font>, yoffset<font color="#909090">=None</font>)</dt><dd><tt>draw parallels (latitude lines).<br>
<br>
circles - list containing latitude values to draw (in degrees).<br>
color - color to draw parallels (default black).<br>
linewidth - line width for parallels (default 1.)<br>
linestyle - line style for parallels (default '--', i.e. dashed).<br>
dashes - dash pattern for parallels (default [1,1], i.e. 1 pixel on,<br>
1 pixel off).<br>
labels - list of 4 values (default [0,0,0,0]) that control whether<br>
parallels are labelled where they intersect the left, right, top or <br>
bottom of the plot. For example labels=[1,0,0,1] will cause parallels<br>
to be labelled where they intersect the left and bottom of the plot,<br>
but not the right and top. Labels are drawn using mathtext.<br>
font - mathtext font used for labels ('rm','tt','it' or 'cal', default 'rm').<br>
fontsize - font size in points for labels (default 12).<br>
xoffset - label offset from edge of map in x-direction<br>
(default is 0.01 times width of map in map projection coordinates).<br>
yoffset - label offset from edge of map in y-direction<br>
(default is 0.01 times height of map in map projection coordinates).</tt></dd></dl>
<dl><dt><a name="Basemap-drawstates"><strong>drawstates</strong></a>(self, linewidth<font color="#909090">=0.5</font>, color<font color="#909090">='k'</font>, antialiased<font color="#909090">=1</font>)</dt><dd><tt>Draw state boundaries in Americas.<br>
<br>
linewidth - state boundary line width (default 0.5)<br>
color - state boundary line color (default black)<br>
antialiased - antialiasing switch for state boundaries (default True).</tt></dd></dl>
<dl><dt><a name="Basemap-fillcontinents"><strong>fillcontinents</strong></a>(self, color<font color="#909090">=0.80000000000000004</font>)</dt><dd><tt>Fill continents.<br>
<br>
color - color to fill continents (default gray).<br>
<br>
After filling continents, lakes are re-filled with axis background color.</tt></dd></dl>
<dl><dt><a name="Basemap-gcpoints"><strong>gcpoints</strong></a>(self, lon1, lat1, lon2, lat2, npoints)</dt><dd><tt>compute npoints points along a great circle with endpoints<br>
(lon1,lat1) and (lon2,lat2). Returns numarrays x,y<br>
with map projection coordinates.</tt></dd></dl>
<dl><dt><a name="Basemap-imshow"><strong>imshow</strong></a>(self, *args, **kwargs)</dt><dd><tt>Display an image over the map (see pylab imshow documentation).<br>
extent and origin keywords set automatically so image will be drawn<br>
over map region.</tt></dd></dl>
<dl><dt><a name="Basemap-makegrid"><strong>makegrid</strong></a>(self, nx, ny, returnxy<font color="#909090">=False</font>)</dt><dd><tt>return arrays of shape (ny,nx) containing lon,lat coordinates of<br>
an equally spaced native projection grid.<br>
if returnxy = True, the x,y values of the grid are returned also.</tt></dd></dl>
<dl><dt><a name="Basemap-pcolor"><strong>pcolor</strong></a>(self, x, y, data, **kwargs)</dt><dd><tt>Make a pseudo-color plot over the map.<br>
see pylab pcolor documentation for definition of **kwargs</tt></dd></dl>
<dl><dt><a name="Basemap-plot"><strong>plot</strong></a>(self, *args, **kwargs)</dt><dd><tt>Draw lines and/or markers on the map (see pylab plot documentation).</tt></dd></dl>
<dl><dt><a name="Basemap-quiver"><strong>quiver</strong></a>(self, x, y, u, v, scale<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>Make a vector plot (u, v) with arrows on the map projection grid (x,y)<br>
If scale is specified, it is used to scale the vectors. If scale=None <br>
(default) arrows are scaled to longest one is equal to the maximum<br>
distance between grid points. <br>
<br>
Extra keyword arguments (**kwargs) passed to pylab.quiver (see pylab <br>
quiver documentation for details).</tt></dd></dl>
<dl><dt><a name="Basemap-rotate_vector"><strong>rotate_vector</strong></a>(self, uin, vin, lons, lats, returnxy<font color="#909090">=False</font>)</dt><dd><tt>rotate a vector field (uin,vin) on a rectilinear lat/lon grid<br>
with longitudes = lons and latitudes = lats from geographical into map<br>
projection coordinates.<br>
<br>
Differs from transform_vector in that no interpolation is done,<br>
the vector is returned on the same lat/lon grid, but rotated into<br>
x,y coordinates.<br>
<br>
lons, lats must be rank-2 arrays containing longitudes and latitudes<br>
(in degrees) of grid.<br>
<br>
if returnxy=True, the x and y values of the lat/lon grid <br>
are also returned (default False).<br>
<br>
The input vector field is defined in spherical coordinates (it<br>
has eastward and northward components) while the output<br>
vector field is rotated to map projection coordinates (relative<br>
to x and y). The magnitude of the vector is preserved.</tt></dd></dl>
<dl><dt><a name="Basemap-scatter"><strong>scatter</strong></a>(self, *args, **kwargs)</dt><dd><tt>Plot points with markers on the map (see pylab scatter documentation).</tt></dd></dl>
<dl><dt><a name="Basemap-set_axes_limits"><strong>set_axes_limits</strong></a>(self)</dt><dd><tt>Set axis limits for map domain using current axes instance.</tt></dd></dl>
<dl><dt><a name="Basemap-transform_scalar"><strong>transform_scalar</strong></a>(self, datin, lons, lats, nx, ny, returnxy<font color="#909090">=False</font>, **kwargs)</dt><dd><tt>interpolate a scalar field (datin) from a lat/lon grid with longitudes =<br>
lons and latitudes = lats to a (ny,nx) native map projection grid.<br>
<br>
lons, lats must be rank-1 arrays containing longitudes and latitudes<br>
(in degrees) of datin grid in increasing order<br>
(i.e. from Greenwich meridian eastward, and South Pole northward).<br>
<br>
if returnxy=True, the x and y values of the native map projection grid<br>
are also returned.<br>
<br>
See interp documentation for meaning of extra keyword arguments (**kwargs).<br>
<br>
data on a lat/lon grid must be transformed to map projection coordinates<br>
before it can be plotted on the map with imshow.</tt></dd></dl>
<dl><dt><a name="Basemap-transform_vector"><strong>transform_vector</strong></a>(self, uin, vin, lons, lats, nx, ny, returnxy<font color="#909090">=False</font>, **kwargs)</dt><dd><tt>rotate and interpolate a vector field (uin,vin) from a lat/lon grid<br>
with longitudes = lons and latitudes = lats to a <br>
(ny,nx) native map projection grid.<br>
<br>
lons, lats must be rank-1 arrays containing longitudes and latitudes<br>
(in degrees) of datin grid in increasing order<br>
(i.e. from Greenwich meridian eastward, and South Pole northward).<br>
<br>
The input vector field is defined in spherical coordinates (it<br>
has eastward and northward components) while the output<br>
vector field is rotated to map projection coordinates (relative<br>
to x and y). The magnitude of the vector is preserved.<br>
<br>
if returnxy=True, the x and y values of the native map projection grid<br>
are also returned (default False).<br>
<br>
See interp documentation for meaning of extra keyword arguments (**kwargs).</tt></dd></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-addcyclic"><strong>addcyclic</strong></a>(arrin, lonsin)</dt><dd><tt>Add cyclic (wraparound) point in longitude.</tt></dd></dl>
<dl><dt><a name="-interp"><strong>interp</strong></a>(datain, lonsin, latsin, lonsout, latsout, checkbounds<font color="#909090">=False</font>, mode<font color="#909090">='nearest'</font>, cval<font color="#909090">=0.0</font>, order<font color="#909090">=3</font>)</dt><dd><tt>dataout = <a href="#-interp">interp</a>(datain,lonsin,latsin,lonsout,latsout,mode='constant',cval=0.0,order=3)<br>
<br>
interpolate data (datain) on a rectilinear lat/lon grid (with lons=lonsin<br>
lats=latsin) to a grid with lons=lonsout, lats=latsout.<br>
<br>
datain is a rank-2 array with 1st dimension corresponding to longitude,<br>
2nd dimension latitude.<br>
<br>
lonsin, latsin are rank-1 arrays containing longitudes and latitudes<br>
of datain grid in increasing order (i.e. from Greenwich meridian eastward, and<br>
South Pole northward)<br>
<br>
lonsout, latsout are rank-2 arrays containing lons and lats of desired<br>
output grid (typically a native map projection grid).<br>
<br>
If checkbounds=True, values of lonsout and latsout are checked to see that<br>
they lie within the range specified by lonsin and latsin. Default is<br>
False, and values outside the borders are handled in the manner described<br>
by the 'mode' parameter (default mode='nearest', which means the nearest<br>
boundary value is used). See section 20.2 of the numarray docs for <br>
information on the 'mode' keyword.<br>
<br>
See numarray.nd_image.map_coordinates documentation for information on<br>
the other optional keyword parameters. The order keyword can be 0 <br>
for nearest neighbor interpolation (nd_image only allows 1-6) - if<br>
order=0 bounds checking is done even if checkbounds=False.</tt></dd></dl>
<dl><dt><a name="-shiftgrid"><strong>shiftgrid</strong></a>(lon0, datain, lonsin, start<font color="#909090">=True</font>)</dt><dd><tt>shift global lat/lon grid east or west.<br>
assumes wraparound (or cyclic point) is included.<br>
<br>
lon0: starting longitude for shifted grid <br>
(ending longitude if start=False). lon0 must be on<br>
input grid (with the range of lonsin).<br>
datain: original data.<br>
lonsin: original longitudes.<br>
start[True]: if True, lon0 represents he starting longitude <br>
of the new grid. if False, lon0 is the ending longitude.<br>
<br>
returns dataout,lonsout (data and longitudes on shifted grid).</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>matplotlib_version</strong> = '0.81'<br>
<strong>numarray_version</strong> = '1.3.2'</td></tr></table>
@footer@