-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_pysynphot_spectra.py
44 lines (33 loc) · 1.72 KB
/
get_pysynphot_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
import pysynphot as S
import os
def add_spectrum_to_library():
spec_dict = {}
filename_qso = os.path.join(os.environ['PYSYN_CDBS'], 'grid', 'agn', 'qso_template.fits')
qso = S.FileSpectrum(filename_qso)
q = qso.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['QSO'] = q
filename_star = os.path.join(os.environ['PYSYN_CDBS'], 'grid', 'pickles', 'dat_uvk', 'pickles_uk_1.fits')
star = S.FileSpectrum(filename_star)
s = star.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['O5V Star'] = s
filename_star = os.path.join(os.environ['PYSYN_CDBS'], 'grid', 'pickles', 'dat_uvk', 'pickles_uk_26.fits')
star = S.FileSpectrum(filename_star)
s = star.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['G2V Star'] = s
filename_star = os.path.join(os.environ['PYSYN_CDBS'], 'grid', 'galactic', 'orion_template.fits')
star = S.FileSpectrum(filename_star)
s = star.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['Orion Nebula'] = s
filename_star = os.path.join(os.environ['PYSYN_CDBS'], 'calspec', 'g191b2b_mod_010.fits')
star = S.FileSpectrum(filename_star)
s = star.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['G191B2B'] = s
filename_star = os.path.join(os.environ['PYSYN_CDBS'], 'grid', 'kc96', 'starb1_template.fits')
star = S.FileSpectrum(filename_star)
s = star.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['Starburst, No Dust'] = s
filename_star = os.path.join(os.environ['PYSYN_CDBS'], 'grid', 'kc96', 'starb6_template.fits')
star = S.FileSpectrum(filename_star)
s = star.renorm(18., 'abmag', S.ObsBandpass('galex,fuv'))
spec_dict['Starburst, E(B-V) = 0.6'] = s
return spec_dict