I know how to plot contours on basemap using netcdf files. However, I have a bunch of points corresponding with a correlation value saved in a text file that I would like to plot their contours on a basemap.
Here are the data (first lines):
lons lats correl
262.203 82.0331 nan
262.79 82.0338 0.084949063
263.368 82.0338 0.091800957
263.955 82.033 0.095236276
and here is my code so far:
lons, lats, cor=np.loadtxt(correl_map, unpack=True, skiprows=1)
plt.figure(figsize=(10,10))
plt.subplot()
m = Basemap(width=1200000, height=900000,resolution='h'\
,projection='npaeqd', boundinglat=70, lon_0=0)
m.drawcoastlines()
x,y = m(lons, lats)
cs=map.contour(x,y, cor)
plt.show()
I tried different ways of plotting contours, and for each I get many different errors. For the simplest code above, I am getting this error:
Traceback (most recent call last): File "plot.py", line 25, in lons, lats, correl=np.loadtxt(correl_map, unpack=True, skiprows=1) ValueError: too many values to unpack
I would appreciate any help.