Ich möchte eine Projektion von Millisekundenpulsaren auf der galaktischen Ebene machen, ähnlich wie diese von Sala et al. 2004:
Ich habe verschiedene Methoden ausprobiert und bin nirgendwo hingekommen. Dies ist mein aktueller Code, zusammen mit dem, was er produziert:
importiere Mathematik als mimport numpy als npimport csvimport matplotlib.pyplot als pltimport pandas als pdimport astropy.koordinaten als coordimport astropy.units als ufrom astropy .io importieren asciifrom astropy.coordinates importieren SkyCoorddata = pd.read_csv ('galacticwperiod.csv') xarr = np.array (data.iloc [:, 0]) yarr = np.array (data.iloc [:, 1]) eq = SkyCoord (xarr [:], yarr [:], unit = u.deg) gal = eq.galactic # print (xarr) #xarr = np.array (df.iloc [:, 0]) # yarr = np .array (df.iloc [:, 1]) # zarr = np.array (df.iloc [:, 2]) # ra = coord.Angle (xarr [:], unit = u.hour) # ra.degree #ra = ra.wrap_at (180 * u.degree) #dec = coord.Angle (yarr [:], unit = u.deg) #print (ra) plt.figure (figsize = (6,5)) fig = plt.figure () ax = fig.add_subplot (111, projection = "aitoff") plt.plot (gal.l.wrap_at (180 * u.deg), gal.b.wrap_at (180 * u.deg), linestyle = 'Keine') ax.scatter (gal.l, gal.b, linestyle = 'Keine') # ax.set_facecolor ('xkcd: Schlachtschiff grau') # fig.patch.set_facecolor ('weiß') # ax.tick_params (Achse = 'beide', w hich = 'major', labelize = 10) # ax.grid (color = 'b', linestyle = 'solid') fig.show () # plt.savefig ('millisecondcoloraitoff.png', dpi = 600)
Hier einige Zeilen der Eingabedatei 'galacticwperiod.csv':
Gl, Gb111.383, -54.849305.898, -44.888305.913, - 44.877
Dies ist das Bild, das es erzeugt:
Ich bin fast sicher, dass dies falsch ist, da sie nicht entlang der verteilt sind galaktische Ebene, die sie sein sollten. Die Daten, die ich verwende, stammen aus dem ATNF Pulsar Catalog.
Dies sind die Websites, die ich mir bereits als Referenz angesehen habe:
https://stackoverflow.com/questions/33105898/astropy-matplotlib-and-plot- Galaktische Koordinaten https://astropy4scipy2014.readthedocs.io/_static/notebooks/06_Celestial_Coordinates_solutions.html
Jede Hilfe dabei wäre sehr dankbar.