return int(match.group(1)) else: return 0 data = np.loadtxt('data/globular_clusters.tsv', skiprows=49, delimiter='|', usecols=(1, 4, 5, 6, 7), dtype=[('messier', 'int'), ('dist', 'float'), ('x', 'float'), ('y', 'float'), ('z', 'float')], converters={1: convert_messier}) #===================================================================================================== data = np.sort(data, order=['messier']) data["x"] = kiloparsec_to_lightyear(data["x"]) data["y"] = kiloparsec_to_lightyear(data["y"]) data["z"] = kiloparsec_to_lightyear(data["z"]) data["dist"] = kiloparsec_to_lightyear(data["dist"]) SUN_TO_CENTER_DISTANCE = 27200 MILKY_WAY_RADIUS = 110000 / 2 #===================================================================================================== def show_globular_clusters(dt, messier): ax = plt.subplot(111, projection='3d') ax.plot((0,), (0,), (0,), 'o', color='orange', markersize=7, label='sun')
# ===================================================================================================== catalog_list = Vizier.find_catalogs('VII/202') Vizier.ROW_LIMIT = 1000000 catalogs = Vizier.get_catalogs(catalog_list.keys()) data = catalogs[0] # ===================================================================================================== data.sort('Name') data["X"] = kiloparsec_to_lightyear(data["X"]) data["Y"] = kiloparsec_to_lightyear(data["Y"]) data["Z"] = kiloparsec_to_lightyear(data["Z"]) data["Rsun"] = kiloparsec_to_lightyear(data["Rsun"]) SUN_TO_CENTER_DISTANCE = 27200 MILKY_WAY_RADIUS = 110000 / 2 # ===================================================================================================== def show_globular_clusters(dt, messier): ax = plt.subplot(111, projection='3d') ax.plot((0,), (0,), (0,), 'o', color='orange', markersize=7, label='sun')