dustem_read_phangs_stellar_templates.pro
1.8 KB
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
FUNCTION dustem_read_phangs_stellar_templates,paramvalues,age_values,metalicity_values,template_wav=template_wav
Ntemplates=n_elements(paramvalues)-1
Nage=n_elements(age_values)
Nmetalicity=n_elements(metalicity_values)
templates=ptrarr(Ntemplates)
dir_templates='/Users/jpb/Soft_Libraries/dustem-wrapper_idl/Data/SSPs/'
;Wavelength(\AA) FWHM(\AA) Disp. (km/s)
file=dir_templates+'spectral_resolution.txt'
readcol,file,wav,fwhm,vdisp
;COMMENT = '# Starting Wavelength: 3500.2 (Angstroms)'
;COMMENT = '# Final Wavelength: 12000.4 (Angstroms)'
;COMMENT = '# Spectral sampling: 0.9 (Angstroms/pixel)'
;COMMENT = '# Type of sampling: linear'
;COMMENT = '# Spectral resolution: 2.51 - 23.57 (Angstroms) FWHM'
;COMMENT = '# Redshift (z): 0.0'
;Ech1.30Zm0.35T00.2500_iTp0.00_baseFe_linear_FWHM_variable.fits
file_start='Ech1.30'
file_end='_iTp0.00_baseFe_linear_FWHM_variable.fits'
ii=0L
Nage_str=6
Nmet_str=4
FOR i=1L,Ntemplates DO BEGIN
zsign_str='p'
ij=index2ij([i-1],[Nage,Nmetalicity])
iage=ij[0,0]
imet=ij[0,1]
age=age_values[iage]
met=metalicity_values[imet]
zsign_str='p'
IF met LE 0 THEN zsign_str='m'
met_str=strtrim(abs(met),2)
met_str=zsign_str+strmid(met_str,0,Nmet_str)
age_str=strtrim(age,2)
age_str=strmid(age_str,0,Nage_str)
message,'reading template for Age '+strtrim(age,2)+' Met '+strtrim(met,2),/continue
file=dir_templates+file_start+'Z'+met_str+'T0'+age_str+file_end
fi=file_info(file)
IF fi.exists THEN BEGIN
message,'Reading SSP '+file,/continue
spec=readfits(file,h,2)
templates[ii]=ptr_new(spec)
make_axis,h,wavs
ENDIF ELSE BEGIN
message,'file not found '+file,/continue
ENDELSE
ii=ii+1
ENDFOR
;Nspec=n_elements(spec)
;print,min(wavs),max(wavs)
; 3500.2000 12000.250
angstroem2mic=1.e6/1.e10
template_wav=wavs*angstroem2mic ;mic
RETURN,templates
END