I have a file with azimuth, altitude, and measurements at those positions.
Example: Az Alt Value
0 10 5
0 45 7
0 80 10
10 10 4
10 45 7
10 80 11
... ... ...
These points do not map the entire sky, and the plot is very empty. I used scipy griddata to interpolate between the points to fill the plot. I convert to Cartesian coordinates to use griddata with.
#x = azimuth
#y = altitude
x,y = alt * np.cos(az), alt*np.sin(az)
xi = np.linspace(0, 90, 100)
yi = np.linspace(np.radians(10.), np.radians(350.), 100)
zi = griddata((x, y), value, (xi[None,:], yi[:,None]), method='cubic')
ax = plt.subplot(111, projection='polar')
cm = plt.cm.get_cmap('jet_r')
levels = np.linspace(min(value),max(value), 100)
cf = plt.contourf(yi,90-xi,zi.T,levels=levels,cmap=cm)
cbar = plt.colorbar()
cbar.set_ticks(np.arange(15.5,22, .5))
cbar.set_label(r'mag/arcsec$^2$')
ax.set_theta_zero_location('N')
ax.set_theta_direction(-1)
ax.yaxis.grid(False)
#ax.set_rticks([])
ax.scatter(az,90-alt, marker='.', edgecolors='k', facecolors='none')
ax.xaxis.grid(False)
plt.ylim(0,90)
plt.show()
In the plot above, you see that r is 0 in the center with 90 on the edges. I thought I could solve the issue by subtracting my altitudes from 90, however, the data does not seem to match what it should be on the plot.
How can I go around by inverting the r axis to have 0 on the outside and 90 in the center, like with astronomy?
Second, I have 0 at the top, to be like North at the top and invert the rotation to match N,E,S,W azimuth.
However, the plot does not make sense, because at azimuth 225 degrees, the value at 15 degree altitude is 16.5. The plot shows the point measures 18.5. This makes me believe some scaling is being applied incorrectly by myself, or matplotlib.
Any help fixing this is greatly appreciated.