So I have sky data in azimuth and elevation (imported from matlab) that is ‘binned’ in 3 deg x 3 deg samples. So the matrix is 30 x 120 (3×30=90 deg of el, 3×120=360 of az). Each elevation, 0, 3, 6, …, 87, has 120 azimuth values associated with it…
However, as you get closer to the zenith you really don’t want 120 cells (az cols): As you move up in el, 3 deg of az represents a larger and larger portion of the sky. The final row of the data only has 3 non-zero values that essentially map to az 0-120, 120-240, and 240-360 @ an elevation of 87-90 deg.
So the matrix contains more and more 0’s as you go from row 0 (which is el 0-3 deg) to row 29 (el 87-90 deg). Data is here.
I want to plot this on a polar plot, but I don’t know how to use contour or pcolor to plot these irregular grids (where the color is set by the value in the matrix).
I’ve tried:
epfd = np.loadtxt("data.txt")
azimuths = np.radians(np.arange(0, 360, 3))
els = np.arange(0,90,3)
r, theta = np.meshgrid(els, azimuths)
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'))
im = ax.contourf(theta, r,epfd.T,norm=mpl.colors.LogNorm())
ax.set_theta_direction(-1)
ax.set_theta_offset(np.pi / 2.0)
ax.invert_yaxis()
But that results in
Thanks for your ideas.