@@ -5089,15 +5089,16 @@ def shiftgrid(lon0,datain,lonsin,start=True,cyclic=360.0):
50895089
50905090def 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