Jul-24-2017, 08:48 AM
(This post was last modified: Jul-24-2017, 12:43 PM by sparkz_alot.)
victor,
I am amateur in python programing ,what is PM please,
If i change map to polar south or north stereograph. problem is solved but i need world map projec.,
full my code :
I am amateur in python programing ,what is PM please,
If i change map to polar south or north stereograph. problem is solved but i need world map projec.,
full my code :
from netCDF4 import Dataset import numpy as np import os Folder="D:\\MSG Data\\PROCESSED\\sst_nc" for (path, dirs, files) in os.walk(Folder): for dir in dirs: print dir for sst in files: if sst[-3:]=='.nc': file=os.path.join(path,sst) fh = Dataset(file, mode='r') lons = fh.variables['lon'][:] lats = fh.variables['lat'][:] sst = fh.variables['sea_surface_temperature'][:] fh.close() import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap m = Basemap(projection='cyl',lon_0=0,lat_0=0,resolution='c') plt.figure(figsize=(15,7)) xi, yi = m(lons, lats) palette = plt.cm.nipy_spectral cs = m.pcolormesh(xi,yi,np.squeeze(sst),cmap=palette) plt.clim(270,310) m.fillcontinents(color='white') plt.savefig('D:\MSG Data\sst.png', facecolor='white',dpi=300)