(OpenNGC) [https://github.com/mattiaverga/OpenNGC] est une base de données qui organise NGC (New General Catalog) et IC (Index Catalog).
Vous pouvez facilement obtenir les données en utilisant https://github.com/mattiaverga/PyOngc. Il peut être installé avec pip install pyongc sur la série python3.
python
import pyongc
name="NGC4051"
DSOobject = pyongc.Dso(name)
gtype = DSOobject.getType()
mag = DSOobject.getMagnitudes()
surf = DSOobject.getSurfaceBrightness()
hubble = DSOobject.getHubble()
# print(gtype,mag,surf,hubble)
# ('Galaxy', (11.08, 12.92, 8.58, 8.06, 7.67), 22.87, 'SABb')
Lorsque vous installez pyongc, des outils de ligne de commande sont également installés et vous pouvez voir combien d'étoiles et de galaxies sont incluses avec la commande suivante.
python
> ongc stats
PyONGC version: 0.5.1
Database version: 20191019
Total number of objects in database: 13978
Object types statistics:
Star -> 546
Double star -> 246
Association of stars -> 62
Star cluster + Nebula -> 66
Dark Nebula -> 2
Duplicated record -> 636
Emission Nebula -> 8
Galaxy -> 10490
Globular Cluster -> 205
Group of galaxies -> 16
Galaxy Pair -> 212
Galaxy Triplet -> 23
HII Ionized region -> 83
Nebula -> 93
Nonexistent object -> 14
Nova star -> 3
Open Cluster -> 661
Object of other/unknown type -> 434
Planetary Nebula -> 129
Reflection Nebula -> 38
Supernova remnant -> 11
Si vous souhaitez analyser l'ensemble du catalogue, téléchargez le fichier csv d'origine. Si wget est installé, vous devriez pouvoir le télécharger en une seule fois ci-dessous.
python
wget https://raw.githubusercontent.com/mattiaverga/OpenNGC/master/NGC.csv .
python
import pandas as pd
df = pd.read_table('NGC.csv', header=0,delimiter=";")
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import matplotlib.cm as cm
plt.rcParams['font.family'] = 'serif'
import matplotlib.colors as colors
fig = plt.figure(figsize=(14,7.))
ax = fig.add_subplot(1, 2, 1)
num=len(set(df["Hubble"]))
usercmap = plt.get_cmap('jet')
cNorm = colors.Normalize(vmin=0, vmax=num)
scalarMap = cm.ScalarMappable(norm=cNorm, cmap=usercmap)
for i, sp in enumerate(set(df["Hubble"])):
c = scalarMap.to_rgba(i)
df_species = df[df['Hubble'] == sp]
ax.scatter(data=df_species, x='B-Mag', y='K-Mag', label=sp, color=c, s=1)
plt.xlabel("B-Mag")
plt.ylabel("K-Mag")
plt.legend(bbox_to_anchor=(0., 1.01, 1., 0.01), loc='lower left',ncol=8, mode="expand", borderaxespad=0.,fontsize=8)
ax = fig.add_subplot(1, 2, 2)
for i, sp in enumerate(set(df["Hubble"])):
c = scalarMap.to_rgba(i)
df_species = df[df['Hubble'] == sp]
ax.scatter(data=df_species, x='B-Mag', y='SurfBr', label=sp, color=c, s=1)
plt.xlabel("B-Mag")
plt.ylabel(r"Surface brigness within 25 mag isophoto (B-band) [mag/arcsec$^2$]")
plt.legend(bbox_to_anchor=(0., 1.01, 1., 0.01), loc='lower left',ncol=8, mode="expand", borderaxespad=0.,fontsize=8)
plt.savefig("ngc_bk_bs.png ")
plt.show()
import seaborn as sns
sns.pairplot(df[df["Type"]=="G"],vars=["B-Mag","V-Mag","K-Mag"])
plt.savefig("ngc_bvk_galaxy.png ")
Il y a une explication sur https://github.com/mattiaverga/OpenNGC/blob/master/NGC_guide.txt.
Name: Object name composed by catalog + number NGC: New General Catalogue IC: Index Catalogue
Type: Object type *: Star **: Double star *Ass: Association of stars OCl: Open Cluster GCl: Globular Cluster Cl+N: Star cluster + Nebula G: Galaxy GPair: Galaxy Pair GTrpl: Galaxy Triplet GGroup: Group of galaxies PN: Planetary Nebula HII: HII Ionized region DrkN: Dark Nebula EmN: Emission Nebula Neb: Nebula RfN: Reflection Nebula SNR: Supernova remnant Nova: Nova star NonEx: Nonexistent object Dup: Duplicated object (see NGC or IC columns to find the master object) Other: Other classification (see object notes)
RA: Right Ascension in J2000 Epoch (HH:MM:SS.SS)
Dec: Declination in J2000 Epoch (+/-DD:MM:SS.SS)
Const: Constellation where the object is located
MajAx: Major axis, expressed in arcmin
MinAx: Minor axis, expressed in arcmin
PosAng: Major axis position angle (North Eastwards)
B-Mag: Apparent total magnitude in B filter
V-Mag: Apparent total magnitude in V filter
J-Mag: Apparent total magnitude in J filter
H-Mag: Apparent total magnitude in H filter
K-Mag: Apparent total magnitude in K filter
SurfBr (only Galaxies): Mean surface brigthness within 25 mag isophot (B-band), expressed in mag/arcsec2
Hubble (only Galaxies): Morphological type (for galaxies)
Cstar U-Mag (only Planetary Nebulae): Apparent magnitude of central star in U filter
Cstar B-Mag (only Planetary Nebulae): Apparent magnitude of central star in B filter
Cstar V-Mag (only Planetary Nebulae): Apparent magnitude of central star in V filter
M: cross reference Messier number
NGC: other NGC identification, if the object is listed twice in the catalog
IC: cross reference IC number, if the object is also listed with that identification
Cstar Names (only Planetary Nebulae): central star identifications
Identifiers: cross reference with other catalogs
Common names: Common names of the object if any
NED Notes: notes about object exported from NED
OpenNGC Notes: notes about the object data from OpenNGC catalog
Par exemple, il existe de nombreux types de hable et vous voudrez peut-être les simplifier. Dans ce cas,
python
set(df["Hubble"])
Comme, vérifiez le type de type de hable. Créez un dictionnaire pour le convertir et créez une nouvelle colonne pour enregistrer le résultat de la conversion.
python
htype={'E':"Etype", 'E-S0':"Etype", 'E?':"Etype", 'I':"Etype", 'IAB':"Etype", 'IB':"Etype", \
'S0':"Etype", 'S0-a':"Etype", 'S?':"Etype", 'SABa':"Stype", 'SABb':"Stype", 'SABc':"Stype", 'SABd':"Stype", 'SABm':"Stype", 'SBa':"Stype", \
'SBab':"Stype", 'SBb':"Stype", 'SBbc':"Stype", 'SBc':"Stype", 'SBcd':"Stype", 'SBd':"Stype", 'SBm':"Stype", 'Sa':"Stype", 'Sab':"Stype", 'Sb':"Stype", \
'Sbc':"Stype", 'Sc':"Stype", 'Scd':"Stype", 'Sd':"Stype", 'Sm':"Stype", "nan":"Nan"}
df["htype"] = df["Hubble"]
df = df.replace({"htype":htype})
Ici, par exemple, un exemple de simple division en trois parties, Etype, Stype et Nan, est montré. La conversion de E en E est récursive et peut être folle, alors évitez de convertir le même caractère.
Je ne veux pas avoir Nan dans les données, donc j'extrais uniquement les colonnes nécessaires et j'exécute dropna dessus pour supprimer Nan.
python
ds = df_species.loc[:,["B-Mag","K-Mag","J-Mag"]]
ds = ds.dropna(how='any')
python
import pandas as pd
df = pd.read_table('NGC.csv', header=0,delimiter=";")
htype={'E':"Etype", 'E-S0':"Etype", 'E?':"Etype", 'I':"Etype", 'IAB':"Etype", 'IB':"Etype", \
'S0':"Etype", 'S0-a':"Etype", 'S?':"Etype", 'SABa':"Stype", 'SABb':"Stype", 'SABc':"Stype", 'SABd':"Stype", 'SABm':"Stype", 'SBa':"Stype", \
'SBab':"Stype", 'SBb':"Stype", 'SBbc':"Stype", 'SBc':"Stype", 'SBcd':"Stype", 'SBd':"Stype", 'SBm':"Stype", 'Sa':"Stype", 'Sab':"Stype", 'Sb':"Stype", \
'Sbc':"Stype", 'Sc':"Stype", 'Scd':"Stype", 'Sd':"Stype", 'Sm':"Stype", "nan":"Nan"}
df["htype"] = df["Hubble"]
df = df.replace({"htype":htype})
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import matplotlib.cm as cm
plt.rcParams['font.family'] = 'serif'
import matplotlib.colors as colors
fig = plt.figure(figsize=(14,7.))
ax = fig.add_subplot(1, 2, 1)
for i, sp in enumerate(set(df["htype"])):
df_species = df[df['htype'] == sp]
ds = df_species.loc[:,["B-Mag","K-Mag","J-Mag"]]
ds = ds.dropna(how='any')
bk = ds["B-Mag"] - ds["K-Mag"]
bj = ds["B-Mag"] - ds["J-Mag"]
ax.scatter(bk,bj,label=sp, s=2)
plt.xlabel("B-K")
plt.ylabel("B-J")
plt.legend(bbox_to_anchor=(0., 1.01, 1., 0.01), loc='lower left',borderaxespad=0.,fontsize=8)
ax = fig.add_subplot(1, 2, 2)
for i, sp in enumerate(set(df["htype"])):
df_species = df[df['htype'] == sp]
ds = df_species.loc[:,["B-Mag","K-Mag","J-Mag"]]
ds = ds.dropna(how='any')
bj = ds["B-Mag"] - ds["J-Mag"]
ax.scatter(ds["B-Mag"],bj,label=sp, s=2)
plt.xlabel("B")
plt.ylabel("B-J")
plt.legend(bbox_to_anchor=(0., 1.01, 1., 0.01), loc='lower left',borderaxespad=0.,fontsize=8)
plt.savefig("ngc_bk_bj.png ")
plt.show()
Recommended Posts