Hi all! I've tried to plot some (sea ice thickness, snow freeboard etc.)
netcdf-data on Antarctic waters but there seems to be something funny here
since the plot is kind of cut in half or something.
from Scientific.IO.NetCDF import NetCDFFile # Also numpy as np, Basemap etc,
matplotlib as plt.
F = NetCDFFile('data.nc','r')lat = F.variables['nav_lat'][:,0]lon =
F.variables['nev_lon'][0,:]data =
np.ma.masked_where(np.isnan(F.variables['iice_hid'][0,2,:,:]),
F.variables['iice_hid'][0,2,:,:])m =
Basemap(projection='spaeqd',boundinglat=-50,lon_0=180,resolution='l')lons, lats
= np.meshgrid(lon,lat)fig =
plt.figure()m.pcolormesh(lons,lats,data,latlon=True,vmin=0,vmax=2.3)m2.drawcoastlines()plt.show()
Unfortunately I can't provide any data, but the dimensions are:x=1442; y=1021;
icethi(=layers)=5; time_counter=1Longitudes are like (y,x), in degrees_east,
min -180 and max 180Latitudes are (y,x), in degrees_north, min -77, max 89Data
(the one to draw) is (time_counter,icethi,y,x).
Without meshgrid there is a RuntimeError: Buffer lengths not the same. Also
I've tried many other projections like spstere, laea,splaea... With addcyclic
the result looks exactly the same so that can't be the problem either. The
netcdf file doesn't contain any more information about coordinate systems or
projection, just that lon and lat model is in "Default grid" what ever that
means. I would be very thankful if anyone can help me or give me a glue, from
where to look for a solution
Cheers, Bill!
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users