Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. from mw_plot import MWSkyMap
  2. import matplotlib
  3. matplotlib.use("TkAgg")
  4. import numpy as np
  5. from astropy import units as  u
  6. import astropy.coordinates as apycoords
  7. from astropy.coordinates import SkyCoord
  8. from astroNN.gaia import gaiadr2_parallax
  9.  
  10. #ra, dec, parallax, parallax_error = gaiadr2_parallax(cuts=.20, keepdims=False, offset=0.00)
  11. ra = catalogue['ra'].values
  12. dec = catalogue['dec'].values
  13. parallax = catalogue['P0'].values
  14. # setup a MWSkyMap instance
  15. plot_instance = MWSkyMap(projection='equirectangular')
  16.  
  17. #parallax[parallax>1] = 1.
  18.  
  19. # so that the colorbar will has a better contract
  20. plot_instance.clim = (0., 2000.)
  21.  
  22. # alpha value for the milkyway image
  23. plot_instance.imalpha = 1.
  24.  
  25. # setup colormap
  26. plot_instance.cmap = 'gnuplot'
  27.  
  28. # set up plot title
  29. plot_instance.title = 'Known Pulsars in Milky way'
  30.  
  31. # use mw_scatter instead of scatter because we want a colorbar
  32. plot_instance.mw_scatter(ra * u.degree, dec * u.degree,[parallax, 'Spin Period'], lw = 2, marker = 'x')
  33.  
  34. plot_instance.savefig(file='adr14_gdr2_skymap.png')
  35.  
  36. # Show the figure
  37. plot_instance.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement