-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock_mod_spectra.py
49 lines (42 loc) · 1.23 KB
/
mock_mod_spectra.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
import glob
from astropy.table import Table
def mock_spectra(starnames, starkmags, template_file):
for cname, kmag in zip(starnames, starkmags):
print(cname)
ctable = Table.read(template_file)
mfac = 10 ** (-0.4 * kmag + 0.4 * template_star_kmag)
ctable["FLUX"] *= mfac
out_file = "data/%s_mod_000.fits" % cname
ctable.write(out_file, overwrite=True)
if __name__ == "__main__":
# A stars
# astarnames = ['hd055677']
# astarkmags = [4.26, 5.751, 5.756,
# 6.824, 7.043, 9.156]
# template_star = 'bd60d1753'
# template_star_kmag = 9.64
# template_file = glob.glob("data/%s_mod_0??.fits" % template_star)
# mock_spectra(astarnames, astarkmags, template_file[0])
# G stars
gstarnames = [
"ngc2420",
"ngc2506",
"ngc6811",
"gstark12.5",
"gstark13.0",
"gstark13.5",
"gstark14.0",
]
gstarkmags = [
15.5,
16.3,
13.9,
12.5,
13.0,
13.5,
14.0,
]
template_star = "hd159222"
template_star_kmag = 5.05
template_file = glob.glob("data/%s_mod_0??.fits" % template_star)
mock_spectra(gstarnames, gstarkmags, template_file[0])