Skip to content

Commit 0e2afae

Browse files
author
Jeff Whitaker
committed
clean up addcyclic docstring, fix Changelog entry.
1 parent 9d8191f commit 0e2afae

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Changelog

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version 1.0.8 (not yet released)
22
--------------------------------
3-
* don't assume grid is regular with adding cyclic point in addcyclic.
4-
New kwarg 'cyclic' added, with a default of 360. Partially
5-
addresses issue 139.
3+
* don't assume grid is regular when adding cyclic point in addcyclic.
4+
New kwargs 'axis' and 'cyclic' added. More than one array
5+
can be handled at a time, as long as the last one is longitude. Issue 139.
66
* fix for coastline drawing glitch (issue 123).
77
* update shapefile.py to version 1.2.0 from pyshp.googlecode.com. Add back
88
in modification clobbered in upgrade to version 1.1.7 (issue 30).

lib/mpl_toolkits/basemap/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5089,15 +5089,16 @@ def shiftgrid(lon0,datain,lonsin,start=True,cyclic=360.0):
50895089

50905090
def addcyclic(*arr,**kwargs):
50915091
"""
5092-
Adds cyclic (wraparound) points in longitude to one or several arrays,
5093-
the last array being longitudes in degrees. E.g.
5092+
Adds cyclic (wraparound) points in longitude to one or several arrays,
5093+
the last array being longitudes in degrees. e.g.
50945094
50955095
``data1out, data2out, lonsout = addcyclic(data1,data2,lons)``
50965096
50975097
============== ====================================================
50985098
Keywords Description
50995099
============== ====================================================
5100-
axis the dimension longitude is in (default right-most)
5100+
axis the dimension representing longitude (default -1,
5101+
or right-most)
51015102
cyclic width of periodic domain (default 360)
51025103
============== ====================================================
51035104
"""
@@ -5120,7 +5121,7 @@ def _addcyclic_lon(a):
51205121
# select the right numpy functions
51215122
npsel = np.ma if np.ma.is_masked(a) else np
51225123
# get cyclic longitudes
5123-
clon = (np.take(a,[0],axis=axis)
5124+
clon = (np.take(a,[0],axis=axis)
51245125
+ cyclic * np.sign(np.diff(np.take(a,[0,-1],axis=axis),axis=axis)))
51255126
# ensure the values do not exceed cyclic
51265127
clonmod = npsel.where(clon<=cyclic,clon,np.mod(clon,cyclic))

0 commit comments

Comments
 (0)