smoh / gaia-comoving-stars

Finding wide binaries from the ESA Gaia mission
MIT License
6 stars 1 forks source link

plot pairs at > 1 pc in other coordinates #3

Open davidwhogg opened 7 years ago

davidwhogg commented 7 years ago

We want to see them on the sky (ra, dec) and in the color-magnitude diagram (absolute magnitude vs G-J or G-W1 color).

smoh commented 7 years ago

Uploaded a new notebook that shows sky positions here.

I think I made a mistake with S/N cut on the last plots I emailed, but this contains the correct separation distribution with a cut on delta v.

I am working on catalog matching for color info.

adrn commented 7 years ago

@smoh Could you select all pairs with separation > 1 pc, velocity difference < 2.5 km/s -- how many are there? If there are < 128, make a sky plot of all pairs and color the pairs with the same color -- use the matplotlib colormap "spectral." If there are > 128, make a sky plot of all pairs but set rotation and color uniquely to each pair like this:

image

that shitty plot was made with this code:

plt.figure(figsize=(6,6))
for s,(i,j,u,v) in zip(range(10), np.random.random(size=(10,4))):
    angle = np.random.uniform(0,180)
    plt.scatter(i, j, marker=(2, 0, angle), s=100, linewidth=4, edgecolor=cmap(s/10.))
    plt.scatter(u, v, marker=(2, 0, angle), s=100, linewidth=4, edgecolor=cmap(s/10.))
smoh commented 7 years ago
subset = (dpm_kms_gxyz < 2.5) & (sep_pc_gxyz>1.) & sncut
print sum(subset)
subset = (dpm_kms_gxyz < 2.5) & (sep_pc_gxyz>1.) & (snparallax>16)
print sum(subset)

The numbers are ~1938 pairs for S/N>10, and 1039 pairs for S/N>16. For the latter case, I can plot a line connecting the pair.

Uncolored:

image

Randomly colored:

image

Does this work?

adrn commented 7 years ago

OK, I guess that's fine too -- can you make the figsize twice as big and color the lines by physical separation? To get the colors, do something like:

from matplotli.colors import Normalize
norm = Normalize(vmin=1, vmax=4) # pc
color = cmap(norm(separation))
smoh commented 7 years ago

image

Arghhh..can't get ticks location correctly, but the colorbar spans 1 to 7.3pc in log scale. If you know how to fix it, let me know.

norm = mpl.colors.LogNorm(vmin=sep_pc_gxyz[subset].min(), vmax=sep_pc_gxyz[subset].max())

print sep_pc_gxyz[subset].min(),sep_pc_gxyz[subset].max()

sm = plt.cm.ScalarMappable(cmap=cm.magma, norm=norm)
sm.set_array(sep_pc_gxyz[subset])

figure(figsize=(20,8))
for ii, (x1,y1,x2,y2) in zip(range(N), D)[:]:
    color = cm.magma(norm(sep_pc_gxyz[subset][ii]))
    plot([x1,x2],[y1,y2], '-', color=color, lw=5)
xlabel('ra [deg]')
ylabel('dec [deg]')
xlim(0,360)
ylim(-90,90)
cbar = colorbar(sm, )
cbar.set_ticks([1,5])
cbar.set_ticklabels([1,5])  # vertically oriented colorbar
smoh commented 7 years ago

image

davidwhogg commented 7 years ago

Okay we DO recover some MW clusters, and maybe a stream!

Can you make the color-magnitude and sky plots for just those pairs at > 1pc? We want to see if these really are young.