Skip to content

Commit

Permalink
including echo strength coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoertvv committed Jun 8, 2022
1 parent 1a91723 commit 91cab01
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions hellolancel/plot_skymaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@



def sky_fin():
def sky_fin(fill_nu='cyan'):
# plot the plane in RA Dec
for lb in [-1*min_b, min_b]:
bb = np.repeat(lb, 2000)
ll = np.linspace(0.1,359, len(bb))
rr, dd =sjoert.stellar.lbtoradec(ll, bb)
plt.plot(rr, dd, '.', ms=1, color='grey', zorder=1)
isort = np.argsort(rr)
plt.plot(rr[isort], dd[isort], '-', ms=1, color='grey', zorder=0, lw=1)

cc = iceberg['area']
#plt.scatter(iceberg['RA'], iceberg['Dec'], s=cc,marker='o', edgecolor='k', facecolor='cyan')
Expand All @@ -28,7 +29,7 @@ def sky_fin():
rectangl1= plt.Rectangle( (ic['RA']-ic['RA_min'],ic['Dec']-ic['Dec_min']),
ic['RA_min']+ic['RA_plus'],
ic['Dec_min']+ic['Dec_plus'],
facecolor='cyan',
facecolor=fill_nu,
lw=0.5,
edgecolor='k')

Expand All @@ -42,7 +43,7 @@ def sky_fin():

plt.close()
plt.figure(1,(8,4))
plt.plot(data_ac['ra'], data_ac['dec'], 'xk', alpha=0.9)
line = plt.plot(data_ac['ra'], data_ac['dec'], 'xk', alpha=0.9)
plt.scatter(data_ac['ra'], data_ac['dec'], color='k', marker='s', alpha=0.9,s=0.1, zorder=1)

sky_fin()
Expand All @@ -52,10 +53,19 @@ def sky_fin():
plt.pause(0.1)
key = input('next?')

plt.close()
plt.title('IceCube neutrino alerts and {0} accretion flares'.format(len(data_ac)))
plt.figure(1,(8,4))
sky_fin(fill_nu='none')
plt.scatter(data_ac['ra'], data_ac['dec'], c=np.clip(data_ac['df_over_rms'],0,25), marker='.',s=10, alpha=1, zorder=0, cmap='binary')
cbar = plt.colorbar()
cbar.set_label('Dust echo strength', size=12)
plt.pause(0.1)
key = input('next?')

# plot the 2D histogram
plt.clf()
h =plt.hist2d(data['ra'], data['dec'], bins=40, cmap='cubehelix_r')
h =plt.hist2d(data['ra'], data['dec'], bins=40, cmap='cubehelix_r', zorder=-1)
sky_fin()
cbar = plt.colorbar()
cbar.set_label('Number per bin', size=12)
Expand All @@ -69,7 +79,7 @@ def sky_fin():
h, x, y, p = plt.hist2d(ps_Sky['ra'], ps_Sky['dec'], bins=nbins, cmap='cubehelix_r')
plt.clf()
plt.pcolormesh(np.linspace(0,360, nbins), np.linspace(min(ps_Sky['dec']), max(ps_Sky['dec']), nbins), h.T/1e4,
shading='gouraud',snap=True, cmap='cubehelix_r')
shading='gouraud',snap=True, cmap='cubehelix_r', zorder=-1)

sky_fin()
cbar = plt.colorbar()
Expand All @@ -84,7 +94,7 @@ def sky_fin():
h, x, y, p = plt.hist2d(twomxz_ra,twomxz_dec, bins=nbins, cmap='cubehelix_r')
plt.clf()
plt.pcolormesh(np.linspace(0,360, nbins), np.linspace(min(ps_Sky['dec']), max(ps_Sky['dec']), nbins), np.clip(h.T/1e4, 0,0.002),
shading='gouraud',snap=True, cmap='cubehelix_r')
shading='gouraud',snap=True, cmap='cubehelix_r', zorder=-1)
sky_fin()
cbar = plt.colorbar()
cbar.set_label(r'Number per bin ($\times 10^4$)', size=12)
Expand All @@ -101,7 +111,7 @@ def sky_fin():
xi, yi = np.mgrid[x.min():x.max():nbins*1j, y.min():y.max():nbins*1j]
zi = kernel_control(np.vstack([xi.flatten(), yi.flatten()]))

plt.pcolormesh(xi, yi, zi.reshape(xi.shape)*1e5, shading='gouraud',snap=False, cmap='cubehelix_r')
plt.pcolormesh(xi, yi, zi.reshape(xi.shape)*1e5, shading='gouraud',snap=False, cmap='cubehelix_r', zorder=-1)

sky_fin()
plt.title('IceCube alerts and KDE of ZTF nuclear transients')
Expand Down

0 comments on commit 91cab01

Please sign in to comment.