-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlot_BP_RP_vs_G.py
86 lines (47 loc) · 1.57 KB
/
Plot_BP_RP_vs_G.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import glob
import os
from laspec import mrs
from astropy.table import Table
import astropy.units as u
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from laspec.mrs import MrsSpec
import random
import seaborn as sns
import dustmaps
from dustmaps.config import config
config['data_dir'] = "/Users/liujunhui/Desktop/2021workMac/202111012totallynew/dustmaps"
import dustmaps.bayestar
dustmaps.bayestar.fetch()
from dustmaps.bayestar import BayestarQuery
bayestar = BayestarQuery(version='bayestar2019')
from astropy.coordinates import SkyCoord, Distance
from astropy import units
dir_name = './20211205_GaiaEDR3_3arcsec.csv'
m8pd = pd.read_csv(dir_name)
c = SkyCoord(m8pd['combined_ra_obs'], m8pd['combined_dec_obs'], unit = 'deg')
d = 1000/m8pd['parallax'].values * units.pc
d[d<0] =0
coords = SkyCoord(c.galactic.l, c.galactic.b, distance = d, frame='galactic')
ebv = bayestar(coords, mode = 'median')
"""
Filter G G_BP G_RP B_T V_T J H Ks
?eff(?) 6437.70 5309.57 7709.85 4265.42 5332.38 12329.79 16395.59 21522.05
A?/AV 0.85926 1.06794 0.65199 1.35552 1.05047 0.29434 0.18128 0.11838
"""
AG = ebv*0.85926
ABP = ebv*1.06794
ARP = ebv*0.65199
AJ = ebv*0.29434
AH = ebv*0.18128
AK = ebv*0.11838
#%% absolute magnitude
dm = 5*np.log10(1000/m8pd['parallax']) - 5
MG = m8pd['phot_g_mean_mag'] - dm -AG
MBP = m8pd['phot_bp_mean_mag'] - dm -ABP
MRP = m8pd['phot_rp_mean_mag'] - dm -ARP
MBP_RP = MBP - MRP
map = sns.kdeplot(MBP_RP, MG)
plt.plot(MBP_RP, MG, '.')
plt.show()