Home > Net >  Density map of lines based on points on a half sphere
Density map of lines based on points on a half sphere

Time:09-25

I am running a simulation that outputs the alt and az poistion of various objects for each timestep. I am able to plot them as lines, but i am running into two issues trying to make a density plot out of them.

  1. it seems the densityplot is based on the points and not on the lines

  2. the area on the half sphere is not equal area

maybe i have to transform the data from alt/az to x,y?

data can be found enter image description here

With the following code to plot:

# plot lines and heatmap side by side
fig, (ax, bx) = plt.subplots(figsize=(20, 8), subplot_kw=dict(projection='polar'), ncols=2)

ticks = np.linspace(0, rmax, 7) # 6 ticks   last edge

# Plot unmodified data with 90 close to center and 0 outside, for verification
ax.plot(df['starlink_az'].transform(np.deg2rad), df['starlink_alt'], linestyle='solid', linewidth=.1)
ax.set_rlim(rmax, 0)
ax.set_yticks(ticks)
ax.set_theta_zero_location('N')

# Plot histogram data with 0 close to center and 90 at outside
grid = np.meshgrid(np.arange(0, 2 * np.pi   abin / 2, abin), np.arange(0, 90   rbin / 2, rbin))
pc = bx.pcolormesh(*grid, hist, cmap="jet")

bx.set_rlim(0, rmax)
bx.set_yticks(ticks)
# Invert tick display as we inverted values: 0 outside, 90 in the center
bx.set_yticklabels(ticks[::-1])
bx.set_theta_zero_location('N')

fig.colorbar(pc)

plt.show()
  • Related