Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mw_plot import MWSkyMap
- import matplotlib
- matplotlib.use("TkAgg")
- import numpy as np
- from astropy import units as u
- import astropy.coordinates as apycoords
- from astropy.coordinates import SkyCoord
- from astroNN.gaia import gaiadr2_parallax
- #ra, dec, parallax, parallax_error = gaiadr2_parallax(cuts=.20, keepdims=False, offset=0.00)
- ra = catalogue['ra'].values
- dec = catalogue['dec'].values
- parallax = catalogue['P0'].values
- # setup a MWSkyMap instance
- plot_instance = MWSkyMap(projection='equirectangular')
- #parallax[parallax>1] = 1.
- # so that the colorbar will has a better contract
- plot_instance.clim = (0., 2000.)
- # alpha value for the milkyway image
- plot_instance.imalpha = 1.
- # setup colormap
- plot_instance.cmap = 'gnuplot'
- # set up plot title
- plot_instance.title = 'Known Pulsars in Milky way'
- # use mw_scatter instead of scatter because we want a colorbar
- plot_instance.mw_scatter(ra * u.degree, dec * u.degree,[parallax, 'Spin Period'], lw = 2, marker = 'x')
- plot_instance.savefig(file='adr14_gdr2_skymap.png')
- # Show the figure
- plot_instance.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement