Commit c459f800c79b47f350b6c69a8ee20194739fcd5c

Authored by Annie Hughes
1 parent 690f5f48
Exists in master

overhauled filter reading to improve traceability

Showing 1 changed file with 514 additions and 374 deletions   Show diff stats
src/idl/dustem_read_filters.pro
1   -;FUNCTION dustem_read_filters,bidon,plot_it=plot_it,help=help
2 1 FUNCTION dustem_read_filters,plot_it=plot_it,help=help
3 2  
4 3 ;+
... ... @@ -6,56 +5,57 @@ FUNCTION dustem_read_filters,plot_it=plot_it,help=help
6 5 ; dustem_read_filters
7 6 ;
8 7 ; PURPOSE:
9   -;Read filter information into the filter structure
10   -;cc_method is the name of the IDL functions used to compute SED for
11   -;those filters, including color correction appropriate for each
12   -;insrument.
  8 +; Read filter information into the filter structure
13 9 ;
14   -;Fields of the structure are as follows:
  10 +; cc_method is the name of the IDL function used to compute the SED for
  11 +; those filters, including the color correction appropriate for each
  12 +; instrument.
15 13 ;
16   -;Name:Filter name
17   -;Nbands: Number of photometric bands
18   -;filter_names: Name of the filters
19   -;central_wavelengths: Filter central wavelengths (microns)
20   -;central_frequencies: Filter central frequencies (Hz)
21   -;filter_frequencies: Pointer array towards filter frequency arrays for each filter
22   -;filter_transmissions: Pointer array towards filter transmission arrays for each filter
23   -;use_frequencies: Pointer array towards filter frequencies to be used for in-band integrations of a given model (empty at this stage)
24   -;use_transmissions: Pointer array towards filter transmission interpolated on use_frequencies (empty at this stage)
25   -;cc_method: Color correction method to be used for these filters
  14 +; The tags of the filter structure are:
26 15 ;
27   -;The following instruments are known:
28   - ;; IRAC:irac_struct, $
29   - ;; MIPS:mips_struct, $
30   - ;; MSX:msx_struct, $
31   - ;; IRAS:iras_struct, $
32   - ;; DIRBE:dirbe_struct, $
33   - ;; SPM:spm_struct, $
34   - ;; ISOCAM:isocam_struct, $
35   - ;; ISOPHOTP:isophotP_struct, $
36   - ;; ISOPHOTC:isophotC_struct, $
37   - ;; EFIRAS:efiras_struct, $
38   - ;; ARCHEOPS:archeops_struct, $
39   - ;; HFI:hfi_struct, $
40   - ;; LFI:lfi_struct, $
41   - ;; WMAP:wmap_struct, $
42   - ;; SPIRE:spire_struct, $
43   - ;; PACS:pacs_struct, $
44   - ;; PILOT:pilot_struct, $
45   - ;; AKARI:akari_struct, $
46   - ;; BOLOCAM:bolocam_struct, $
47   - ;; WISE:wise_struct, $
48   - ;; LABOCA:laboca_struct, $
49   - ;; GISMO:gismo_struct, $
50   - ;; SPASS:spass_struct, $
51   - ;; NIKA2:nika2_struct, $
52   - ;; SCUBA2:scuba2_struct, $
53   - ;; IRS:irs_struct, $
54   - ;; MIRI:miri_struct, $
55   - ;; NIRCAM:nircam_struct, $
56   - ;; NIRCAMA:nircama_struct, $
57   - ;; NIRCAMB:nircamb_struct, $
58   - ;; NIRISS:niriss_struct $
  16 +; Name: Filter name
  17 +; Nbands: Number of photometric bands
  18 +; filter_names: Name of the filters
  19 +; central_wavelengths: Filter central wavelengths (microns)
  20 +; central_frequencies: Filter central frequencies (Hz)
  21 +; filter_frequencies: Pointer array towards filter frequency arrays for each filter
  22 +; filter_transmissions: Pointer array towards filter transmission arrays for each filter
  23 +; use_frequencies: Pointer array towards filter frequencies to be used for in-band integrations of a given model (empty at this stage)
  24 +; use_transmissions: Pointer array towards filter transmission interpolated on use_frequencies (empty at this stage)
  25 +; cc_method: Color correction method to be used for these filters
  26 +;
  27 +; The following instruments are known:
  28 +;; IRAC:irac_struct, $
  29 +;; MIPS:mips_struct, $
  30 +;; MSX:msx_struct, $
  31 +;; IRAS:iras_struct, $
  32 +;; DIRBE:dirbe_struct, $
  33 +;; SPM:spm_struct, $
  34 +;; ISOCAM:isocam_struct, $
  35 +;; ISOPHOTP:isophotP_struct, $
  36 +;; ISOPHOTC:isophotC_struct, $
  37 +;; EFIRAS:efiras_struct, $
  38 +;; ARCHEOPS:archeops_struct, $
  39 +;; HFI:hfi_struct, $
  40 +;; LFI:lfi_struct, $
  41 +;; WMAP:wmap_struct, $
  42 +;; SPIRE:spire_struct, $
  43 +;; PACS:pacs_struct, $
  44 +;; PILOT:pilot_struct, $
  45 +;; AKARI:akari_struct, $
  46 +;; BOLOCAM:bolocam_struct, $
  47 +;; WISE:wise_struct, $
  48 +;; LABOCA:laboca_struct, $
  49 +;; SABOCA:saboca_struct, $
  50 +;; GISMO:gismo_struct, $
  51 +;; SPASS:spass_struct, $
  52 +;; NIKA2:nika2_struct, $
  53 +;; SCUBA2:scuba2_struct, $
  54 +;; HAWCPLUS:hawcplus_struct, $
  55 +;; IRS:irs_struct, $
  56 +;; MIRI:miri_struct, $
  57 +;; NIRCAM:nircam_struct, $
  58 +;; NIRISS:niriss_struct $
59 59 ;
60 60 ; CATEGORY:
61 61 ; DustEMWrap, Distributed, Low-Level, Instrument Filters
... ... @@ -96,16 +96,16 @@ FUNCTION dustem_read_filters,plot_it=plot_it,help=help
96 96  
97 97 quiet_old=!quiet
98 98 !quiet=1
99   -eptr=ptr_new() ;Empty pointer
  99 +print_messages=1 ;flag to print filter names when reading filters
  100 +
  101 +eptr=ptr_new() ;Empty pointer
100 102  
101 103 cmic=2.9979246D14
102 104 ccm=2.9979246D10
103   -;cmic=3.e14
104   -;ccm=3.e10
105 105  
  106 +;; as of 12 jan 2023, we use SVO Planck-HFI filters
106 107 ;which_hfi_filters='GL'
107   -which_hfi_filters='OFFICIAL'
108   -print_messages=0 ;to print filter names when reading filters
  108 +;which_hfi_filters='OFFICIAL'
109 109  
110 110 ;======================================================
111 111 ;==== directories containing filter information
... ... @@ -125,9 +125,11 @@ dir_hfi=filter_dir+'HFI'+'/'
125 125 dir_bol=filter_dir+'BOLOCAM'+'/'
126 126 dir_wise=filter_dir+'WISE'+'/'
127 127 dir_laboca=filter_dir+'LABOCA'+'/'
  128 +dir_saboca=filter_dir+'SABOCA'+'/'
128 129 dir_gismo=filter_dir+'GISMO'+'/'
129   -IF which_hfi_filters EQ 'GL' THEN dir_hfi=filter_dir+'HFI/FromGL/bandpass'+'/'
130   -IF which_hfi_filters EQ 'OFFICIAL' THEN dir_hfi=filter_dir+'HFI/OFFICIAL'+'/'
  130 +dir_hfi=filter_dir+'HFI'+'/'
  131 +;;IF which_hfi_filters EQ 'GL' THEN dir_hfi=filter_dir+'HFI/FromGL/bandpass'+'/'
  132 +;;IF which_hfi_filters EQ 'OFFICIAL' THEN dir_hfi=filter_dir+'HFI/OFFICIAL'+'/'
131 133 dir_lfi=filter_dir+'LFI'+'/'
132 134 dir_wmap=filter_dir+'WMAP'+'/'
133 135 dir_spire=filter_dir+'SPIRE'+'/'
... ... @@ -138,6 +140,7 @@ dir_spass=filter_dir+'SPASS'+'/'
138 140 ;dir_chipass=filter_dir+'CHIPASS'+'/'
139 141 dir_nika2=filter_dir+'NIKA2'+'/'
140 142 dir_scuba2=filter_dir+'SCUBA2'+'/'
  143 +dir_hawcplus=filter_dir+'HAWCPLUS'+'/'
141 144 dir_irs=filter_dir+'IRS'+'/'
142 145 dir_miri=filter_dir+'MIRI'+'/'
143 146 dir_nircam=filter_dir+'NIRCam'+'/'
... ... @@ -155,27 +158,35 @@ Nband=n_elements(filt_names)
155 158 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
156 159 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
157 160  
158   -;This is the detector transmission
159   -file=dir_pacs+'PCalPhotometer_Absorption_FM_v2.fits'
160   -wave=mrdfits(file,1,h,silent=1);,/silent)
161   -Trans=mrdfits(file,2,h,silent=1);/silent)
162   -
163   -;This is the filters transmission
164   -file=dir_pacs+'PCalPhotometer_FilterTransmission_FM_v1.fits'
165   -st1=mrdfits(file,1,h,silent=1) & lamb1=st1.wavelength & T1=st1.transmission
166   -st2=mrdfits(file,2,h,silent=1) & lamb2=st2.wavelength & T2=st2.transmission
167   -st3=mrdfits(file,3,h,silent=1) & lamb3=st3.wavelength & T3=st3.transmission
168   -
169   -TT1=interpol(Trans,wave,lamb1)
170   -TT2=interpol(Trans,wave,lamb2)
171   -TT3=interpol(Trans,wave,lamb3)
172   -T1=T1*TT1
173   -T2=T2*TT2
174   -T3=T3*TT3
175   -;== Caution: filters have to be put back in the right order
176   -T_ptr(0)=ptr_new(T2/max(T2)) & nu_ptr(0)=ptr_new(cmic/lamb2) & wav_ptr(0)=ptr_new(lamb2)
177   -T_ptr(1)=ptr_new(T3/max(T3)) & nu_ptr(1)=ptr_new(cmic/lamb3) & wav_ptr(1)=ptr_new(lamb3)
178   -T_ptr(2)=ptr_new(T1/max(T1)) & nu_ptr(2)=ptr_new(cmic/lamb1) & wav_ptr(2)=ptr_new(lamb1)
  161 +;; ;This is the detector transmission
  162 +;; file=dir_pacs+'PCalPhotometer_Absorption_FM_v2.fits'
  163 +;; wave=mrdfits(file,1,h,silent=1);,/silent)
  164 +;; Trans=mrdfits(file,2,h,silent=1);/silent)
  165 +
  166 +;; ;This is the filters transmission
  167 +;; file=dir_pacs+'PCalPhotometer_FilterTransmission_FM_v1.fits'
  168 +;; st1=mrdfits(file,1,h,silent=1) & lamb1=st1.wavelength & T1=st1.transmission
  169 +;; st2=mrdfits(file,2,h,silent=1) & lamb2=st2.wavelength & T2=st2.transmission
  170 +;; st3=mrdfits(file,3,h,silent=1) & lamb3=st3.wavelength & T3=st3.transmission
  171 +
  172 +;; TT1=interpol(Trans,wave,lamb1)
  173 +;; TT2=interpol(Trans,wave,lamb2)
  174 +;; TT3=interpol(Trans,wave,lamb3)
  175 +;; T1=T1*TT1
  176 +;; T2=T2*TT2
  177 +;; T3=T3*TT3
  178 +;; ;== Caution: filters have to be put back in the right order
  179 +;; T_ptr[0]=ptr_new(T2/max(T2)) & nu_ptr[0]=ptr_new(cmic/lamb2) & wav_ptr[0]=ptr_new(lamb2)
  180 +;; T_ptr[1]=ptr_new(T3/max(T3)) & nu_ptr[1]=ptr_new(cmic/lamb3) & wav_ptr[1]=ptr_new(lamb3)
  181 +;; T_ptr[2]=ptr_new(T1/max(T1)) & nu_ptr[2]=ptr_new(cmic/lamb1) & wav_ptr[2]=ptr_new(lamb1)
  182 +
  183 +readcol, dir_pacs+dustem_filter2filter_filename(filt_names[0]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4
  184 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  185 +readcol, dir_pacs+dustem_filter2filter_filename(filt_names[1]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4
  186 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  187 +readcol, dir_pacs+dustem_filter2filter_filename(filt_names[2]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4
  188 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  189 +
179 190  
180 191 pacs_struct={Name:'PACS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_pacs,central_frequencies:cmic/wfilt_pacs, $
181 192 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -190,7 +201,7 @@ pacs_struct={Name:'PACS',Nbands:Nband,filter_names:filt_names,central_wavelength
190 201 ;======================================================
191 202 IF print_messages THEN message,'Reading PILOT filter',/continue
192 203  
193   -;Read WMAP filter Transmission
  204 +;Read PILOT filter Transmission
194 205 filt_names=['PILOT1']
195 206 wfilt_pilot=dustem_filter2wav(filt_names)
196 207 Nband=n_elements(filt_names)
... ... @@ -198,7 +209,7 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
198 209 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
199 210 stP=read_xcat(dir_pilot+'pilot_transmission.xcat',/silent)
200 211 Trans=stP.transmission & lamb=stP.wavelength;cmic/(stP.frequency*1e9) ;microns
201   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
  212 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
202 213  
203 214 pilot_struct={Name:'PILOT',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_pilot,central_frequencies:cmic/wfilt_pilot, $
204 215 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -215,31 +226,40 @@ wfilt_spire=dustem_filter2wav(filt_names)
215 226 Nband=n_elements(filt_names)
216 227 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
217 228 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
218   -;==== CAUTION: problem with SPIRE transmission file badly read by
219   -;==== readcol because of ^M
220   -;readcol,dir_spire+'SPIRE_transmissions.txt',nn,T1,T2,T3
221   -openr,unit,dir_spire+'SPIRE_transmissions.txt',/get_lun
222   -sstr=' '
223   -readf,unit,sstr
224   -readf,unit,sstr
225   -readf,unit,sstr
226   -T1=[0.] & T2=T1 & T3=T1 & nn=T1
227   -WHILE not eof(unit) DO BEGIN
228   - readf,unit,sstr
229   - vv=float(str_sep(sstr,' '))
230   - nn=[nn,vv(0)]
231   - T1=[T1,vv(1)]
232   - T2=[T2,vv(2)]
233   - T3=[T3,vv(3)]
234   -ENDWHILE
235   -nn=nn[1:*] & T1=T1[1:*] & T2=T2[1:*] & T3=T3[1:*]
236   -lamb=1./nn*1.e4 ;in microns
237   -T_ptr(0)=ptr_new(T1/max(T1)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
238   -T_ptr(1)=ptr_new(T2/max(T2)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
239   -T_ptr(2)=ptr_new(T3/max(T3)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
240 229  
  230 +;; ;==== CAUTION: problem with SPIRE transmission file badly read by
  231 +;; ;==== readcol because of ^M
  232 +;; ;readcol,dir_spire+'SPIRE_transmissions.txt',nn,T1,T2,T3
  233 +;; openr,unit,dir_spire+'SPIRE_transmissions.txt',/get_lun
  234 +;; sstr=' '
  235 +;; readf,unit,sstr
  236 +;; readf,unit,sstr
  237 +;; readf,unit,sstr
  238 +;; T1=[0.] & T2=T1 & T3=T1 & nn=T1
  239 +;; WHILE not eof(unit) DO BEGIN
  240 +;; readf,unit,sstr
  241 +;; vv=float(str_sep(sstr,' '))
  242 +;; nn=[nn,vv(0)]
  243 +;; T1=[T1,vv(1)]
  244 +;; T2=[T2,vv(2)]
  245 +;; T3=[T3,vv(3)]
  246 +;; ENDWHILE
  247 +;; nn=nn[1:*] & T1=T1[1:*] & T2=T2[1:*] & T3=T3[1:*]
  248 +;; lamb=1./nn*1.e4 ;in microns
  249 +;; T_ptr[0]=ptr_new(T1/max(T1)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  250 +;; T_ptr[1]=ptr_new(T2/max(T2)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  251 +;; T_ptr[2]=ptr_new(T3/max(T3)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  252 +;; close,unit
  253 +;; free_lun,unit
241 254 ;stop
242 255  
  256 +readcol, dir_spire+dustem_filter2filter_filename(filt_names[0]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4
  257 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  258 +readcol, dir_spire+dustem_filter2filter_filename(filt_names[1]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4
  259 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  260 +readcol, dir_spire+dustem_filter2filter_filename(filt_names[2]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4
  261 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  262 +
243 263 spire_struct={Name:'SPIRE',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spire,central_frequencies:cmic/wfilt_spire, $
244 264 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
245 265 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:fltarr(Nband),use_wmax:fltarr(Nband), $
... ... @@ -263,15 +283,15 @@ stQ=read_xcat(dir_wmap+'wmap_bandpass_Q_v3.xcat',/silent)
263 283 stV=read_xcat(dir_wmap+'wmap_bandpass_V_v3.xcat',/silent)
264 284 stW=read_xcat(dir_wmap+'wmap_bandpass_W_v3.xcat',/silent)
265 285 Trans=stW.transmission & lamb=cmic/(stW.frequency*1e9) ;microns
266   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
  286 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
267 287 Trans=stV.transmission & lamb=cmic/(stV.frequency*1e9)
268   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
  288 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
269 289 Trans=stQ.transmission & lamb=cmic/(stQ.frequency*1e9)
270   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
  290 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
271 291 Trans=stKa.transmission & lamb=cmic/(stKa.frequency*1e9)
272   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb)
  292 +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb)
273 293 Trans=stK.transmission & lamb=cmic/(stK.frequency*1e9)
274   -T_ptr(4)=ptr_new(Trans/max(Trans)) & nu_ptr(4)=ptr_new(cmic/lamb) & wav_ptr(4)=ptr_new(lamb)
  294 +T_ptr[4]=ptr_new(Trans/max(Trans)) & nu_ptr[4]=ptr_new(cmic/lamb) & wav_ptr[4]=ptr_new(lamb)
275 295  
276 296 wmap_struct={Name:'WMAP',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_wmap,central_frequencies:cmic/wfilt_wmap, $
277 297 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -290,14 +310,14 @@ wfilt_irac=dustem_filter2wav(filt_names)
290 310 Nband=n_elements(filt_names)
291 311 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
292 312 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
293   -readcol, dir_spitzer+'irac1.dat', lamb, Trans, /silent
294   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
295   -readcol, dir_spitzer+'irac2.dat', lamb, Trans, /silent
296   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
297   -readcol, dir_spitzer+'irac3.dat', lamb, Trans, /silent
298   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
299   -readcol, dir_spitzer+'irac4.dat', lamb, Trans, /silent
300   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb)
  313 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[0]), lamb, Trans, /silent,format='F,F',comment='#'
  314 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  315 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[1]), lamb, Trans, /silent,format='F,F',comment='#'
  316 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  317 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[2]), lamb, Trans, /silent,format='F,F',comment='#'
  318 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  319 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[3]), lamb, Trans, /silent,format='F,F',comment='#'
  320 +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb)
301 321 irac_struct={Name:'Spitzer-IRAC',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_irac,central_frequencies:cmic/wfilt_irac, $
302 322 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
303 323 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_irac'}
... ... @@ -314,13 +334,12 @@ wfilt=dustem_filter2wav(filt_names)
314 334 Nband=n_elements(filt_names)
315 335 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
316 336 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
317   -readcol, dir_spitzer+'MIPSfiltsumm_24.txt', lamb, Trans,/silent
318   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
319   -readcol, dir_spitzer+'MIPSfiltsumm_70.txt', lamb, Trans,/silent
320   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
321   -readcol, dir_spitzer+'MIPSfiltsumm_160.txt', lamb, Trans,/silent
322   -;stop
323   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
  337 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[0]), lamb, Trans,/silent,format='F,F',comment='#'
  338 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  339 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[1]), lamb, Trans,/silent,format='F,F',comment='#'
  340 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  341 +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[2]), lamb, Trans,/silent,format='F,F',comment='#'
  342 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
324 343 mips_struct={Name:'Spitzer-MIPS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt,central_frequencies:cmic/wfilt, $
325 344 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
326 345 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_mips'}
... ... @@ -332,19 +351,29 @@ IF print_messages THEN message,'Reading MSX filters',/continue
332 351  
333 352 ;Read MSX filter Transmission
334 353 ;Strongly inspired from N. Flagey's routine get_msx_flux.pro
335   -filt_names=['MSX1','MSX2','MSX3','MSX4']
  354 +filt_names=['MSX1','MSX2','MSX3','MSX4','MSX5','MSX6']
336 355 wfilt=dustem_filter2wav(filt_names)
337 356 Nband=n_elements(filt_names)
338 357 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
339 358 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
340   -readcol,dir_msx+'dsi_aw.dat',lamb,Trans, /silent
341   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
342   -readcol,dir_msx+'dsi_cw.dat',lamb,Trans, /silent
343   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
344   -readcol,dir_msx+'dsi_dw.dat',lamb,Trans, /silent
345   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
346   -readcol,dir_msx+'dsi_ew.dat',lamb,Trans, /silent
347   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb)
  359 +
  360 +FOR k=0L,Nband-1 DO BEGIN
  361 + readcol,dir_msx+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmission, /silent,format='F,F',comment='#'
  362 + waves_mic=waves_angstrom/1.e10*1.e6
  363 + freq=cmic/waves_mic
  364 + Trans=transmission
  365 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
  366 +ENDFOR
  367 +
  368 +;; readcol,dir_msx+'dsi_aw.dat',lamb,Trans, /silent
  369 +;; T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  370 +;; readcol,dir_msx+'dsi_cw.dat',lamb,Trans, /silent
  371 +;; T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  372 +;; readcol,dir_msx+'dsi_dw.dat',lamb,Trans, /silent
  373 +;; T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  374 +;; readcol,dir_msx+'dsi_ew.dat',lamb,Trans, /silent
  375 +;; T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb)
  376 +
348 377 msx_struct={Name:'MSX',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt,central_frequencies:cmic/wfilt, $
349 378 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
350 379 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_msx'}
... ... @@ -359,8 +388,8 @@ wfilt=dustem_filter2wav(filt_names)
359 388 Nband=n_elements(filt_names)
360 389 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
361 390 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
362   -readcol,dir_bol+'bolocam_1p1.txt',freq,Trans, /silent
363   -lamb=3.e14/freq
  391 +readcol,dir_bol+'bolocam_1p1.txt',freq,Trans, /silent, format='F,F',comment='#'
  392 +lamb=cmic/freq
364 393 T_ptr=ptr_new(Trans/max(Trans)) & nu_ptr=ptr_new(cmic/lamb) & wav_ptr=ptr_new(lamb)
365 394 bolocam_struct={Name:'BOLOCAM',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt,central_frequencies:cmic/wfilt, $
366 395 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -373,6 +402,7 @@ IF print_messages THEN message,'Reading SPM filters',/continue
373 402  
374 403 ;Read SPM filter Transmission
375 404 filt_names=['SPM1','SPM2','SPM3','SPM4']
  405 +Nband=n_elements(filt_names)
376 406 wfilt_spm=dustem_filter2wav(filt_names)
377 407 ;This was causing trouble under fawlty somehow. replaced by reading a single xcat file
378 408 ;readcol,dir_spm+'DataFiltresSPM',nucm,T1,T2,T3,T4,format='F,F,F,F,F'
... ... @@ -393,7 +423,6 @@ nufilt_spm=nufilt_spm(ind)
393 423 Tfilt_spm=fltarr(count,4)
394 424 Tfilt_spm(*,0)=T1(ind) & Tfilt_spm(*,1)=T2(ind)
395 425 Tfilt_spm(*,2)=T3(ind) & Tfilt_spm(*,3)=T4(ind)
396   -Nband=4
397 426 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
398 427 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
399 428  
... ... @@ -412,28 +441,33 @@ spm_struct={Name:'PRONAOS-SPM',Nbands:Nband,filter_names:filt_names,central_wave
412 441 ;======================================================
413 442 IF print_messages THEN message,'Reading Akari filters',/continue
414 443  
415   -;written by Ryou Ohsawa
416   -;Bugs corrected by Deborah Paradis
417   -Nband=6
418   -filt_names=['AKARI1','AKARI2','AKARI3','AKARI4','AKARI5','AKARI6']
  444 +filt_names=['AKARI1','AKARI2','AKARI3','AKARI4','AKARI5','AKARI6','AKARI7','AKARI8','AKARI9','AKARI10','AKARI11','AKARI12','AKARI13']
  445 +Nband=n_elements(filt_names)
419 446 wfilt_akari=dustem_filter2wav(filt_names)
420 447 wav_ptr=ptrarr(Nband)
421 448 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
422 449 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
423 450  
424   -readcol,dir_akari+'filter_S9w.txt',lamb,Trans, /silent
425   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
426   -readcol,dir_akari+'filter_L18w.txt',lamb,Trans, /silent
427   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
428   -readcol,dir_akari+'filter_N60.txt',lamb,Trans, /silent
429   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
430   -readcol,dir_akari+'filter_WS.txt',lamb,Trans, /silent
431   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb)
432   -readcol,dir_akari+'filter_WL.txt',lamb,Trans, /silent
  451 +;; readcol,dir_akari+'filter_S9w.txt',lamb,Trans, /silent
  452 +;; T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  453 +;; readcol,dir_akari+'filter_L18w.txt',lamb,Trans, /silent
  454 +;; T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  455 +;; readcol,dir_akari+'filter_N60.txt',lamb,Trans, /silent
  456 +;; T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  457 +;; readcol,dir_akari+'filter_WS.txt',lamb,Trans, /silent
  458 +;; T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb)
  459 +;; readcol,dir_akari+'filter_WL.txt',lamb,Trans, /silent
  460 +;; T_ptr[4]=ptr_new(Trans/max(Trans)) & nu_ptr[4]=ptr_new(cmic/lamb) & wav_ptr[4]=ptr_new(lamb)
  461 +;; readcol,dir_akari+'filter_N160.txt',lamb,Trans, /silent
  462 +;; T_ptr(5)=ptr_new(Trans/max(Trans)) & nu_ptr(5)=ptr_new(cmic/lamb) & wav_ptr(5)=ptr_new(lamb)
433 463  
434   -T_ptr(4)=ptr_new(Trans/max(Trans)) & nu_ptr(4)=ptr_new(cmic/lamb) & wav_ptr(4)=ptr_new(lamb)
435   -readcol,dir_akari+'filter_N160.txt',lamb,Trans, /silent
436   -T_ptr(5)=ptr_new(Trans/max(Trans)) & nu_ptr(5)=ptr_new(cmic/lamb) & wav_ptr(5)=ptr_new(lamb)
  464 +FOR k=0L,Nband-1 DO BEGIN
  465 + readcol,dir_akari+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions,/silent,format='F,F',comment='#'
  466 + waves_mic=waves_angstrom/1.e10*1.e6
  467 + freq=cmic/waves_mic
  468 + Trans=transmissions
  469 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
  470 +ENDFOR
437 471  
438 472 akari_struct={Name:'AKARI',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_akari,central_frequencies:cmic/wfilt_akari, $
439 473 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -444,21 +478,21 @@ akari_struct={Name:'AKARI',Nbands:Nband,filter_names:filt_names,central_waveleng
444 478 ;======================================================
445 479 IF print_messages THEN message,'Reading IRAS filters',/continue
446 480  
447   -Nband=4
448 481 filt_names=['IRAS1','IRAS2','IRAS3','IRAS4']
  482 +Nband=n_elements(filt_names)
449 483 wfilt_iras=dustem_filter2wav(filt_names)
450 484 wav_ptr=ptrarr(Nband)
451 485 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
452 486 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
453 487  
454   -readcol,dir_iras+'IRAS12.txt',lamb,Trans, /silent
455   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
456   -readcol,dir_iras+'IRAS25.txt',lamb,Trans, /silent
457   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
458   -readcol,dir_iras+'IRAS60.txt',lamb,Trans, /silent
459   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
460   -readcol,dir_iras+'IRAS100.txt',lamb,Trans, /silent
461   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb)
  488 +readcol,dir_iras+dustem_filter2filter_filename(filt_names[0]),lamb,Trans, /silent,format='F,F',comment='#'
  489 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  490 +readcol,dir_iras+dustem_filter2filter_filename(filt_names[1]),lamb,Trans, /silent,format='F,F',comment='#'
  491 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  492 +readcol,dir_iras+dustem_filter2filter_filename(filt_names[2]),lamb,Trans, /silent,format='F,F',comment='#'
  493 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  494 +readcol,dir_iras+dustem_filter2filter_filename(filt_names[3]),lamb,Trans, /silent,format='F,F',comment='#'
  495 +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb)
462 496  
463 497 iras_struct={Name:'IRAS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_iras,central_frequencies:cmic/wfilt_iras, $
464 498 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -469,28 +503,42 @@ iras_struct={Name:'IRAS',Nbands:Nband,filter_names:filt_names,central_wavelength
469 503 ;======================================================
470 504 IF print_messages THEN message,'Reading DIRBE filters',/continue
471 505  
472   -file=dir_dirbe+'dirbe_response.asc'
473   -readcol,file,wavemic,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,/silent
474   -ind=where(wavemic GT 1 AND wavemic LT 500,count)
475   -Nband=10
476   -;wfilt_dirbe=[1.25,2.2,3.5,4.9,12,25.,60.,100.,140,240]
477 506 filt_names=['DIRBE1','DIRBE2','DIRBE3','DIRBE4','DIRBE5','DIRBE6','DIRBE7','DIRBE8','DIRBE9','DIRBE10']
  507 +Nband=n_elements(filt_names)
478 508 wfilt_dirbe=dustem_filter2wav(filt_names)
479   -nufilt_dirbe=cmic/wavemic(ind) ;in Hz
480   -Tfilt_dirbe=fltarr(count,10)
481   -Tfilt_dirbe(*,0)=T1(ind) & Tfilt_dirbe(*,1)=T2(ind) & Tfilt_dirbe(*,2)=T3(ind) & Tfilt_dirbe(*,3)=T4(ind)
482   -Tfilt_dirbe(*,4)=T5(ind) & Tfilt_dirbe(*,5)=T6(ind) & Tfilt_dirbe(*,6)=T7(ind) & Tfilt_dirbe(*,7)=T8(ind)
483   -Tfilt_dirbe(*,8)=T9(ind) & Tfilt_dirbe(*,9)=T10(ind)
484   -order=sort(nufilt_dirbe)
485   -nufilt_dirbe=nufilt_dirbe(order)
486   -Tfilt_dirbe=Tfilt_dirbe(order,*)
  509 +nu_dirbe=cmic/wfilt_dirbe/1.e9 ;GHz
  510 +wav_ptr=ptrarr(Nband)
487 511 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
488 512 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
489   -FOR i=0,Nband-1 DO BEGIN
490   - nu_ptr(i)=ptr_new(nufilt_dirbe)
491   - T_ptr(i)=ptr_new(Tfilt_dirbe(*,i)/max(Tfilt_dirbe(*,i)))
492   - wav_ptr(i)=ptr_new(cmic/nufilt_dirbe)
  513 +
  514 +;; file=dir_dirbe+'dirbe_response.asc'
  515 +;; readcol,file,wavemic,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,/silent
  516 +;; ind=where(wavemic GT 1 AND wavemic LT 500,count)
  517 +;; ;wfilt_dirbe=[1.25,2.2,3.5,4.9,12,25.,60.,100.,140,240]
  518 +;; nufilt_dirbe=cmic/wavemic(ind) ;in Hz
  519 +;; Tfilt_dirbe=fltarr(count,10)
  520 +;; Tfilt_dirbe(*,0)=T1(ind) & Tfilt_dirbe(*,1)=T2(ind) & Tfilt_dirbe(*,2)=T3(ind) & Tfilt_dirbe(*,3)=T4(ind)
  521 +;; Tfilt_dirbe(*,4)=T5(ind) & Tfilt_dirbe(*,5)=T6(ind) & Tfilt_dirbe(*,6)=T7(ind) & Tfilt_dirbe(*,7)=T8(ind)
  522 +;; Tfilt_dirbe(*,8)=T9(ind) & Tfilt_dirbe(*,9)=T10(ind)
  523 +;; order=sort(nufilt_dirbe)
  524 +;; nufilt_dirbe=nufilt_dirbe(order)
  525 +;; Tfilt_dirbe=Tfilt_dirbe(order,*)
  526 +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
  527 +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
  528 +;; FOR i=0,Nband-1 DO BEGIN
  529 +;; nu_ptr(i)=ptr_new(nufilt_dirbe)
  530 +;; T_ptr(i)=ptr_new(Tfilt_dirbe(*,i)/max(Tfilt_dirbe(*,i)))
  531 +;; wav_ptr(i)=ptr_new(cmic/nufilt_dirbe)
  532 +;; ENDFOR
  533 +
  534 +FOR k=0L,Nband-1 DO BEGIN
  535 + readcol,dir_dirbe+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions_E,/silent,format='F,F',comment='#'
  536 + waves_mic=waves_angstrom/1.e10*1.e6
  537 + freq=cmic/waves_mic
  538 + Trans=transmissions_E/freq
  539 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
493 540 ENDFOR
  541 +
494 542 dirbe_struct={Name:'DIRBE',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_dirbe, $
495 543 central_frequencies:cmic/wfilt_dirbe, $
496 544 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -501,24 +549,32 @@ dirbe_struct={Name:'DIRBE',Nbands:Nband,filter_names:filt_names,central_waveleng
501 549 ;======================================================
502 550 IF print_messages THEN message,'Reading ARCHEOPS filters',/continue
503 551  
504   -Nband=4
505   -filt_names=['ARCHEOPS4','ARCHEOPS3','ARCHEOPS2','ARCHEOPS1']
  552 +filt_names=['ARCHEOPS1','ARCHEOPS2','ARCHEOPS3','ARCHEOPS4']
  553 +Nband=n_elements(filt_names)
506 554 wfilt_archeops=dustem_filter2wav(filt_names)
507 555 nu_archeops=cmic/wfilt_archeops/1.e9 ;GHz
508 556 wav_ptr=ptrarr(Nband)
509 557 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
510 558 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
511 559  
512   -readcol,dir_archeops+'Filter_545GHz.dat',nu,Trans, /silent
513   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(nu*1.e9) & wav_ptr(3)=ptr_new(cmic/nu/1.e9)
514   -readcol,dir_archeops+'Filter_353GHz.dat',nu,Trans, /silent
515   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(nu*1.e9) & wav_ptr(2)=ptr_new(cmic/nu/1.e9)
516   -readcol,dir_archeops+'bande217k04.txt',nu2,Trans2, /silent
517   -nu=nu2 & Trans=Trans2
518   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(nu*1.e9) & wav_ptr(1)=ptr_new(cmic/nu/1.e9)
519   -readcol,dir_archeops+'bande143k01.txt',nu2,Trans2, /silent
520   -nu=nu2 & Trans=Trans2
521   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(nu*1.e9) & wav_ptr(0)=ptr_new(cmic/nu/1.e9)
  560 +FOR k=0L,Nband-1 DO BEGIN
  561 + readcol,dir_archeops+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions,/silent,format='F,F',comment='#'
  562 + waves_mic=waves_angstrom/1.e10*1.e6
  563 + freq=cmic/waves_mic
  564 + Trans=transmissions
  565 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
  566 +ENDFOR
  567 +
  568 +;; readcol,dir_archeops+'Filter_545GHz.dat',nu,Trans, /silent
  569 +;; T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(nu*1.e9) & wav_ptr[3]=ptr_new(cmic/nu/1.e9)
  570 +;; readcol,dir_archeops+'Filter_353GHz.dat',nu,Trans, /silent
  571 +;; T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(nu*1.e9) & wav_ptr[2]=ptr_new(cmic/nu/1.e9)
  572 +;; readcol,dir_archeops+'bande217k04.txt',nu2,Trans2, /silent
  573 +;; nu=nu2 & Trans=Trans2
  574 +;; T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(nu*1.e9) & wav_ptr[1]=ptr_new(cmic/nu/1.e9)
  575 +;; readcol,dir_archeops+'bande143k01.txt',nu2,Trans2, /silent
  576 +;; nu=nu2 & Trans=Trans2
  577 +;; T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(nu*1.e9) & wav_ptr[0]=ptr_new(cmic/nu/1.e9)
522 578  
523 579 archeops_struct={Name:'ARCHEOPS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_archeops,central_frequencies:cmic/wfilt_archeops, $
524 580 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -533,78 +589,91 @@ archeops_struct={Name:'ARCHEOPS',Nbands:Nband,filter_names:filt_names,central_wa
533 589 ;is probably wrong for Intensity (should devide them by 2) ...
534 590 IF print_messages THEN message,'Reading HFI filters',/continue
535 591  
536   -Nband=6
537   -filt_names=['HFI6','HFI5','HFI4','HFI3','HFI2','HFI1']
  592 +filt_names=['HFI1','HFI2','HFI3','HFI4','HFI5','HFI6']
  593 +Nband=n_elements(filt_names)
538 594 wfilt_hfi=dustem_filter2wav(filt_names)
539 595 nu_hfi=cmic/wfilt_hfi/1.e9 ;GHz
540   -;== below is for the F. Pajot files
541   -band_names='*'+['100','143','217','353','545','857']+'GHz*.dat'
542   -;== below is for the files provided by Guilaine
543   -IF which_hfi_filters EQ 'GL' THEN BEGIN
544   - band_names='bandpass'+'*'+['100','143','217','353','545','857']+'*.dat'
545   -ENDIF
546   -IF which_hfi_filters EQ 'OFFICIAL' THEN BEGIN
547   - band_names=['100','143','217','353','545','857']
548   -ENDIF
549 596 wav_ptr=ptrarr(Nband)
550 597 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
551 598 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
552   -IF which_hfi_filters NE 'OFFICIAL' THEN BEGIN
553   - FOR k=0L,Nband-1 DO BEGIN
554   - hfi_files=findfile(dir_hfi+band_names(k),count=Nfiles)
555   -; IF k EQ Nband-1 THEN stop
556   - FOR i=0L,Nfiles-1 DO BEGIN
557   - IF i EQ 0 THEN BEGIN
558   - readcol,hfi_files(i),cm1,Trans,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL
559   - nu=cmic*(cm1/1.e4)/1.d9 ;GHz
560   - IF which_hfi_filters EQ 'GL' THEN BEGIN
561   - nu=cm1/1.d9
562   - ENDIF
563   - ENDIF ELSE BEGIN
564   - readcol,hfi_files(i),cm2,Trans2,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL
565   - nu2=cmic*(cm2/1.e4)/1.d9 ;GHz
566   - IF which_hfi_filters EQ 'GL' THEN BEGIN
567   - nu2=cm2/1.d9
568   - ENDIF
569   - Trans=Trans+interpol(Trans2,nu2,nu)
570   - ENDELSE
571   - ENDFOR
572   - T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.e9) & wav_ptr(k)=ptr_new(cmic/nu/1.d9)
573   -; stop
574   - ENDFOR
575   -ENDIF ELSE BEGIN ;This is the OFFICIAL version
576   - ;CAUTION: filters for individual detectors added with flat weights
577   -; hfi_filter_version='v101'
578   - hfi_filter_version='v201'
579   - bp = hfi_read_bandpass(hfi_filter_version, /rimo,path_rimo=dir_hfi)
580   - bp_band=strmid(bp.name,3,3)
581   - not_used=['70_143_8', '55_545_3', '74_857_4'] ;these should not be used (see in HFI official color_correction.pro)
582   -;stop
583   - FOR k=0L,Nband-1 DO BEGIN
584   - Trans=0.
585   - ind=where(bp_band EQ band_names(k),count)
586   - ;set the reference frequencies for the band
587   - iref=0L
588   - nunu=bp(ind(iref)).freq/1.d9
589   - ind2=where(nunu NE 0.,count2)
590   - nu=nunu(ind2)
591   - FOR i=0L,count-1 DO BEGIN
592   -; stop
593   -; TT=[0.,bp(ind(i)).trans,0.]
594   -; nunu=[min(nu),bp(ind(i)).freq/1.e9,max(nu)]
595   - indd=where(not_used EQ bp(ind(i)).name,countt)
596   - IF countt EQ 0 THEN BEGIN
597   - TT=bp(ind(i)).trans
598   - nunu=bp(ind(i)).freq/1.d9
599   - ind2=where(nunu NE 0.,count2)
600   -; print,band_names(k),count2,minmax(nunu(ind2))
601   -; IF i EQ 0 THEN nu=nunu(ind2) ;we use the frequencies of the first filter
602   - Trans=Trans+interpol(TT(ind2),nunu(ind2),nu)
603   - ENDIF
604   - ENDFOR
605   - T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.d9) & wav_ptr(k)=ptr_new(cmic/nu/1.d9)
606   - ENDFOR
607   -ENDELSE
  599 +
  600 +;; ;== below is for the F. Pajot files
  601 +;; band_names='*'+['100','143','217','353','545','857']+'GHz*.dat'
  602 +;; ;== below is for the files provided by Guilaine
  603 +;; IF which_hfi_filters EQ 'GL' THEN BEGIN
  604 +;; band_names='bandpass'+'*'+['100','143','217','353','545','857']+'*.dat'
  605 +;; ENDIF
  606 +;; IF which_hfi_filters EQ 'OFFICIAL' THEN BEGIN
  607 +;; band_names=['100','143','217','353','545','857']
  608 +;; ENDIF
  609 +;; wav_ptr=ptrarr(Nband)
  610 +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
  611 +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
  612 +;; IF which_hfi_filters NE 'OFFICIAL' THEN BEGIN
  613 +;; FOR k=0L,Nband-1 DO BEGIN
  614 +;; hfi_files=findfile(dir_hfi+band_names(k),count=Nfiles)
  615 +;; ; IF k EQ Nband-1 THEN stop
  616 +;; FOR i=0L,Nfiles-1 DO BEGIN
  617 +;; IF i EQ 0 THEN BEGIN
  618 +;; readcol,hfi_files(i),cm1,Trans,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL
  619 +;; nu=cmic*(cm1/1.e4)/1.d9 ;GHz
  620 +;; IF which_hfi_filters EQ 'GL' THEN BEGIN
  621 +;; nu=cm1/1.d9
  622 +;; ENDIF
  623 +;; ENDIF ELSE BEGIN
  624 +;; readcol,hfi_files(i),cm2,Trans2,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL
  625 +;; nu2=cmic*(cm2/1.e4)/1.d9 ;GHz
  626 +;; IF which_hfi_filters EQ 'GL' THEN BEGIN
  627 +;; nu2=cm2/1.d9
  628 +;; ENDIF
  629 +;; Trans=Trans+interpol(Trans2,nu2,nu)
  630 +;; ENDELSE
  631 +;; ENDFOR
  632 +;; T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.e9) & wav_ptr(k)=ptr_new(cmic/nu/1.d9)
  633 +;; ; stop
  634 +;; ENDFOR
  635 +;; ENDIF ELSE BEGIN ;This is the OFFICIAL version
  636 +;; ;CAUTION: filters for individual detectors added with flat weights
  637 +;; ; hfi_filter_version='v101'
  638 +;; hfi_filter_version='v201'
  639 +;; bp = hfi_read_bandpass(hfi_filter_version, /rimo,path_rimo=dir_hfi)
  640 +;; bp_band=strmid(bp.name,3,3)
  641 +;; not_used=['70_143_8', '55_545_3', '74_857_4'] ;these should not be used (see in HFI official color_correction.pro)
  642 +;; ;stop
  643 +;; FOR k=0L,Nband-1 DO BEGIN
  644 +;; Trans=0.
  645 +;; ind=where(bp_band EQ band_names(k),count)
  646 +;; ;set the reference frequencies for the band
  647 +;; iref=0L
  648 +;; nunu=bp(ind(iref)).freq/1.d9
  649 +;; ind2=where(nunu NE 0.,count2)
  650 +;; nu=nunu(ind2)
  651 +;; FOR i=0L,count-1 DO BEGIN
  652 +;; ; stop
  653 +;; ; TT=[0.,bp(ind(i)).trans,0.]
  654 +;; ; nunu=[min(nu),bp(ind(i)).freq/1.e9,max(nu)]
  655 +;; indd=where(not_used EQ bp(ind(i)).name,countt)
  656 +;; IF countt EQ 0 THEN BEGIN
  657 +;; TT=bp(ind(i)).trans
  658 +;; nunu=bp(ind(i)).freq/1.d9
  659 +;; ind2=where(nunu NE 0.,count2)
  660 +;; ; print,band_names(k),count2,minmax(nunu(ind2))
  661 +;; ; IF i EQ 0 THEN nu=nunu(ind2) ;we use the frequencies of the first filter
  662 +;; Trans=Trans+interpol(TT(ind2),nunu(ind2),nu)
  663 +;; ENDIF
  664 +;; ENDFOR
  665 +;; T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.d9) & wav_ptr(k)=ptr_new(cmic/nu/1.d9)
  666 +;; ENDFOR
  667 +;; ENDELSE
  668 +
  669 +FOR k=0L,Nband-1 DO BEGIN
  670 + readcol,dir_hfi+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmission, /silent,format='F,F',comment='#'
  671 + waves_mic=waves_angstrom/1.e10*1.e6
  672 + freq=cmic/waves_mic
  673 + Trans=transmission
  674 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
  675 +ENDFOR
  676 +
608 677  
609 678 hfi_struct={Name:'HFI',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_hfi,central_frequencies:cmic/wfilt_hfi, $
610 679 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -613,46 +682,55 @@ hfi_struct={Name:'HFI',Nbands:Nband,filter_names:filt_names,central_wavelengths:
613 682 ;======================================================
614 683 ;==== PLANCK-LFI
615 684 ;======================================================
616   -;Obtained from Marco Bersaneli, via Cyril Roset
617   -;Filters for each detectors are just averaged simply
618 685 IF print_messages THEN message,'Reading LFI filters',/continue
619 686  
620   -Nband=3
621   -filt_names=['LFI3','LFI2','LFI1']
  687 +filt_names=['LFI1','LFI2','LFI3']
  688 +Nband=n_elements(filt_names)
622 689 wfilt_lfi=dustem_filter2wav(filt_names)
623 690 nu_lfi=cmic/wfilt_lfi/1.e9 ;GHz
624   -band_names='*'+['30','44','70']+'GHz*.dat'
625 691 wav_ptr=ptrarr(Nband)
626 692 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
627 693 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
628   -goto,jump_over_this
629   -FOR k=0L,Nband-1 DO BEGIN
630   - lfi_files=findfile(dir_lfi+band_names(k),count=Nfiles)
631   -; stop
632   - FOR i=0L,Nfiles-1 DO BEGIN
633   - IF i EQ 0 THEN BEGIN
634   - readcol,lfi_files(i),nu,R0D0,R0D1,R1D0,R1D1,/silent
635   - ENDIF ELSE BEGIN
636   - readcol,lfi_files(i),nu2,R0D0_2,R0D1_2,R1D0_2,R1D1_2,/silent
637   - stop
638   - R0D0=R0D0+interpol(R0D0_2,nu2,nu)
639   - R1D0=R1D0+interpol(R1D0_2,nu2,nu)
640   - R0D1=R0D1+interpol(R0D1_2,nu2,nu)
641   - R1D1=R1D1+interpol(R1D1_2,nu2,nu)
642   - ENDELSE
643   - ENDFOR
644   - Trans=sqrt(R0D0^2+R1D1^2+R1D0^2+R0D1^2) ;I have no idea if this is how it should be done
645   - T_ptr[k]=ptr_new(Trans/max(Trans))
646   - nu_ptr[k]=ptr_new(nu*1.e9)
647   - wav_ptr[k]=ptr_new(cmic/nu/1.e9)
648   -ENDFOR
649   -jump_over_this:
  694 +
  695 +;; ;Obtained from Marco Bersaneli, via Cyril Roset
  696 +;; ;Filters for each detectors are just averaged simply
  697 +;; goto,jump_over_this
  698 +;; band_names='*'+['30','44','70']+'GHz*.dat'
  699 +;; FOR k=0L,Nband-1 DO BEGIN
  700 +;; lfi_files=findfile(dir_lfi+band_names(k),count=Nfiles)
  701 +;; ; stop
  702 +;; FOR i=0L,Nfiles-1 DO BEGIN
  703 +;; IF i EQ 0 THEN BEGIN
  704 +;; readcol,lfi_files(i),nu,R0D0,R0D1,R1D0,R1D1,/silent
  705 +;; ENDIF ELSE BEGIN
  706 +;; readcol,lfi_files(i),nu2,R0D0_2,R0D1_2,R1D0_2,R1D1_2,/silent
  707 +;; stop
  708 +;; R0D0=R0D0+interpol(R0D0_2,nu2,nu)
  709 +;; R1D0=R1D0+interpol(R1D0_2,nu2,nu)
  710 +;; R0D1=R0D1+interpol(R0D1_2,nu2,nu)
  711 +;; R1D1=R1D1+interpol(R1D1_2,nu2,nu)
  712 +;; ENDELSE
  713 +;; ENDFOR
  714 +;; Trans=sqrt(R0D0^2+R1D1^2+R1D0^2+R0D1^2) ;I have no idea if this is how it should be done
  715 +;; T_ptr[k]=ptr_new(Trans/max(Trans))
  716 +;; nu_ptr[k]=ptr_new(nu*1.e9)
  717 +;; wav_ptr[k]=ptr_new(cmic/nu/1.e9)
  718 +;; ENDFOR
  719 +;; jump_over_this:
  720 +;; FOR k=0L,Nband-1 DO BEGIN
  721 +;; lfi_file=dir_lfi+'TRANS_LFI'+strtrim(k+1,2)+'.xcat'
  722 +;; st=read_xcat(lfi_file,/silent)
  723 +;; wav_ptr[k]=ptr_new(st.wav)
  724 +;; nu_ptr[k]=ptr_new(st.nu)
  725 +;; T_ptr[k]=ptr_new(st.T)
  726 +;; ENDFOR
  727 +
650 728 FOR k=0L,Nband-1 DO BEGIN
651   - lfi_file=dir_lfi+'TRANS_LFI'+strtrim(k+1,2)+'.xcat'
652   - st=read_xcat(lfi_file,/silent)
653   - wav_ptr[k]=ptr_new(st.wav)
654   - nu_ptr[k]=ptr_new(st.nu)
655   - T_ptr[k]=ptr_new(st.T)
  729 + readcol,dir_lfi+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmission, /silent,format='F,F',comment='#'
  730 + waves_mic=waves_angstrom/1.e10*1.e6
  731 + freq=cmic/waves_mic
  732 + Trans=transmission
  733 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
656 734 ENDFOR
657 735  
658 736 lfi_struct={Name:'LFI',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_lfi, $
... ... @@ -676,7 +754,8 @@ use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
676 754 FOR i=0L,Nband-1 DO BEGIN
677 755 ; readcol,dir_iso+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment='#'
678 756 tst=read_xcat(dir_iso+dustem_filter2filter_filename(filt_names[i]),/silent)
679   - waves_mic=tst.waves_mic & Trans = tst.trans
  757 + waves_mic=tst.waves_mic
  758 + Trans = tst.trans
680 759 freq=cmic/waves_mic
681 760 T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic)
682 761 ENDFOR
... ... @@ -741,7 +820,7 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
741 820 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
742 821 FOR k=0L,Nband-1 DO BEGIN
743 822 isophot_files=findfile(dir_isophot+band_names(k),count=Nfiles)
744   - readcol,isophot_files(0),wav,Trans,/silent
  823 + readcol,isophot_files[0],wav,Trans,/silent
745 824 nu=cmic/wav/1.e9 ;GHz
746 825 T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.e9) & wav_ptr(k)=ptr_new(wav)
747 826 ENDFOR
... ... @@ -767,7 +846,7 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
767 846 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
768 847 FOR k=0L,Nband-1 DO BEGIN
769 848 isophot_files=findfile(dir_isophot+band_names(k),count=Nfiles)
770   - readcol,isophot_files(0),wav,Trans,/silent
  849 + readcol,isophot_files[0],wav,Trans,/silent
771 850 nu=cmic/wav/1.e9 ;GHz
772 851 T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.e9) & wav_ptr(k)=ptr_new(wav)
773 852 ENDFOR
... ... @@ -785,9 +864,10 @@ IF print_messages THEN message,'Reading equivalent FIRAS filters',/continue
785 864 ;Equivalent FIRAS filters (used in Boulanger et al 90)
786 865 ;Defined as top-hat filters with 30% bandwidth (although not given in
787 866 ;Boulanger et al).
788   -Nband=8
  867 +
789 868 wfilt_efiras=[100. ,140 ,240 ,346 ,490 ,535 ,736 ,1100 ]
790 869 filt_names=['F100','F140','F240','F346','F490','F535','F736','F1100']
  870 +Nband=n_elements(filt_names)
791 871 wav_ptr=ptrarr(Nband)
792 872 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
793 873 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
... ... @@ -815,21 +895,21 @@ efiras_struct={Name:'EFIRAS',Nbands:Nband,filter_names:filt_names,central_wavele
815 895 ;======================================================
816 896 IF print_messages THEN message,'Reading WISE filters',/continue
817 897  
818   -Nband=4
819 898 filt_names=['WISE1','WISE2','WISE3','WISE4']
  899 +Nband=n_elements(filt_names)
820 900 wfilt_wise=dustem_filter2wav(filt_names)
821 901 wav_ptr=ptrarr(Nband)
822 902 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
823 903 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
824 904  
825   -readcol,dir_wise+'RSR-W1.EE.txt',lamb,Trans, /silent
826   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
827   -readcol,dir_wise+'RSR-W2.EE.txt',lamb,Trans, /silent
828   -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb)
829   -readcol,dir_wise+'RSR-W3.EE.txt',lamb,Trans, /silent
830   -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb)
831   -readcol,dir_wise+'RSR-W4.EE.txt',lamb,Trans, /silent
832   -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb)
  905 +readcol,dir_wise+'RSR-W1.EE.txt',lamb,Trans, /silent,format='F,F',comment='#'
  906 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  907 +readcol,dir_wise+'RSR-W2.EE.txt',lamb,Trans, /silent,format='F,F',comment='#'
  908 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb)
  909 +readcol,dir_wise+'RSR-W3.EE.txt',lamb,Trans, /silent,format='F,F',comment='#'
  910 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb)
  911 +readcol,dir_wise+'RSR-W4.EE.txt',lamb,Trans, /silent,format='F,F',comment='#'
  912 +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb)
833 913  
834 914 wise_struct={Name:'WISE',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_wise,central_frequencies:cmic/wfilt_wise, $
835 915 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -840,36 +920,56 @@ wise_struct={Name:'WISE',Nbands:Nband,filter_names:filt_names,central_wavelength
840 920 ;======================================================
841 921 IF print_messages THEN message,'Reading LABOCA filters',/continue
842 922  
843   -Nband=1
844 923 filt_names=['LABOCA1']
  924 +Nband=n_elements(filt_names)
845 925 wfilt_laboca=dustem_filter2wav(filt_names)
846 926 wav_ptr=ptrarr(Nband)
847 927 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
848 928 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
849 929  
850   -readcol,dir_laboca+'labocaRSRF.data',freq,Trans, /silent
  930 +readcol,dir_laboca+'laboca_passband_normalized.txt',freq,Trans, /silent,format='F,F',comment='#'
851 931 lamb=cmic/(freq*1.e9)
852   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
  932 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
853 933  
854 934 laboca_struct={Name:'LABOCA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_laboca,central_frequencies:cmic/wfilt_laboca, $
855 935 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
856 936 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_laboca'}
857 937  
858 938 ;======================================================
  939 +;==== SABOCA
  940 +;======================================================
  941 +IF print_messages THEN message,'Reading SABOCA filters',/continue
  942 +
  943 +filt_names=['SABOCA1']
  944 +Nband=n_elements(filt_names)
  945 +wfilt_saboca=dustem_filter2wav(filt_names)
  946 +wav_ptr=ptrarr(Nband)
  947 +nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
  948 +use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
  949 +
  950 +readcol,dir_saboca+'saboca_passband_normalized.txt',freq,Trans, /silent,format='F,F',comment='#'
  951 +lamb=cmic/(freq*1.e9)
  952 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
  953 +
  954 +saboca_struct={Name:'SABOCA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_saboca,central_frequencies:cmic/wfilt_saboca, $
  955 + filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
  956 + use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_saboca'}
  957 +
  958 +;======================================================
859 959 ;==== GISMO
860 960 ;======================================================
861 961 IF print_messages THEN message,'Reading GISMO filters',/continue
862 962  
863   -Nband=1
864 963 filt_names=['GISMO1']
  964 +Nband=n_elements(filt_names)
865 965 wfilt_gismo=dustem_filter2wav(filt_names)
866 966 wav_ptr=ptrarr(Nband)
867 967 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
868 968 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
869 969  
870   -readcol,dir_gismo+'GISMO_TRANSMISSION.txt',lamb,freq,Trans, /silent
  970 +readcol,dir_gismo+'GISMO_TRANSMISSION.txt',lamb,freq,Trans, /silent,format='F,F,F',comment='#'
871 971 lamb=lamb*1000. ; in microns
872   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb)
  972 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb)
873 973  
874 974 gismo_struct={Name:'GISMO',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_gismo,central_frequencies:cmic/wfilt_gismo, $
875 975 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -880,8 +980,8 @@ gismo_struct={Name:'GISMO',Nbands:Nband,filter_names:filt_names,central_waveleng
880 980 ;======================================================
881 981 IF print_messages THEN message,'Reading SPASS filters',/continue
882 982  
883   -Nband=1
884 983 filt_names=['SPASS1']
  984 +Nband=n_elements(filt_names)
885 985 wfilt_spass=dustem_filter2wav(filt_names)
886 986 wav_ptr=ptrarr(Nband)
887 987 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
... ... @@ -892,7 +992,7 @@ st=read_xcat(dir_spass+'SPASS_transmission.xcat',/silent)
892 992 freq=st.frequency*1.e9 ;Hz
893 993 Trans=st.transmission
894 994  
895   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(freq) & wav_ptr(0)=ptr_new(cmic/freq)
  995 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq)
896 996  
897 997 spass_struct={Name:'SPASS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spass,central_frequencies:cmic/wfilt_spass, $
898 998 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -903,8 +1003,8 @@ spass_struct={Name:'SPASS',Nbands:Nband,filter_names:filt_names,central_waveleng
903 1003 ;======================================================
904 1004 IF print_messages THEN message,'Reading CHIPASS filters',/continue
905 1005  
906   -Nband=1
907 1006 filt_names=['CHIPASS1']
  1007 +Nband=n_elements(filt_names)
908 1008 wfilt_chipass=dustem_filter2wav(filt_names)
909 1009 wav_ptr=ptrarr(Nband)
910 1010 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
... ... @@ -916,7 +1016,7 @@ st=read_xcat(dir_spass+'SPASS_transmission.xcat',/silent)
916 1016 freq=st.frequency*1.e9 ;Hz
917 1017 Trans=st.transmission
918 1018  
919   -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(freq) & wav_ptr(0)=ptr_new(cmic/freq)
  1019 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq)
920 1020  
921 1021 chipass_struct={Name:'CHIPASS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_chipass,central_frequencies:cmic/wfilt_chipass, $
922 1022 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
... ... @@ -927,27 +1027,26 @@ chipass_struct={Name:'CHIPASS',Nbands:Nband,filter_names:filt_names,central_wave
927 1027 ;======================================================
928 1028 IF print_messages THEN message,'Reading NIKA2 filters',/continue
929 1029  
930   -;# NIKA1200
931   -;# photon
932   -;# Average of array 1 and array3 of NIKA2, 1.2mm arrays
933   -;# 1st column: wavelength in angstrom
934   -Nband=2
935 1030 filt_names=['NIKA21','NIKA22']
  1031 +Nband=n_elements(filt_names)
936 1032 wfilt_nika2=dustem_filter2wav(filt_names)
937 1033 wav_ptr=ptrarr(Nband)
938 1034 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
939 1035 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
940 1036  
941   -readcol,dir_nika2+'NIKA1200.dat',waves_angstrom,transmissions
942   -waves_mic=waves_angstrom/1.e10*1.e6
  1037 +;readcol,dir_nika2+'NIKA1200.dat',waves_angstrom,transmissions
  1038 +st=read_xcat(dir_nika2+dustem_filter2filter_filename(filt_names[0]),/silent)
  1039 +waves_mic=st.wave
943 1040 freq=cmic/waves_mic
944   -Trans=transmissions
  1041 +Trans=st.trans
945 1042 T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq)
946 1043  
947   -readcol,dir_nika2+'NIKA2000.dat',waves_angstrom,transmissions
948   -waves_mic=waves_angstrom/1.e10*1.e6
  1044 +;readcol,dir_nika2+'NIKA2000.dat',waves_angstrom,transmissions
  1045 +;waves_mic=waves_angstrom/1.e10*1.e6
  1046 +st=read_xcat(dir_nika2+dustem_filter2filter_filename(filt_names[1]),/silent)
  1047 +waves_mic=st.wave
949 1048 freq=cmic/waves_mic
950   -Trans=transmissions
  1049 +Trans=st.trans
951 1050 T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(freq) & wav_ptr[1]=ptr_new(cmic/freq)
952 1051  
953 1052 nika2_struct={Name:'NIKA2',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nika2,central_frequencies:cmic/wfilt_nika2, $
... ... @@ -960,45 +1059,83 @@ nika2_struct={Name:'NIKA2',Nbands:Nband,filter_names:filt_names,central_waveleng
960 1059 ;======================================================
961 1060 IF print_messages THEN message,'Reading SCUBA2 filters',/continue
962 1061  
963   -Nband=1
964   -filt_names=['SCUBA21']
  1062 +filt_names=['SCUBA21','SCUBA22']
  1063 +Nband=n_elements(filt_names)
965 1064 wfilt_scuba2=dustem_filter2wav(filt_names)
966 1065 wav_ptr=ptrarr(Nband)
967 1066 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
968 1067 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
969 1068  
970   -readcol,dir_scuba2+'JCMT_SCUBA2.850.dat',waves_angstrom,transmissions
  1069 +readcol,dir_scuba2+dustem_filter2filter_filename(filt_names[0]),waves_angstrom,transmissions
971 1070 waves_mic=waves_angstrom/1.e10*1.e6
972 1071 freq=cmic/waves_mic
973 1072 Trans=transmissions
974 1073 T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq)
975 1074  
  1075 +readcol,dir_scuba2+dustem_filter2filter_filename(filt_names[1]),waves_angstrom,transmissions
  1076 +waves_mic=waves_angstrom/1.e10*1.e6
  1077 +freq=cmic/waves_mic
  1078 +Trans=transmissions
  1079 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(freq) & wav_ptr[1]=ptr_new(cmic/freq)
  1080 +
976 1081 scuba2_struct={Name:'SCUBA2',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_scuba2,central_frequencies:cmic/wfilt_scuba2, $
977 1082 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
978 1083 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_scuba2'}
979 1084  
980 1085 ;======================================================
  1086 +;==== HAWCPLUS
  1087 +;======================================================
  1088 +IF print_messages THEN message,'Reading HAWCPLUS filters',/continue
  1089 +
  1090 +filt_names=['HAWCPLUS1','HAWCPLUS2','HAWCPLUS3','HAWCPLUS4','HAWCPLUS5']
  1091 +Nband=n_elements(filt_names)
  1092 +wfilt_hawcplus=dustem_filter2wav(filt_names)
  1093 +wav_ptr=ptrarr(Nband)
  1094 +nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
  1095 +use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
  1096 +
  1097 +FOR k=0L,Nband-1 DO BEGIN
  1098 + readcol,dir_hawcplus+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions_E
  1099 + waves_mic=waves_angstrom/1.e10*1.e6
  1100 + freq=cmic/waves_mic
  1101 + Trans=transmissions_E/freq
  1102 + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq)
  1103 +ENDFOR
  1104 +
  1105 +hawcplus_struct={Name:'HAWCPLUS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_hawcplus,central_frequencies:cmic/wfilt_hawcplus, $
  1106 + filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
  1107 + use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_hawcplus'}
  1108 +
  1109 +;======================================================
981 1110 ;==== IRS
982 1111 ;======================================================
983   -IF print_messages THEN message,'Reading IRS filters',/continue
  1112 +IF print_messages THEN message,'Reading IRS PUI filters',/continue
984 1113  
985   -;# IRS16
986   -;# energy
987   -;# Spitzer IRS 16 micron
988   -;# 1st column: wavelength in angstrom
989   -Nband=1
990   -filt_names=['IRS1']
  1114 +filt_names=['IRS1','IRS2']
  1115 +Nband=n_elements(filt_names)
991 1116 wfilt_irs=dustem_filter2wav(filt_names)
992 1117 wav_ptr=ptrarr(Nband)
993 1118 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
994 1119 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
995 1120  
996   -readcol,dir_irs+'IRS16.dat',waves_angstrom,transmissions_E
  1121 +readcol,dir_irs+dustem_filter2filter_filename(filt_names[0]),waves_angstrom,transmissions_E
997 1122 waves_mic=waves_angstrom/1.e10*1.e6
998 1123 freq=cmic/waves_mic
999 1124 Trans=transmissions_E/freq
1000 1125 T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq)
1001 1126  
  1127 +readcol,dir_irs+dustem_filter2filter_filename(filt_names[1]),waves_angstrom,transmissions_E
  1128 +waves_mic=waves_angstrom/1.e10*1.e6
  1129 +freq=cmic/waves_mic
  1130 +Trans=transmissions_E/freq
  1131 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(freq) & wav_ptr[1]=ptr_new(cmic/freq)
  1132 +
  1133 +;readcol,dir_irs+'IRS16.dat',waves_angstrom,transmissions_E
  1134 +;waves_mic=waves_angstrom/1.e10*1.e6
  1135 +;freq=cmic/waves_mic
  1136 +;Trans=transmissions_E/freq
  1137 +;T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq)
  1138 +
1002 1139 irs_struct={Name:'IRS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_irs,central_frequencies:cmic/wfilt_irs, $
1003 1140 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
1004 1141 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_irs'}
... ... @@ -1061,54 +1198,54 @@ nircam_struct={Name:'NIRCAM',Nbands:Nband,filter_names:filt_names,central_wavele
1061 1198 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
1062 1199 use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_nircam'}
1063 1200  
1064   -;======================================================
1065   -;==== JWST-NIRCAM module A
1066   -;======================================================
1067   -IF print_messages THEN message,'Reading NIRCAM module A filter transmissions',/continue
  1201 +;; ;======================================================
  1202 +;; ;==== JWST-NIRCAM module A
  1203 +;; ;======================================================
  1204 +;; IF print_messages THEN message,'Reading NIRCAM module A filter transmissions',/continue
1068 1205  
1069   -Nband=29
1070   -filt_names='NIRCAMA'+strtrim(indgen(Nband)+1,2)
1071   -wfilt_nircama=dustem_filter2wav(filt_names)
1072   -wav_ptr=ptrarr(Nband)
1073   -nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
1074   -use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
  1206 +;; Nband=29
  1207 +;; filt_names='NIRCAMA'+strtrim(indgen(Nband)+1,2)
  1208 +;; wfilt_nircama=dustem_filter2wav(filt_names)
  1209 +;; wav_ptr=ptrarr(Nband)
  1210 +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
  1211 +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
1075 1212  
1076   -FOR i=0L,Nband-1 DO BEGIN
1077   - readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#'
1078   - freq=cmic/waves_mic
1079   - Trans=transmissions_E/freq
1080   - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic)
1081   -ENDFOR
  1213 +;; FOR i=0L,Nband-1 DO BEGIN
  1214 +;; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#'
  1215 +;; freq=cmic/waves_mic
  1216 +;; Trans=transmissions_E/freq
  1217 +;; T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic)
  1218 +;; ENDFOR
1082 1219  
1083   -nircama_struct={Name:'NIRCAMA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircama,central_frequencies:cmic/wfilt_nircama, $
1084   - filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
1085   - use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_nircama'}
  1220 +;; nircama_struct={Name:'NIRCAMA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircama,central_frequencies:cmic/wfilt_nircama, $
  1221 +;; filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
  1222 +;; use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_nircama'}
1086 1223  
1087 1224  
1088   -;======================================================
1089   -;==== JWST-NIRCAM
1090   -;======================================================
  1225 +;; ;======================================================
  1226 +;; ;==== JWST-NIRCAM
  1227 +;; ;======================================================
1091 1228  
1092   -IF print_messages THEN message,'Reading NIRCAM module B filter transmissions',/continue
  1229 +;; IF print_messages THEN message,'Reading NIRCAM module B filter transmissions',/continue
1093 1230  
1094   -Nband=29
1095   -filt_names='NIRCAMB'+strtrim(indgen(Nband)+1,2)
1096   -wfilt_nircamb=dustem_filter2wav(filt_names)
1097   -wav_ptr=ptrarr(Nband)
1098   -nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
1099   -use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
  1231 +;; Nband=29
  1232 +;; filt_names='NIRCAMB'+strtrim(indgen(Nband)+1,2)
  1233 +;; wfilt_nircamb=dustem_filter2wav(filt_names)
  1234 +;; wav_ptr=ptrarr(Nband)
  1235 +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
  1236 +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
1100 1237  
1101   -FOR i=0L,Nband-1 DO BEGIN
1102   - readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#'
1103   - freq=cmic/waves_mic
1104   - Trans=transmissions_E/freq
1105   -; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment="#"
1106   - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic)
1107   -ENDFOR
  1238 +;; FOR i=0L,Nband-1 DO BEGIN
  1239 +;; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#'
  1240 +;; freq=cmic/waves_mic
  1241 +;; Trans=transmissions_E/freq
  1242 +;; ; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment="#"
  1243 +;; T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic)
  1244 +;; ENDFOR
1108 1245  
1109   -nircamb_struct={Name:'NIRCAMB',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircamb,central_frequencies:cmic/wfilt_nircamb, $
1110   - filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
1111   - use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_nircamb'}
  1246 +;; nircamb_struct={Name:'NIRCAMB',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircamb,central_frequencies:cmic/wfilt_nircamb, $
  1247 +;; filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $
  1248 +;; use_frequencies:use_nu,use_transmissions:use_T,use_wavelengths:use_w,use_wmin:dblarr(Nband),use_wmax:dblarr(Nband),cc_method:'dustem_cc_nircamb'}
1112 1249  
1113 1250 ;======================================================
1114 1251 ;==== JWST-NIRISS
... ... @@ -1123,7 +1260,10 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband)
1123 1260 use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband)
1124 1261  
1125 1262 FOR i=0L,Nband-1 DO BEGIN
1126   - readcol,dir_niriss+dustem_filter2filter_filename(filt_names[i]),waves_mic,thru_filt,transmissions_E,comment="#"
  1263 +; readcol,dir_niriss+dustem_filter2filter_filename(filt_names[i]),waves_mic,thru_filt,transmissions_E,comment="#"
  1264 + filter_dat=mrdfits(dir_niriss+dustem_filter2filter_filename(filt_names[i]),1,h,/silent)
  1265 + waves_mic=filter_dat.wave
  1266 + transmissions_E=filter_dat.throughput
1127 1267 freq=cmic/waves_mic
1128 1268 Trans=transmissions_E/freq
1129 1269 T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic)
... ... @@ -1158,7 +1298,9 @@ dm_filter_struct={ $
1158 1298 BOLOCAM:bolocam_struct, $
1159 1299 WISE:wise_struct, $
1160 1300 LABOCA:laboca_struct, $
  1301 + SABOCA:laboca_struct, $
1161 1302 GISMO:gismo_struct, $
  1303 + HAWCPLUS:hawcplus_struct, $
1162 1304 SPASS:spass_struct, $
1163 1305 CHIPASS:chipass_struct, $
1164 1306 NIKA2:nika2_struct, $
... ... @@ -1166,8 +1308,6 @@ dm_filter_struct={ $
1166 1308 IRS:irs_struct, $
1167 1309 MIRI:miri_struct, $
1168 1310 NIRCAM:nircam_struct, $
1169   - NIRCAMA:nircama_struct, $
1170   - NIRCAMB:nircamb_struct, $
1171 1311 NIRISS:niriss_struct $
1172 1312 }
1173 1313  
... ... @@ -1205,8 +1345,8 @@ IF keyword_set(plot_it) THEN BEGIN
1205 1345 ENDFOR
1206 1346 ENDIF
1207 1347  
1208   -close,unit
1209   -free_lun,unit
  1348 +;; close,unit
  1349 +;; free_lun,unit
1210 1350  
1211 1351 !quiet=quiet_old
1212 1352 heap_gc
... ...