PyNGL Home > Functions > Lat/Lon manipulators

Ngl.add_cyclic

Adds cyclic points to an array.

Prototype

datap = Ngl.add_cyclic(data, longitude=None)

Arguments

data

A two-dimensional array to which you want to add a cyclic point in the rightmost dimension.

longitude=None

An optional one-dimensional array, representing longitude values, that you want to add a cyclic point to.

Return value

datap

A NumPy array of the same type as data with one more element in the rightmost dimension.

Description

This function adds a cyclic point in the rightmost dimension (longitude dimension) to a 2D array. If there is also a 1D lon coordinate array that you want to add a cyclic point to (as an optional second argument), it adds 360 to the first coordinate value of that array to create the cyclic point.

If the optional second argument is not present, then the function returns a 2D array created from the input array and having cyclic points added. If the optional second argument is present, then the function returns both the augmented 2D array as well as a 1D array created from the 1D array supplied.

As of version 1.3.0, if data is a masked array, then a masked array will be returned.

Examples

See ngl09p.py, ngl11p.py, streamline.py, vector_pop.py.