Commit 90923e9d authored by Médéric Boquien's avatar Médéric Boquien

Store the name of the individual lines in the database in order so they can...

Store the name of the individual lines in the database in order so they can easily be identified and retrieved.
parent b753ac32
...@@ -696,7 +696,10 @@ def build_nebular(base): ...@@ -696,7 +696,10 @@ def build_nebular(base):
print("Importing {}...".format(nebular_dir + 'lines.dat')) print("Importing {}...".format(nebular_dir + 'lines.dat'))
lines = np.genfromtxt(nebular_dir + 'lines.dat') lines = np.genfromtxt(nebular_dir + 'lines.dat')
wave_lines = np.genfromtxt(nebular_dir + 'line_wavelengths.dat') tmp = Table.read(nebular_dir + 'line_wavelengths.dat', format='ascii')
wave_lines = tmp['col1'].data
name_lines = tmp['col2'].data
print("Importing {}...".format(nebular_dir + 'continuum.dat')) print("Importing {}...".format(nebular_dir + 'continuum.dat'))
cont = np.genfromtxt(nebular_dir + 'continuum.dat') cont = np.genfromtxt(nebular_dir + 'continuum.dat')
...@@ -727,8 +730,8 @@ def build_nebular(base): ...@@ -727,8 +730,8 @@ def build_nebular(base):
spectra = lines[idx::6, :] spectra = lines[idx::6, :]
for logU, spectrum in zip(np.around(np.arange(-4., -.9, .1), 1), for logU, spectrum in zip(np.around(np.arange(-4., -.9, .1), 1),
spectra.T): spectra.T):
models_lines.append(NebularLines(metallicity, logU, wave_lines, models_lines.append(NebularLines(metallicity, logU, name_lines,
spectrum)) wave_lines, spectrum))
# Import continuum # Import continuum
for idx, metallicity in enumerate(metallicities): for idx, metallicity in enumerate(metallicities):
......
303.8 # He 2 303.8A 303.8,HeII-30.38
584.3 # He 1 584.3A 584.3,HeI-58.43
625.6 # He 1 625.6A 625.6,HeI-62.56
972.5 # H 1 972.5A Ly gamma (1-4) 972.5,Ly-gamma
977.0 # C 3 977.0A 977.0,CIII-97.70
1026 # H 1 1026A Ly beta (1-3) 1026,Ly-beta
1216 # H 1 1216A Ly alpha (1-2) 1216,Ly-alpha
1335 # C 2 1335A C II 1335,CII-133.5
1397 # TOTL 1397A Si IV 1394, 1397, 1398 1397,SiIV-139.7
1486 # TOTL 1486A N IV] 1486,NIV-148.6
1549 # TOTL 1549A C IV 1548, 1551 1549,CIV-154.9
1640 # He 2 1640A 1640,HeII-164.0
1665 # TOTL 1665A O III] 1661, 1666 1665,OIII-166.5
1750 # TOTL 1750A N III] 1750,NIII-175.0
1888 # TOTL 1888A Si III] 1883, 1892 1888,SiIII-188.8
1909 # TOTL 1909A C III] 1909,CIII-190.9
2326 # TOTL 2326A C II] 2326,CII-232.6
2400 # Fe 2 2400A 2400,FeII-240.0
2471 # O II 2471A 2471,OII-247.1
2798 # TOTL 2798A Mg II 2796, 2803 2798,MgII-279.8
2829 # He 1 2829A 2829,HeI-282.9
2836 # Fe 4 2836A 2836,FeIV-283.6
2945 # He 1 2945A 2945,HeI-294.5
3096 # Fe 4 3096A 3096,FeIV-309.6
3188 # He 1 3188A 3188,HeI-318.8
3203 # He 2 3203A 3203,HeII-320.3
3671 # Ca B 3671A H 24 (Case B) 3671,H-24
3674 # Ca B 3674A H 23 (Case B) 3674,H-23
3676 # Ca B 3676A H 22 (Case B) 3676,H-22
3679 # Ca B 3679A H 21 (Case B) 3679,H-21
3683 # Ca B 3683A H 20 (Case B) 3683,H-20
3687 # Ca B 3687A H 19 (Case B) 3687,H-19
3692 # Ca B 3692A H 18 (Case B) 3692,H-18
3697 # Ca B 3697A H 17 (Case B) 3697,H-17
3704 # Ca B 3704A H 16 (Case B) 3704,H-16
3712 # Ca B 3712A H 15 (Case B) 3712,H-15
3722 # Ca B 3722A H 14 (Case B) 3722,H-14
3727 # TOTL 3727A [OII] 3726, 3729 3727,OII-372.7
3734 # Ca B 3734A H 13 (Case B) 3734,H-13
3750 # Ca B 3750A H 12 (Case B) 3750,H-12
3771 # Ca B 3771A H 11 (Case B) 3771,H-11
3798 # H 1 3798A H 10 3798,H-10
3820 # He 1 3820A 3820,HeI-382.0
3835 # H 1 3835A H 9 3835,H-9
3869 # Ne 3 3869A 3869,NeIII-386.9
3889 # He 1 3889A 3889,HeI-388.9
3889 # H 1 3889A H 8 3889,H-8
3965 # He 1 3965A 3965,HeI-396.5
3968 # Ne 3 3968A 3968,NeIII-396.8
3970 # H 1 3970A H epsilon (2-7) 3970,H-epsilon
4026 # He 1 4026A 4026,HeI-402.6
4070 # S II 4070A 4070,SII-407.0
4074 # S 2 4074A 4074,SII-407.4
4102 # H 1 4102A H delta (2-6) 4102,H-delta
4300 # Fe 2 4300A 4300,FeII-430.0
4340 # H 1 4340A H gamma (2-5) 4340,H-gamma
4363 # TOTL 4363A 4363,OIII-436.3
4471 # He 1 4471A 4471,HeI-447.1
4659 # Fe 3 4659A 4659,FeIII-465.9
4686 # He 2 4686A 4686,HeII-468.6
4861 # H 1 4861A H beta (2-4) 4861,H-beta
4922 # He 1 4922A 4922,HeI-492.2
4959 # O 3 4959A 4959,OIII-495.9
5007 # O 3 5007A 5007,OIII-500.7
5016 # He 1 5016A 5016,HeI-501.6
5876 # He 1 5876A 5876,HeI-587.6
6300 # O 1 6300A 6300,OI-630.0
6312 # S 3 6312A 6312,SIII-631.2
6548 # N 2 6548A 6548,NII-654.8
6563 # H 1 6563A H alpha (2-3) 6563,H-alpha
6584 # N 2 6584A 6584,NII-658.4
6678 # He 1 6678A 6678,HeI-667.8
6716 # S II 6716A 6716,SII-671.6
6720 # S 2 6720A 6720,SII-672.0
6731 # S II 6731A 6731,SII-673.1
7065 # He 1 7065A 7065,HeI-706.5
7135 # Ar 3 7135A 7135,ArIII-713.5
7325 # TOTL 7325A [OII] 7323, 7332 7325,OII-732.5
7751 # Ar 3 7751A 7751,ArIII-775.1
8334 # Ca B 8334A Pa 24 (Case B) 8334,Pa-24
8346 # Ca B 8346A Pa 23 (Case B) 8346,Pa-23
8359 # Ca B 8359A Pa 22 (Case B) 8359,Pa-22
8374 # Ca B 8374A Pa 21 (Case B) 8374,Pa-21
8392 # Ca B 8392A Pa 20 (Case B) 8392,Pa-20
8413 # Ca B 8413A Pa 19 (Case B) 8413,Pa-19
8438 # Ca B 8438A Pa 18 (Case B) 8438,Pa-18
8467 # Ca B 8467A Pa 17 (Case B) 8467,Pa-17
8502 # Ca B 8502A Pa 16 (Case B) 8502,Pa-16
8545 # Ca B 8545A Pa 15 (Case B) 8545,Pa-15
8598 # Ca B 8598A Pa 14 (Case B) 8598,Pa-14
8665 # Ca B 8665A Pa 13 (Case B) 8665,Pa-13
8750 # Ca B 8750A Pa 12 8750,Pa-12
8863 # Ca B 8863A Pa 11 8863,Pa-11
9015 # H 1 9015A Pa 10 9015,Pa-10
9069 # S 3 9069A 9069,SIII-906.9
9229 # H 1 9229A Pa 9 9229,Pa9
9532 # S 3 9532A 9532,SIII-953.2
9546 # H 1 9546A Pa epsilon (3-8) 9546,Pa-epsilon
10050 # H 1 1.005m Pa delta (3-7) 10050,Pa-delta
10830 # TOTL 1.083m He I 10830,HeI-1.083
10940 # H 1 1.094m Pa gamma (3-6) 10940,Pa-gamma
12820 # H 1 1.282m Pa beta (3-5) 12820,Pa-beta
18750 # H 1 1.875m Pa alpha (3-4) 18750,Pa-alpha
21660 # H 1 2.166m Br gamma (4-7) 21660,Br-gamma
26250 # H 1 2.625m Br beta (4-6) 26250,Br-beta
40510 # H 1 4.051m Br alpha (4-5) 40510,Br-alpha
69800 # Ar 2 6.980m 69800,ArII-6.980
74580 # H 1 7.458m Pf alpha (5-6) 74580,Pf-alpha
90000 # Ar 3 9.000m 90000,ArIII-9.000
105100 # S 4 10.51m 105100,SIV-10.51
128100 # Ne 2 12.81m 128100,NeII-12.81
155500 # Ne 3 15.55m 155500,NeIII-15.55
186700 # S 3 18.67m 186700,SIII-18.67
334700 # S 3 33.47m 334700,SIII-33.47
348100 # Si 2 34.81m 348100,SiII-34.81
360100 # Ne 3 36.01m 360100,NeIII-36.01
518000 # O 3 51.80m 518000,OIII-51.80
572100 # N 3 57.21m 572100,NIII-57.21
631700 # O 1 63.17m 631700,OI-63.17
883300 # O 3 88.33m 883300,OIII-88.33
1217000 # N 2 121.7m 1217000,NII-121.7
1455000 # O 1 145.5m 1455000,OI-145.5
1576000 # C 2 157.6m 1576000,CII-157.6
2054000 # N 2 205.4m 2054000,NII-205.4
...@@ -209,12 +209,14 @@ class _NebularLines(BASE): ...@@ -209,12 +209,14 @@ class _NebularLines(BASE):
__tablename__ = 'nebular_lines' __tablename__ = 'nebular_lines'
metallicity = Column(Float, primary_key=True) metallicity = Column(Float, primary_key=True)
logU = Column(Float, primary_key=True) logU = Column(Float, primary_key=True)
name = Column(PickleType)
wave = Column(PickleType) wave = Column(PickleType)
ratio = Column(PickleType) ratio = Column(PickleType)
def __init__(self, nebular_lines): def __init__(self, nebular_lines):
self.metallicity = nebular_lines.metallicity self.metallicity = nebular_lines.metallicity
self.logU = nebular_lines.logU self.logU = nebular_lines.logU
self.name = nebular_lines.name
self.wave = nebular_lines.wave self.wave = nebular_lines.wave
self.ratio = nebular_lines.ratio self.ratio = nebular_lines.ratio
...@@ -767,8 +769,8 @@ class Database(object): ...@@ -767,8 +769,8 @@ class Database(object):
filter(_NebularLines.logU == logU). filter(_NebularLines.logU == logU).
first()) first())
if result: if result:
return NebularLines(result.metallicity, result.logU, result.wave, return NebularLines(result.metallicity, result.logU, result.name,
result.ratio) result.wave, result.ratio)
else: else:
return None return None
......
...@@ -12,7 +12,7 @@ class NebularLines(object): ...@@ -12,7 +12,7 @@ class NebularLines(object):
""" """
def __init__(self, metallicity, logU, wave, ratio): def __init__(self, metallicity, logU, name, wave, ratio):
"""Create a new nebular lines template """Create a new nebular lines template
Parameters Parameters
...@@ -21,6 +21,8 @@ class NebularLines(object): ...@@ -21,6 +21,8 @@ class NebularLines(object):
Gas phase metallicity Gas phase metallicity
logU: float logU: float
Ionisation parameter Ionisation parameter
name: array
Name of each line
wave: array wave: array
Vector of the λ grid used in the templates [nm] Vector of the λ grid used in the templates [nm]
ratio: array ratio: array
...@@ -30,5 +32,6 @@ class NebularLines(object): ...@@ -30,5 +32,6 @@ class NebularLines(object):
self.metallicity = metallicity self.metallicity = metallicity
self.logU = logU self.logU = logU
self.name = name
self.wave = wave self.wave = wave
self.ratio = ratio self.ratio = ratio
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment