Commit cc7d8a097935fa58cfeea6c953e9c541cf17d8e7
1 parent
14530974
Exists in
master
changed
Showing
1 changed file
with
14 additions
and
9 deletions
Show diff stats
src/idl/dustem_cc.pro
... | ... | @@ -96,7 +96,11 @@ FOR i=0L,Nbands-1 DO BEGIN |
96 | 96 | ; stop |
97 | 97 | ii=(where(st.filter_names EQ filter_names[i]))[0] |
98 | 98 | spec0=interpol(spec2,wavein2,st.central_wavelengths[ii]) |
99 | - | |
99 | + IF spec0 EQ 0 THEN BEGIN | |
100 | + sed[i]=spec0 | |
101 | + cc[i]=1 | |
102 | + goto,next_filter | |
103 | + ENDIF | |
100 | 104 | IF !dustem_do_cc NE 0 and not !dustem_never_do_cc THEN BEGIN ;Color corrections are computed |
101 | 105 | ; print,'DOING color correction calculations' |
102 | 106 | CASE strupcase(fluxconvs[i]) OF |
... | ... | @@ -116,7 +120,7 @@ FOR i=0L,Nbands-1 DO BEGIN |
116 | 120 | ;stop |
117 | 121 | ccc=hfi_color_correction_dustem(bp.name,bp.freq/1.d9,bp.trans,channel, bolo_cc,nu, spec_int) |
118 | 122 | ; ccc=hfi_color_correction(bp,channel, bolo_cc,nu, spec_int) |
119 | - cc(i)=ccc.cc | |
123 | + cc[i]=ccc.cc | |
120 | 124 | END |
121 | 125 | 'HFI': BEGIN |
122 | 126 | spec_int=interpol(spec2,wavein2,*(st.use_wavelengths(ii))) |
... | ... | @@ -128,13 +132,13 @@ FOR i=0L,Nbands-1 DO BEGIN |
128 | 132 | trans=trans(order) |
129 | 133 | channel=strtrim(round(dustem_filter2freq(filter_names(i))),2) |
130 | 134 | ccc=hfi_color_correction_dustem(channel,nu,trans,channel, bolo_cc,nu, spec_int) |
131 | - cc(i)=ccc.cc | |
135 | + cc[i]=ccc.cc | |
132 | 136 | END |
133 | 137 | 'NUINU=CSTE': BEGIN |
134 | 138 | spec_int=interpol(spec2,wavein2,*(st.use_wavelengths(ii))) |
135 | 139 | num=integral(*(st.use_wavelengths(ii)),spec_int*(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii)))^2.,st.use_wmin(ii),st.use_wmax(ii),/double) |
136 | 140 | den=integral(*(st.use_wavelengths(ii)),(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii))),st.use_wmin(ii),st.use_wmax(ii),/double) |
137 | - cc(i)=num/den/spec0*(st.central_wavelengths(ii)) | |
141 | + cc[i]=num/den/spec0*(st.central_wavelengths(ii)) | |
138 | 142 | END |
139 | 143 | 'FLAMBDA=CSTE': BEGIN |
140 | 144 | ; stop |
... | ... | @@ -160,19 +164,19 @@ FOR i=0L,Nbands-1 DO BEGIN |
160 | 164 | num=integral(*(st.use_wavelengths(ii)),spec_int*(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii)))^2.,st.use_wmin(ii),st.use_wmax(ii),/double) |
161 | 165 | den=integral(*(st.use_wavelengths(ii)),*(st.use_transmissions(ii))/(*(st.use_wavelengths(ii)))^5/expon,st.use_wmin(ii),st.use_wmax(ii),/double) |
162 | 166 | ffact=st.central_wavelengths(ii)*1e-6*K*T_0 |
163 | - cc(i)=num/den/spec0/(st.central_wavelengths(ii))^3/(exp(fact/ffact)-1.) | |
167 | + cc[i]=num/den/spec0/(st.central_wavelengths(ii))^3/(exp(fact/ffact)-1.) | |
164 | 168 | END |
165 | 169 | 'IRAC': BEGIN |
166 | 170 | spec_int=interpol(spec2,wavein2,*(st.use_wavelengths(ii))) |
167 | 171 | num=integral(*(st.use_wavelengths(ii)),spec_int*(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii))),st.use_wmin(ii),st.use_wmax(ii),/double) |
168 | 172 | den=integral(*(st.use_wavelengths(ii)),*(st.use_transmissions(ii)),st.use_wmin(ii),st.use_wmax(ii),/double) |
169 | - cc(i)=num/den/spec0*(st.central_wavelengths(ii)) | |
173 | + cc[i]=num/den/spec0*(st.central_wavelengths(ii)) | |
170 | 174 | END |
171 | 175 | 'CMB': BEGIN |
172 | 176 | spec_int=interpol(spec2,wavein2,*(st.use_wavelengths(ii))) |
173 | 177 | num=integral(*(st.use_wavelengths(ii)),spec_int*(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii)))^2.,st.use_wmin(ii),st.use_wmax(ii),/double) |
174 | 178 | den=integral(*(st.use_wavelengths(ii)),(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii))^2)*dustem_planck_function(Tcmb,*(st.use_wavelengths(ii))),st.use_wmin(ii),st.use_wmax(ii),/double) |
175 | - cc(i)=num/den*dustem_planck_function(Tcmb,st.central_wavelengths(ii))/spec0 | |
179 | + cc[i]=num/den*dustem_planck_function(Tcmb,st.central_wavelengths(ii))/spec0 | |
176 | 180 | END |
177 | 181 | 'LABOCA': BEGIN |
178 | 182 | ; spec_int=interpol(spec2,wavein2,*(st.use_wavelengths(ii))) |
... | ... | @@ -184,11 +188,11 @@ FOR i=0L,Nbands-1 DO BEGIN |
184 | 188 | spec_int=interpol(spec2,wavein2,*(st.use_wavelengths(ii))) |
185 | 189 | num=integral(*(st.use_wavelengths(ii)),spec_int*(*(st.use_transmissions(ii)))/(*(st.use_wavelengths(ii))),st.use_wmin(ii),st.use_wmax(ii),/double) |
186 | 190 | den=integral(*(st.use_wavelengths(ii)),*(st.use_transmissions(ii))/(*(st.use_wavelengths(ii))^(alpha_new+2.)),st.use_wmin(ii),st.use_wmax(ii),/double) |
187 | - cc(i)=num/den/spec0*(st.central_wavelengths(ii))^(-(alpha_new+1.)) | |
191 | + cc[i]=num/den/spec0*(st.central_wavelengths(ii))^(-(alpha_new+1.)) | |
188 | 192 | |
189 | 193 | END |
190 | 194 | ELSE:BEGIN |
191 | - message,strupcase(fluxconvs(i))+' not recognized',/info | |
195 | + message,strupcase(fluxconvs[i])+' not recognized',/info | |
192 | 196 | cc[i]=1. |
193 | 197 | ;stop |
194 | 198 | END |
... | ... | @@ -200,6 +204,7 @@ FOR i=0L,Nbands-1 DO BEGIN |
200 | 204 | ENDIF |
201 | 205 | ENDELSE |
202 | 206 | IF finite(cc[i]) THEN sed[i]=spec0*cc[i] ELSE sed[i]=spec0 |
207 | + next_filter: | |
203 | 208 | ENDFOR |
204 | 209 | |
205 | 210 | the_end: | ... | ... |