import numpy
import random
import Ngl

xAxis = numpy.array(range(0,380,20))
yAxis = numpy.array(range(-90,100,10))

values = numpy.ones((yAxis.shape[0],xAxis.shape[0]))

#random values for all 0 < lon < 180 (constant ones for lon >= 180 and lon = 0  )
for i in range(yAxis.shape[0]):
    for j in range(xAxis.shape[0]):
        if 0 < xAxis[j] < 180:
            values[i,j] = random.randint(0,10)

#create first plot test.eps
wks = Ngl.open_wks("eps","test")
resources = Ngl.Resources()
resources.sfXArray = xAxis
resources.sfYArray = yAxis
resources.cnInfoLabelOn = False
resources.cnLineLabelsOn = False
resources.cnFillOn = True

Ngl.contour_map(wks,values,resources)

#set new value in constant area
values[5,15] = 5

#create second plot test2.eps
wks2 = Ngl.open_wks("eps","test2")
Ngl.contour_map(wks2,values,resources)

# third plot with 0 completely on the left and constant field for lon >=180
values[5,15] = 1
resources.mpCenterLonF = 180
wks3 = Ngl.open_wks("eps","test3")
Ngl.contour_map(wks3,values,resources)

Ngl.end()

