Commit 2d9acde04d5d25a52588923ae3972979d3d665f6
1 parent
1a792851
Exists in
master
First commit
Showing
3 changed files
with
104 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,61 @@ |
1 | +FUNCTION calz_guess_ebv,wave,flux_ratio,R_v=R_v | |
2 | + | |
3 | +;+ | |
4 | +; NAME: | |
5 | +; calz_guess_ebv, | |
6 | +; PURPOSE: | |
7 | +; Guess the value of E(B-V) to get a given stellar flux ratio | |
8 | +; EXPLANATION: | |
9 | +; based on calz_unred.pro by W. Landsman | |
10 | +; CALLING SEQUENCE: | |
11 | +; ebv=calz_guess_ebv(wave,flux_ratio,R_v=R_v) | |
12 | +; INPUT: | |
13 | +; WAVE - wavelength at which the flux ratio is given (Angstroms) | |
14 | +; FLUX_RATIO - flux ratio between unredened and redenned (observed) flux. | |
15 | +; OUTPUT: | |
16 | +; EBV - color excess E(B-V), scalar. positive if flux_ratio is >1 , | |
17 | +; Note that the E(B-V) computed is for | |
18 | +; the stellar continuum, EBV(stars), which is related to the | |
19 | +; reddening derived from the gas, EBV(gas), via the Balmer | |
20 | +; decrement by EBV(stars) = 0.44*EBV(gas) according to Calzetti 2000. | |
21 | +; OPTIONAL INPUT KEYWORD: | |
22 | +; R_V - Ratio of total to selective extinction, default = 4.05. | |
23 | +; Calzetti et al. (2000) estimate R_V = 4.05 +/- 0.80 from optical | |
24 | +; -IR observations of 4 starbursts. | |
25 | +; EXAMPLE: | |
26 | +; | |
27 | +; print,calz_guess_ebv(10000.,1./0.98,R_v=R_v) | |
28 | +; 0.0116824 | |
29 | +; NOTES: | |
30 | +; | |
31 | +; PROCEDURE CALLS: | |
32 | +; POLY() | |
33 | +; REVISION HISTORY: | |
34 | +; JPB 30 Jan 2024 | |
35 | +;- | |
36 | + | |
37 | +;flux_ratio=funred/flux must be >1 for positive E(B-V) | |
38 | +;print,calz_guess_ebv(10000.,1./0.98,R_v=R_v) | |
39 | + | |
40 | +;wave_flux in AA | |
41 | + | |
42 | +x = 10000.0/wave ;Wavelength in inverse microns | |
43 | + | |
44 | +if N_elements(R_V) EQ 0 then R_V = 4.05 | |
45 | + | |
46 | +IF (wave GE 6300) AND (wave LE 22000) THEN $ | |
47 | + klam = 2.659*(-1.857 + 1.040*x) + R_V | |
48 | + | |
49 | +IF (wave GE 912) AND (wave LT 6300) THEN $ | |
50 | + klam = 2.659*(poly(x, [-2.156, 1.509d0, -0.198d0, 0.011d0])) + R_V | |
51 | + | |
52 | +;Calzetti 2000 equation is | |
53 | +;funred = flux*10.0^(0.4*klam*ebv) | |
54 | +;stop | |
55 | + | |
56 | +;ebv=alog10(funred/flux)/0.4/klam | |
57 | +ebv=alog10(flux_ratio)/0.4/klam | |
58 | + | |
59 | +RETURN,ebv | |
60 | + | |
61 | +END | |
0 | 62 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,18 @@ |
1 | +FUNCTION dustem_muse_filter_conversion_factor,filter,pivot_wav=pivot_wav | |
2 | + | |
3 | +;print,dustem_muse_filter_conversion_factor('SDSS_i',pivot_wav=pivot_wav) | |
4 | + | |
5 | +filename=!dustem_wrap_soft_dir+'/Data/FILTERS/filters_pivot_factors.xcat' | |
6 | +st=read_xcat(filename,/silent) | |
7 | + | |
8 | +ind=where(st.filter EQ filter,count) | |
9 | + | |
10 | +pivot_wav=st[ind[0]].wave | |
11 | +conversion_factor=st[ind[0]].factor | |
12 | +wave_prefix=st[ind[0]].prefix | |
13 | + | |
14 | +use_conversion_factor=conversion_factor/wave_prefix | |
15 | + | |
16 | +RETURN,use_conversion_factor | |
17 | + | |
18 | +END | |
0 | 19 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,25 @@ |
1 | +PRO inspect_emiles_ssp | |
2 | + | |
3 | +loadct,13 | |
4 | +;dir='/Users/jpb/Soft_Libraries/dustem-wrapper_idl/Data/SSPs/ssp_emiles-ch/' | |
5 | +dir='/Users/jpb/Soft_Libraries/dustem-wrapper_idl/Data/SSPs/eMILES_Ch-young-MetalPoorRemoved/' | |
6 | +files=file_search(dir+'*.fits') | |
7 | +Nfiles=n_elements(files) | |
8 | +yr=[1.e-5,1.e-2] | |
9 | +xtit='Wavelenght [mic]' | |
10 | +ytit='Intensity []' | |
11 | +colours=long(range_gen(Nfiles,[0,255])) | |
12 | +FOR i=0L,Nfiles-1 DO BEGIN | |
13 | + message,'reading '+files[i],/continue | |
14 | + d=readfits(files[i],h) | |
15 | + make_axis,h,wav | |
16 | + wav=wav/1.e10*1.e6 | |
17 | + IF i EQ 0 THEN BEGIN | |
18 | + cgplot,wav,d,/xlog,/ylog,yrange=yr,xtit=xtit,ytit=ytit | |
19 | + ENDIF ELSE BEGIN | |
20 | + cgoplot,wav,d,color=colours[i] | |
21 | + stop | |
22 | + ENDELSE | |
23 | +ENDFOR | |
24 | + | |
25 | +END | |
0 | 26 | \ No newline at end of file | ... | ... |