You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the code. It is indeed very helpful and powerful tool. I have started using the code to fit the SDSS spectra, but focusing on the Hb and [OIII] lines. However, I am having challenges in fitting the lines. This may be a naive or silly question but I appreciate your help.
Basically I am only adding back the OIII wings in this part,
newdata = np.rec.array([(6564.61,'Ha',6400.,6800.,'Ha_br',3,5e-3,0.004,0.05,0.015,0,0,0,0.05),
(6564.61,'Ha',6400.,6800.,'Ha_na',1,1e-3,5e-4,0.0017,0.01,1,1,0,0.002),
(6549.85,'Ha',6400.,6800.,'NII6549',1,1e-3,2.3e-4,0.0017,5e-3,1,1,1,0.001),
(6585.28,'Ha',6400.,6800.,'NII6585',1,1e-3,2.3e-4,0.0017,5e-3,1,1,1,0.003),
(6718.29,'Ha',6400.,6800.,'SII6718',1,1e-3,2.3e-4,0.0017,5e-3,1,1,2,0.001),
(6732.67,'Ha',6400.,6800.,'SII6732',1,1e-3,2.3e-4,0.0017,5e-3,1,1,2,0.001),
(4862.68,'Hb',4640.,5100.,'Hb_br',1,5e-3,0.004,0.05,0.01,0,0,0,0.01),
(4862.68,'Hb',4640.,5100.,'Hb_na',1,1e-3,2.3e-4,0.0017,0.01,1,1,0,0.002),
(4960.30,'Hb',4640.,5100.,'OIII4959c',1,1e-3,2.3e-4,0.0017,0.01,1,1,0,0.002),
(5008.24,'Hb',4640.,5100.,'OIII5007c',1,1e-3,2.3e-4,0.0017,0.01,1,1,0,0.004),
(4960.30,'Hb',4640.,5100.,'OIII4959w',1,3e-3,2.3e-4,0.004,0.01,2,2,0,0.001),
(5008.24,'Hb',4640.,5100.,'OIII5007w',1,3e-3,2.3e-4,0.004,0.01,2,2,0,0.002),
(2798.75,'MgII',2700.,2900.,'MgII_br',1,5e-3,0.004,0.05,0.0017,0,0,0,0.05),
(2798.75,'MgII',2700.,2900.,'MgII_na',2,1e-3,5e-4,0.0017,0.01,1,1,0,0.002),
(1908.73,'CIII',1700.,1970.,'CIII_br',2,5e-3,0.004,0.05,0.015,99,0,0,0.01),
(1549.06,'CIV',1500.,1700.,'CIV_br',1,5e-3,0.004,0.05,0.015,0,0,0,0.05),
(1549.06,'CIV',1500.,1700.,'CIV_na',1,1e-3,5e-4,0.0017,0.01,1,1,0,0.002),
(1215.67,'Lya',1150.,1290.,'Lya_br',1,5e-3,0.004,0.05,0.02,0,0,0,0.05),
(1215.67,'Lya',1150.,1290.,'Lya_na',1,1e-3,5e-4,0.0017,0.01,0,0,0,0.002)\
And these are the result:
Input:
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[8][0],q.line_result[18:21],'narrow')
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[9][0],q.line_result[21:24],'narrow')
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[10][0],q.line_result[24:27],'broad')
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[11][0],q.line_result[27:30],'broad')
output:
Narrow [OIII]4959c:
FWHM (km/s) 613.1
Sigma (km/s) 254.9
EW (A) 94.2
Peak (A) 4958.9
area (10^(-17) erg/s/cm^2) 202.8
Narrow [OIII]5007c:
FWHM (km/s) 613.1
Sigma (km/s) 254.9
EW (A) 276.7
Peak (A) 5006.9
area (10^(-17) erg/s/cm^2) 594.1
Broad [OIII]4959w:
FWHM (km/s) 0.0
Sigma (km/s) 0.0
EW (A) 0.0
Peak (A) 0.0
area (10^(-17) erg/s/cm^2) 0.0
Broad [OIII]5007w:
FWHM (km/s) 0.0
Sigma (km/s) 0.0
EW (A) 0.0
Peak (A) 0.0
area (10^(-17) erg/s/cm^2) 0.0
Question: How do I modify it such that it can fit both the broad and narrow components in [OIII] lines. Do I have control over that. In fact, it fits well in one of my spectra but most of them are fit like this. I am a beginner in python but I am trying to understand the code. I may have given a lot of unnecessary information but I am trying to make sure you understand my issue.
The text was updated successfully, but these errors were encountered:
Here the broad component of [OIII] is zero since there are no obvious outflows in the blue wing of [OIII]. It is unreasonable to get a broad [OIII] at least for this object.
Dear @legolason,
Thank you for the code. It is indeed very helpful and powerful tool. I have started using the code to fit the SDSS spectra, but focusing on the Hb and [OIII] lines. However, I am having challenges in fitting the lines. This may be a naive or silly question but I appreciate your help.
Basically I am only adding back the OIII wings in this part,
newdata = np.rec.array([(6564.61,'Ha',6400.,6800.,'Ha_br',3,5e-3,0.004,0.05,0.015,0,0,0,0.05),
(6564.61,'Ha',6400.,6800.,'Ha_na',1,1e-3,5e-4,0.0017,0.01,1,1,0,0.002),
(6549.85,'Ha',6400.,6800.,'NII6549',1,1e-3,2.3e-4,0.0017,5e-3,1,1,1,0.001),
(6585.28,'Ha',6400.,6800.,'NII6585',1,1e-3,2.3e-4,0.0017,5e-3,1,1,1,0.003),
(6718.29,'Ha',6400.,6800.,'SII6718',1,1e-3,2.3e-4,0.0017,5e-3,1,1,2,0.001),
(6732.67,'Ha',6400.,6800.,'SII6732',1,1e-3,2.3e-4,0.0017,5e-3,1,1,2,0.001),
(4862.68,'Hb',4640.,5100.,'Hb_br',1,5e-3,0.004,0.05,0.01,0,0,0,0.01),
(4862.68,'Hb',4640.,5100.,'Hb_na',1,1e-3,2.3e-4,0.0017,0.01,1,1,0,0.002),
(4960.30,'Hb',4640.,5100.,'OIII4959c',1,1e-3,2.3e-4,0.0017,0.01,1,1,0,0.002),
(5008.24,'Hb',4640.,5100.,'OIII5007c',1,1e-3,2.3e-4,0.0017,0.01,1,1,0,0.004),
(4960.30,'Hb',4640.,5100.,'OIII4959w',1,3e-3,2.3e-4,0.004,0.01,2,2,0,0.001),
(5008.24,'Hb',4640.,5100.,'OIII5007w',1,3e-3,2.3e-4,0.004,0.01,2,2,0,0.002),
(2798.75,'MgII',2700.,2900.,'MgII_br',1,5e-3,0.004,0.05,0.0017,0,0,0,0.05),
(2798.75,'MgII',2700.,2900.,'MgII_na',2,1e-3,5e-4,0.0017,0.01,1,1,0,0.002),
(1908.73,'CIII',1700.,1970.,'CIII_br',2,5e-3,0.004,0.05,0.015,99,0,0,0.01),
(1549.06,'CIV',1500.,1700.,'CIV_br',1,5e-3,0.004,0.05,0.015,0,0,0,0.05),
(1549.06,'CIV',1500.,1700.,'CIV_na',1,1e-3,5e-4,0.0017,0.01,1,1,0,0.002),
(1215.67,'Lya',1150.,1290.,'Lya_br',1,5e-3,0.004,0.05,0.02,0,0,0,0.05),
(1215.67,'Lya',1150.,1290.,'Lya_na',1,1e-3,5e-4,0.0017,0.01,0,0,0,0.002)\
And then the input is
q.Fit(name = None,nsmooth = 1, and_or_mask = False, deredden = True, reject_badpix = False, wave_range = None,
wave_mask =None, decomposition_host = True, Mi = None, npca_gal = 5, npca_qso = 20,
Fe_uv_op = True, Fe_flux_range=np.array([4435,4685]), poly = True, BC = False, rej_abs = False,
initial_guess = None, MC = 50, n_trails = 5, linefit = True, tie_lambda = True, tie_width = True,
tie_flux_1 = True, tie_flux_2 = True, save_result = True, plot_fig = True,save_fig = False,
plot_line_name = True, plot_legend = True, dustmap_path = path4, save_fig_path = path3,
save_fits_path = path2,save_fits_name = None)
And these are the result:
Input:
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[8][0],q.line_result[18:21],'narrow')
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[9][0],q.line_result[21:24],'narrow')
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[10][0],q.line_result[24:27],'broad')
fwhm,sigma,ew,peak,area = q.line_prop(q.linelist[11][0],q.line_result[27:30],'broad')
output:
Narrow [OIII]4959c:
FWHM (km/s) 613.1
Sigma (km/s) 254.9
EW (A) 94.2
Peak (A) 4958.9
area (10^(-17) erg/s/cm^2) 202.8
Narrow [OIII]5007c:
FWHM (km/s) 613.1
Sigma (km/s) 254.9
EW (A) 276.7
Peak (A) 5006.9
area (10^(-17) erg/s/cm^2) 594.1
Broad [OIII]4959w:
FWHM (km/s) 0.0
Sigma (km/s) 0.0
EW (A) 0.0
Peak (A) 0.0
area (10^(-17) erg/s/cm^2) 0.0
Broad [OIII]5007w:
FWHM (km/s) 0.0
Sigma (km/s) 0.0
EW (A) 0.0
Peak (A) 0.0
area (10^(-17) erg/s/cm^2) 0.0
Question: How do I modify it such that it can fit both the broad and narrow components in [OIII] lines. Do I have control over that. In fact, it fits well in one of my spectra but most of them are fit like this. I am a beginner in python but I am trying to understand the code. I may have given a lot of unnecessary information but I am trying to make sure you understand my issue.
The text was updated successfully, but these errors were encountered: