Recipe: python program example2
Jump to navigation
Jump to search
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import CSnative
# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
# are the lat/lon values of the lower left and upper right corners
# of the map.
# resolution = 'c' means use crude resolution coastlines.
m = Basemap(projection='cyl',llcrnrlat=-90,urcrnrlat=90,\
llcrnrlon=0,urcrnrlon=360,resolution='c')
m.drawcoastlines()
# The subscript starts with 0 in python
# Users should specify the time, level, fieldname (var), and filename
Time = 0
Level = 0
var = 'T'
filename='HU_getc180forweyium_c180.geosgcm_prog.20000414_2200z.nc4'
lons, lats, data = CSnative.get_csdata(filename, var, Time, Level);
m.pcolor(lons,lats,data,tri=True)
plt.show()