Commit de039e3cb80d8b82d292587a06fe5745ca931113
1 parent
997bd805
Exists in
master
comments and cleanup
Showing
1 changed file
with
22 additions
and
26 deletions
Show diff stats
src/idl/dustem_compute_gb_sed.pro
1 | -FUNCTION dustem_compute_gb_sed,p_dim,_extra=extra,waves=waves,spec=spec | |
1 | +FUNCTION dustem_compute_gb_sed,p_dim $ | |
2 | + ,_extra=extra $ | |
3 | + ,waves=waves $ | |
4 | + ,spec=spec $ | |
5 | + ,help=help | |
2 | 6 | |
3 | 7 | ;+ |
4 | 8 | ; NAME: |
5 | 9 | ; dustem_compute_gb_sed |
6 | 10 | ; PURPOSE: |
7 | -; Computes an SED from a given Grey Body spectrum | |
11 | +; Computes an SED for a modified blackbody | |
8 | 12 | ; CATEGORY: |
9 | 13 | ; Dustem |
10 | 14 | ; CALLING SEQUENCE: |
11 | -; sed=dustem_compute_sed(p_dim[,st=][,cont=][,_extra=][,/help]) | |
15 | +; sed=dustem_compute_sed(p_dim[,st=][,_extra=][,/help]) | |
12 | 16 | ; INPUTS: |
13 | -; p_dim = parameter values | |
17 | +; p_dim = [a0,a1,a2] modified blackbody parameter values | |
18 | +; a0 -- normalisation | |
19 | +; a1 -- dust temperature | |
20 | +; a2 -- emissivity | |
14 | 21 | ; OPTIONAL INPUT PARAMETERS: |
15 | 22 | ; None |
16 | 23 | ; OUTPUTS: |
... | ... | @@ -18,21 +25,21 @@ FUNCTION dustem_compute_gb_sed,p_dim,_extra=extra,waves=waves,spec=spec |
18 | 25 | ; OPTIONAL OUTPUT PARAMETERS: |
19 | 26 | ; None |
20 | 27 | ; ACCEPTED KEY-WORDS: |
21 | -; help = If set, print this help | |
28 | +; help = if set, print this help | |
22 | 29 | ; COMMON BLOCKS: |
23 | 30 | ; None |
24 | 31 | ; SIDE EFFECTS: |
25 | 32 | ; None |
26 | 33 | ; RESTRICTIONS: |
27 | -; The dustem idl wrapper must be installed | |
34 | +; The DustEMWrap IDL code must be installed | |
28 | 35 | ; PROCEDURE: |
29 | 36 | ; None |
30 | 37 | ; EXAMPLES |
31 | 38 | ; |
32 | 39 | ; MODIFICATION HISTORY: |
33 | -; Written by J.-Ph. Bernard | |
34 | -; see evolution details on the dustem cvs maintained at CESR | |
35 | -; Contact J.-Ph. Bernard (Jean-Philippe.Bernard@cesr.fr) in case of problems. | |
40 | +; Written JP Bernard 2011 | |
41 | +; Evolution details on the DustEMWrap gitlab. | |
42 | +; See http://dustemwrap.irap.omp.eu/ for FAQ and help. | |
36 | 43 | ;- |
37 | 44 | |
38 | 45 | IF keyword_set(help) THEN BEGIN |
... | ... | @@ -43,19 +50,14 @@ ENDIF |
43 | 50 | |
44 | 51 | ;==== Compute Black body spectrum |
45 | 52 | pp=double(p_dim) |
46 | -;NNw=1000L | |
47 | -;wwmin=10. & wwmax=10000. | |
48 | 53 | NNw=20L |
49 | 54 | wwmin=50. & wwmax=10000. |
50 | -;ww=dindgen(NNw)/(1.*NNw-1)*(wwmax-wwmin)+wwmin | |
51 | 55 | ww=dindgen(NNw)/(1.*NNw-1)*(alog10(wwmax)-alog10(wwmin))+alog10(wwmin) |
52 | 56 | ww=10.^ww |
53 | 57 | waves=ww |
54 | -;stop | |
55 | 58 | |
56 | -;GET THE OBSERVATIONS AND ERRORS | |
59 | +;MAKE A COPY OF THE (EMPTY) OBSERVED VALUES | |
57 | 60 | obs_sed = (*!dustem_data.sed).values |
58 | -err_sed = (*!dustem_data.sed).sigma | |
59 | 61 | |
60 | 62 | ;COMPUTE THE MODEL SED |
61 | 63 | dustem_sed = obs_sed*0.D0 |
... | ... | @@ -67,12 +69,6 @@ ENDIF ELSE BEGIN |
67 | 69 | message,'SKIPPING color correction calculations',/info |
68 | 70 | ENDELSE |
69 | 71 | |
70 | -;IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN | |
71 | -; message,'DOING color correction calculations',/info | |
72 | -;ENDIF ELSE BEGIN | |
73 | -; message,'SKIPPING color correction calculations',/info | |
74 | -;ENDELSE | |
75 | - | |
76 | 72 | ;stop |
77 | 73 | IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN |
78 | 74 | ; message,'DOING color correction calculations',/info |
... | ... | @@ -83,14 +79,14 @@ IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN |
83 | 79 | ssed=dustem_cc(ww,spec,((*!dustem_data.sed).filt_names)(ind_sed),cc=cc) |
84 | 80 | ;print,cc |
85 | 81 | ; ENDFOR |
86 | - dustem_sed(ind_sed)=ssed | |
82 | + dustem_sed[ind_sed]=ssed | |
87 | 83 | ENDIF |
88 | 84 | ENDIF ELSE BEGIN |
89 | - www=dustem_filter2wav(((*!dustem_data.sed).filt_names)(ind_sed)) | |
90 | - dustem_sed(ind_sed)=pp(0)*(www)^(-1.*pp(2))*dustem_planck_function(pp(1),www)*(*!dustem_previous_cc) | |
85 | + www=dustem_filter2wav(((*!dustem_data.sed).filt_names)[ind_sed]) | |
86 | + dustem_sed[ind_sed]=pp(0)*(www)^(-1.*pp(2))*dustem_planck_function(pp(1),www)*(*!dustem_previous_cc) | |
91 | 87 | message,'SKIPPING color correction calculations',/info |
92 | 88 | ; dustem_sed(ind_sed)=interpol(spec,ww,1.D0*(((*!dustem_data).wav)(ind_sed)))*(*!dustem_previous_cc) |
93 | -spec= dustem_sed(ind_sed) | |
89 | +spec= dustem_sed[ind_sed] | |
94 | 90 | ENDELSE |
95 | 91 | |
96 | 92 | ;stop |
... | ... | @@ -99,7 +95,7 @@ ENDELSE |
99 | 95 | ;wavelengths points exist in the model (long wavelengths). |
100 | 96 | ind_spec=where((*!dustem_data.sed).filt_names EQ 'SPECTRUM',count_spec) |
101 | 97 | IF count_spec NE 0 THEN BEGIN |
102 | - dustem_sed(ind_spec)=interpol(spec,ww,(((*!dustem_data.sed).wav)(ind_spec))) | |
98 | + dustem_sed[ind_spec]=interpol(spec,ww,(((*!dustem_data.sed).wav)[ind_spec])) | |
103 | 99 | ; dustem_sed(ind_spec)=10^interpol(alog10(spec),alog10(st.sed.wav),alog10((((*!dustem_data.sed).wav)(ind_spec)))) |
104 | 100 | ENDIF |
105 | 101 | ... | ... |