diff --git a/src/idl/dustem_read_filters.pro b/src/idl/dustem_read_filters.pro index 058e60f..3d3aca8 100755 --- a/src/idl/dustem_read_filters.pro +++ b/src/idl/dustem_read_filters.pro @@ -1,4 +1,3 @@ -;FUNCTION dustem_read_filters,bidon,plot_it=plot_it,help=help FUNCTION dustem_read_filters,plot_it=plot_it,help=help ;+ @@ -6,56 +5,57 @@ FUNCTION dustem_read_filters,plot_it=plot_it,help=help ; dustem_read_filters ; ; PURPOSE: -;Read filter information into the filter structure -;cc_method is the name of the IDL functions used to compute SED for -;those filters, including color correction appropriate for each -;insrument. +; Read filter information into the filter structure ; -;Fields of the structure are as follows: +; cc_method is the name of the IDL function used to compute the SED for +; those filters, including the color correction appropriate for each +; instrument. ; -;Name:Filter name -;Nbands: Number of photometric bands -;filter_names: Name of the filters -;central_wavelengths: Filter central wavelengths (microns) -;central_frequencies: Filter central frequencies (Hz) -;filter_frequencies: Pointer array towards filter frequency arrays for each filter -;filter_transmissions: Pointer array towards filter transmission arrays for each filter -;use_frequencies: Pointer array towards filter frequencies to be used for in-band integrations of a given model (empty at this stage) -;use_transmissions: Pointer array towards filter transmission interpolated on use_frequencies (empty at this stage) -;cc_method: Color correction method to be used for these filters +; The tags of the filter structure are: ; -;The following instruments are known: - ;; IRAC:irac_struct, $ - ;; MIPS:mips_struct, $ - ;; MSX:msx_struct, $ - ;; IRAS:iras_struct, $ - ;; DIRBE:dirbe_struct, $ - ;; SPM:spm_struct, $ - ;; ISOCAM:isocam_struct, $ - ;; ISOPHOTP:isophotP_struct, $ - ;; ISOPHOTC:isophotC_struct, $ - ;; EFIRAS:efiras_struct, $ - ;; ARCHEOPS:archeops_struct, $ - ;; HFI:hfi_struct, $ - ;; LFI:lfi_struct, $ - ;; WMAP:wmap_struct, $ - ;; SPIRE:spire_struct, $ - ;; PACS:pacs_struct, $ - ;; PILOT:pilot_struct, $ - ;; AKARI:akari_struct, $ - ;; BOLOCAM:bolocam_struct, $ - ;; WISE:wise_struct, $ - ;; LABOCA:laboca_struct, $ - ;; GISMO:gismo_struct, $ - ;; SPASS:spass_struct, $ - ;; NIKA2:nika2_struct, $ - ;; SCUBA2:scuba2_struct, $ - ;; IRS:irs_struct, $ - ;; MIRI:miri_struct, $ - ;; NIRCAM:nircam_struct, $ - ;; NIRCAMA:nircama_struct, $ - ;; NIRCAMB:nircamb_struct, $ - ;; NIRISS:niriss_struct $ +; Name: Filter name +; Nbands: Number of photometric bands +; filter_names: Name of the filters +; central_wavelengths: Filter central wavelengths (microns) +; central_frequencies: Filter central frequencies (Hz) +; filter_frequencies: Pointer array towards filter frequency arrays for each filter +; filter_transmissions: Pointer array towards filter transmission arrays for each filter +; use_frequencies: Pointer array towards filter frequencies to be used for in-band integrations of a given model (empty at this stage) +; use_transmissions: Pointer array towards filter transmission interpolated on use_frequencies (empty at this stage) +; cc_method: Color correction method to be used for these filters +; +; The following instruments are known: +;; IRAC:irac_struct, $ +;; MIPS:mips_struct, $ +;; MSX:msx_struct, $ +;; IRAS:iras_struct, $ +;; DIRBE:dirbe_struct, $ +;; SPM:spm_struct, $ +;; ISOCAM:isocam_struct, $ +;; ISOPHOTP:isophotP_struct, $ +;; ISOPHOTC:isophotC_struct, $ +;; EFIRAS:efiras_struct, $ +;; ARCHEOPS:archeops_struct, $ +;; HFI:hfi_struct, $ +;; LFI:lfi_struct, $ +;; WMAP:wmap_struct, $ +;; SPIRE:spire_struct, $ +;; PACS:pacs_struct, $ +;; PILOT:pilot_struct, $ +;; AKARI:akari_struct, $ +;; BOLOCAM:bolocam_struct, $ +;; WISE:wise_struct, $ +;; LABOCA:laboca_struct, $ +;; SABOCA:saboca_struct, $ +;; GISMO:gismo_struct, $ +;; SPASS:spass_struct, $ +;; NIKA2:nika2_struct, $ +;; SCUBA2:scuba2_struct, $ +;; HAWCPLUS:hawcplus_struct, $ +;; IRS:irs_struct, $ +;; MIRI:miri_struct, $ +;; NIRCAM:nircam_struct, $ +;; NIRISS:niriss_struct $ ; ; CATEGORY: ; DustEMWrap, Distributed, Low-Level, Instrument Filters @@ -96,16 +96,16 @@ FUNCTION dustem_read_filters,plot_it=plot_it,help=help quiet_old=!quiet !quiet=1 -eptr=ptr_new() ;Empty pointer +print_messages=1 ;flag to print filter names when reading filters + +eptr=ptr_new() ;Empty pointer cmic=2.9979246D14 ccm=2.9979246D10 -;cmic=3.e14 -;ccm=3.e10 +;; as of 12 jan 2023, we use SVO Planck-HFI filters ;which_hfi_filters='GL' -which_hfi_filters='OFFICIAL' -print_messages=0 ;to print filter names when reading filters +;which_hfi_filters='OFFICIAL' ;====================================================== ;==== directories containing filter information @@ -125,9 +125,11 @@ dir_hfi=filter_dir+'HFI'+'/' dir_bol=filter_dir+'BOLOCAM'+'/' dir_wise=filter_dir+'WISE'+'/' dir_laboca=filter_dir+'LABOCA'+'/' +dir_saboca=filter_dir+'SABOCA'+'/' dir_gismo=filter_dir+'GISMO'+'/' -IF which_hfi_filters EQ 'GL' THEN dir_hfi=filter_dir+'HFI/FromGL/bandpass'+'/' -IF which_hfi_filters EQ 'OFFICIAL' THEN dir_hfi=filter_dir+'HFI/OFFICIAL'+'/' +dir_hfi=filter_dir+'HFI'+'/' +;;IF which_hfi_filters EQ 'GL' THEN dir_hfi=filter_dir+'HFI/FromGL/bandpass'+'/' +;;IF which_hfi_filters EQ 'OFFICIAL' THEN dir_hfi=filter_dir+'HFI/OFFICIAL'+'/' dir_lfi=filter_dir+'LFI'+'/' dir_wmap=filter_dir+'WMAP'+'/' dir_spire=filter_dir+'SPIRE'+'/' @@ -138,6 +140,7 @@ dir_spass=filter_dir+'SPASS'+'/' ;dir_chipass=filter_dir+'CHIPASS'+'/' dir_nika2=filter_dir+'NIKA2'+'/' dir_scuba2=filter_dir+'SCUBA2'+'/' +dir_hawcplus=filter_dir+'HAWCPLUS'+'/' dir_irs=filter_dir+'IRS'+'/' dir_miri=filter_dir+'MIRI'+'/' dir_nircam=filter_dir+'NIRCam'+'/' @@ -155,27 +158,35 @@ Nband=n_elements(filt_names) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -;This is the detector transmission -file=dir_pacs+'PCalPhotometer_Absorption_FM_v2.fits' -wave=mrdfits(file,1,h,silent=1);,/silent) -Trans=mrdfits(file,2,h,silent=1);/silent) - -;This is the filters transmission -file=dir_pacs+'PCalPhotometer_FilterTransmission_FM_v1.fits' -st1=mrdfits(file,1,h,silent=1) & lamb1=st1.wavelength & T1=st1.transmission -st2=mrdfits(file,2,h,silent=1) & lamb2=st2.wavelength & T2=st2.transmission -st3=mrdfits(file,3,h,silent=1) & lamb3=st3.wavelength & T3=st3.transmission - -TT1=interpol(Trans,wave,lamb1) -TT2=interpol(Trans,wave,lamb2) -TT3=interpol(Trans,wave,lamb3) -T1=T1*TT1 -T2=T2*TT2 -T3=T3*TT3 -;== Caution: filters have to be put back in the right order -T_ptr(0)=ptr_new(T2/max(T2)) & nu_ptr(0)=ptr_new(cmic/lamb2) & wav_ptr(0)=ptr_new(lamb2) -T_ptr(1)=ptr_new(T3/max(T3)) & nu_ptr(1)=ptr_new(cmic/lamb3) & wav_ptr(1)=ptr_new(lamb3) -T_ptr(2)=ptr_new(T1/max(T1)) & nu_ptr(2)=ptr_new(cmic/lamb1) & wav_ptr(2)=ptr_new(lamb1) +;; ;This is the detector transmission +;; file=dir_pacs+'PCalPhotometer_Absorption_FM_v2.fits' +;; wave=mrdfits(file,1,h,silent=1);,/silent) +;; Trans=mrdfits(file,2,h,silent=1);/silent) + +;; ;This is the filters transmission +;; file=dir_pacs+'PCalPhotometer_FilterTransmission_FM_v1.fits' +;; st1=mrdfits(file,1,h,silent=1) & lamb1=st1.wavelength & T1=st1.transmission +;; st2=mrdfits(file,2,h,silent=1) & lamb2=st2.wavelength & T2=st2.transmission +;; st3=mrdfits(file,3,h,silent=1) & lamb3=st3.wavelength & T3=st3.transmission + +;; TT1=interpol(Trans,wave,lamb1) +;; TT2=interpol(Trans,wave,lamb2) +;; TT3=interpol(Trans,wave,lamb3) +;; T1=T1*TT1 +;; T2=T2*TT2 +;; T3=T3*TT3 +;; ;== Caution: filters have to be put back in the right order +;; T_ptr[0]=ptr_new(T2/max(T2)) & nu_ptr[0]=ptr_new(cmic/lamb2) & wav_ptr[0]=ptr_new(lamb2) +;; T_ptr[1]=ptr_new(T3/max(T3)) & nu_ptr[1]=ptr_new(cmic/lamb3) & wav_ptr[1]=ptr_new(lamb3) +;; T_ptr[2]=ptr_new(T1/max(T1)) & nu_ptr[2]=ptr_new(cmic/lamb1) & wav_ptr[2]=ptr_new(lamb1) + +readcol, dir_pacs+dustem_filter2filter_filename(filt_names[0]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +readcol, dir_pacs+dustem_filter2filter_filename(filt_names[1]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +readcol, dir_pacs+dustem_filter2filter_filename(filt_names[2]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) + pacs_struct={Name:'PACS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_pacs,central_frequencies:cmic/wfilt_pacs, $ 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 ;====================================================== IF print_messages THEN message,'Reading PILOT filter',/continue -;Read WMAP filter Transmission +;Read PILOT filter Transmission filt_names=['PILOT1'] wfilt_pilot=dustem_filter2wav(filt_names) Nband=n_elements(filt_names) @@ -198,7 +209,7 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) stP=read_xcat(dir_pilot+'pilot_transmission.xcat',/silent) Trans=stP.transmission & lamb=stP.wavelength;cmic/(stP.frequency*1e9) ;microns -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) pilot_struct={Name:'PILOT',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_pilot,central_frequencies:cmic/wfilt_pilot, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ @@ -215,31 +226,40 @@ wfilt_spire=dustem_filter2wav(filt_names) Nband=n_elements(filt_names) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -;==== CAUTION: problem with SPIRE transmission file badly read by -;==== readcol because of ^M -;readcol,dir_spire+'SPIRE_transmissions.txt',nn,T1,T2,T3 -openr,unit,dir_spire+'SPIRE_transmissions.txt',/get_lun -sstr=' ' -readf,unit,sstr -readf,unit,sstr -readf,unit,sstr -T1=[0.] & T2=T1 & T3=T1 & nn=T1 -WHILE not eof(unit) DO BEGIN - readf,unit,sstr - vv=float(str_sep(sstr,' ')) - nn=[nn,vv(0)] - T1=[T1,vv(1)] - T2=[T2,vv(2)] - T3=[T3,vv(3)] -ENDWHILE -nn=nn[1:*] & T1=T1[1:*] & T2=T2[1:*] & T3=T3[1:*] -lamb=1./nn*1.e4 ;in microns -T_ptr(0)=ptr_new(T1/max(T1)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -T_ptr(1)=ptr_new(T2/max(T2)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -T_ptr(2)=ptr_new(T3/max(T3)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) +;; ;==== CAUTION: problem with SPIRE transmission file badly read by +;; ;==== readcol because of ^M +;; ;readcol,dir_spire+'SPIRE_transmissions.txt',nn,T1,T2,T3 +;; openr,unit,dir_spire+'SPIRE_transmissions.txt',/get_lun +;; sstr=' ' +;; readf,unit,sstr +;; readf,unit,sstr +;; readf,unit,sstr +;; T1=[0.] & T2=T1 & T3=T1 & nn=T1 +;; WHILE not eof(unit) DO BEGIN +;; readf,unit,sstr +;; vv=float(str_sep(sstr,' ')) +;; nn=[nn,vv(0)] +;; T1=[T1,vv(1)] +;; T2=[T2,vv(2)] +;; T3=[T3,vv(3)] +;; ENDWHILE +;; nn=nn[1:*] & T1=T1[1:*] & T2=T2[1:*] & T3=T3[1:*] +;; lamb=1./nn*1.e4 ;in microns +;; T_ptr[0]=ptr_new(T1/max(T1)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +;; T_ptr[1]=ptr_new(T2/max(T2)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +;; T_ptr[2]=ptr_new(T3/max(T3)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) +;; close,unit +;; free_lun,unit ;stop +readcol, dir_spire+dustem_filter2filter_filename(filt_names[0]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4 +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +readcol, dir_spire+dustem_filter2filter_filename(filt_names[1]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4 +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +readcol, dir_spire+dustem_filter2filter_filename(filt_names[2]), lamb_Ang, Trans,/silent,format='F,F',comment='#' & lamb=lamb_Ang/1.e4 +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) + spire_struct={Name:'SPIRE',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spire,central_frequencies:cmic/wfilt_spire, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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) stV=read_xcat(dir_wmap+'wmap_bandpass_V_v3.xcat',/silent) stW=read_xcat(dir_wmap+'wmap_bandpass_W_v3.xcat',/silent) Trans=stW.transmission & lamb=cmic/(stW.frequency*1e9) ;microns -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) Trans=stV.transmission & lamb=cmic/(stV.frequency*1e9) -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) Trans=stQ.transmission & lamb=cmic/(stQ.frequency*1e9) -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) Trans=stKa.transmission & lamb=cmic/(stKa.frequency*1e9) -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb) +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb) Trans=stK.transmission & lamb=cmic/(stK.frequency*1e9) -T_ptr(4)=ptr_new(Trans/max(Trans)) & nu_ptr(4)=ptr_new(cmic/lamb) & wav_ptr(4)=ptr_new(lamb) +T_ptr[4]=ptr_new(Trans/max(Trans)) & nu_ptr[4]=ptr_new(cmic/lamb) & wav_ptr[4]=ptr_new(lamb) wmap_struct={Name:'WMAP',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_wmap,central_frequencies:cmic/wfilt_wmap, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ @@ -290,14 +310,14 @@ wfilt_irac=dustem_filter2wav(filt_names) Nband=n_elements(filt_names) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol, dir_spitzer+'irac1.dat', lamb, Trans, /silent -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -readcol, dir_spitzer+'irac2.dat', lamb, Trans, /silent -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -readcol, dir_spitzer+'irac3.dat', lamb, Trans, /silent -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) -readcol, dir_spitzer+'irac4.dat', lamb, Trans, /silent -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[0]), lamb, Trans, /silent,format='F,F',comment='#' +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[1]), lamb, Trans, /silent,format='F,F',comment='#' +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[2]), lamb, Trans, /silent,format='F,F',comment='#' +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[3]), lamb, Trans, /silent,format='F,F',comment='#' +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb) irac_struct={Name:'Spitzer-IRAC',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_irac,central_frequencies:cmic/wfilt_irac, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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) Nband=n_elements(filt_names) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol, dir_spitzer+'MIPSfiltsumm_24.txt', lamb, Trans,/silent -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -readcol, dir_spitzer+'MIPSfiltsumm_70.txt', lamb, Trans,/silent -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -readcol, dir_spitzer+'MIPSfiltsumm_160.txt', lamb, Trans,/silent -;stop -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[0]), lamb, Trans,/silent,format='F,F',comment='#' +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[1]), lamb, Trans,/silent,format='F,F',comment='#' +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +readcol, dir_spitzer+dustem_filter2filter_filename(filt_names[2]), lamb, Trans,/silent,format='F,F',comment='#' +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) mips_struct={Name:'Spitzer-MIPS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt,central_frequencies:cmic/wfilt, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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 ;Read MSX filter Transmission ;Strongly inspired from N. Flagey's routine get_msx_flux.pro -filt_names=['MSX1','MSX2','MSX3','MSX4'] +filt_names=['MSX1','MSX2','MSX3','MSX4','MSX5','MSX6'] wfilt=dustem_filter2wav(filt_names) Nband=n_elements(filt_names) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_msx+'dsi_aw.dat',lamb,Trans, /silent -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -readcol,dir_msx+'dsi_cw.dat',lamb,Trans, /silent -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -readcol,dir_msx+'dsi_dw.dat',lamb,Trans, /silent -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) -readcol,dir_msx+'dsi_ew.dat',lamb,Trans, /silent -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb) + +FOR k=0L,Nband-1 DO BEGIN + readcol,dir_msx+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmission, /silent,format='F,F',comment='#' + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmission + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) +ENDFOR + +;; readcol,dir_msx+'dsi_aw.dat',lamb,Trans, /silent +;; T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +;; readcol,dir_msx+'dsi_cw.dat',lamb,Trans, /silent +;; T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +;; readcol,dir_msx+'dsi_dw.dat',lamb,Trans, /silent +;; T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) +;; readcol,dir_msx+'dsi_ew.dat',lamb,Trans, /silent +;; T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb) + msx_struct={Name:'MSX',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt,central_frequencies:cmic/wfilt, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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) Nband=n_elements(filt_names) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_bol+'bolocam_1p1.txt',freq,Trans, /silent -lamb=3.e14/freq +readcol,dir_bol+'bolocam_1p1.txt',freq,Trans, /silent, format='F,F',comment='#' +lamb=cmic/freq T_ptr=ptr_new(Trans/max(Trans)) & nu_ptr=ptr_new(cmic/lamb) & wav_ptr=ptr_new(lamb) bolocam_struct={Name:'BOLOCAM',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt,central_frequencies:cmic/wfilt, $ 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 ;Read SPM filter Transmission filt_names=['SPM1','SPM2','SPM3','SPM4'] +Nband=n_elements(filt_names) wfilt_spm=dustem_filter2wav(filt_names) ;This was causing trouble under fawlty somehow. replaced by reading a single xcat file ;readcol,dir_spm+'DataFiltresSPM',nucm,T1,T2,T3,T4,format='F,F,F,F,F' @@ -393,7 +423,6 @@ nufilt_spm=nufilt_spm(ind) Tfilt_spm=fltarr(count,4) Tfilt_spm(*,0)=T1(ind) & Tfilt_spm(*,1)=T2(ind) Tfilt_spm(*,2)=T3(ind) & Tfilt_spm(*,3)=T4(ind) -Nband=4 nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) @@ -412,28 +441,33 @@ spm_struct={Name:'PRONAOS-SPM',Nbands:Nband,filter_names:filt_names,central_wave ;====================================================== IF print_messages THEN message,'Reading Akari filters',/continue -;written by Ryou Ohsawa -;Bugs corrected by Deborah Paradis -Nband=6 -filt_names=['AKARI1','AKARI2','AKARI3','AKARI4','AKARI5','AKARI6'] +filt_names=['AKARI1','AKARI2','AKARI3','AKARI4','AKARI5','AKARI6','AKARI7','AKARI8','AKARI9','AKARI10','AKARI11','AKARI12','AKARI13'] +Nband=n_elements(filt_names) wfilt_akari=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_akari+'filter_S9w.txt',lamb,Trans, /silent -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -readcol,dir_akari+'filter_L18w.txt',lamb,Trans, /silent -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -readcol,dir_akari+'filter_N60.txt',lamb,Trans, /silent -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) -readcol,dir_akari+'filter_WS.txt',lamb,Trans, /silent -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb) -readcol,dir_akari+'filter_WL.txt',lamb,Trans, /silent +;; readcol,dir_akari+'filter_S9w.txt',lamb,Trans, /silent +;; T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +;; readcol,dir_akari+'filter_L18w.txt',lamb,Trans, /silent +;; T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +;; readcol,dir_akari+'filter_N60.txt',lamb,Trans, /silent +;; T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) +;; readcol,dir_akari+'filter_WS.txt',lamb,Trans, /silent +;; T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb) +;; readcol,dir_akari+'filter_WL.txt',lamb,Trans, /silent +;; T_ptr[4]=ptr_new(Trans/max(Trans)) & nu_ptr[4]=ptr_new(cmic/lamb) & wav_ptr[4]=ptr_new(lamb) +;; readcol,dir_akari+'filter_N160.txt',lamb,Trans, /silent +;; T_ptr(5)=ptr_new(Trans/max(Trans)) & nu_ptr(5)=ptr_new(cmic/lamb) & wav_ptr(5)=ptr_new(lamb) -T_ptr(4)=ptr_new(Trans/max(Trans)) & nu_ptr(4)=ptr_new(cmic/lamb) & wav_ptr(4)=ptr_new(lamb) -readcol,dir_akari+'filter_N160.txt',lamb,Trans, /silent -T_ptr(5)=ptr_new(Trans/max(Trans)) & nu_ptr(5)=ptr_new(cmic/lamb) & wav_ptr(5)=ptr_new(lamb) +FOR k=0L,Nband-1 DO BEGIN + readcol,dir_akari+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions,/silent,format='F,F',comment='#' + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmissions + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) +ENDFOR akari_struct={Name:'AKARI',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_akari,central_frequencies:cmic/wfilt_akari, $ 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 ;====================================================== IF print_messages THEN message,'Reading IRAS filters',/continue -Nband=4 filt_names=['IRAS1','IRAS2','IRAS3','IRAS4'] +Nband=n_elements(filt_names) wfilt_iras=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_iras+'IRAS12.txt',lamb,Trans, /silent -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -readcol,dir_iras+'IRAS25.txt',lamb,Trans, /silent -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -readcol,dir_iras+'IRAS60.txt',lamb,Trans, /silent -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) -readcol,dir_iras+'IRAS100.txt',lamb,Trans, /silent -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb) +readcol,dir_iras+dustem_filter2filter_filename(filt_names[0]),lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +readcol,dir_iras+dustem_filter2filter_filename(filt_names[1]),lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +readcol,dir_iras+dustem_filter2filter_filename(filt_names[2]),lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) +readcol,dir_iras+dustem_filter2filter_filename(filt_names[3]),lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb) iras_struct={Name:'IRAS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_iras,central_frequencies:cmic/wfilt_iras, $ 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 ;====================================================== IF print_messages THEN message,'Reading DIRBE filters',/continue -file=dir_dirbe+'dirbe_response.asc' -readcol,file,wavemic,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,/silent -ind=where(wavemic GT 1 AND wavemic LT 500,count) -Nband=10 -;wfilt_dirbe=[1.25,2.2,3.5,4.9,12,25.,60.,100.,140,240] filt_names=['DIRBE1','DIRBE2','DIRBE3','DIRBE4','DIRBE5','DIRBE6','DIRBE7','DIRBE8','DIRBE9','DIRBE10'] +Nband=n_elements(filt_names) wfilt_dirbe=dustem_filter2wav(filt_names) -nufilt_dirbe=cmic/wavemic(ind) ;in Hz -Tfilt_dirbe=fltarr(count,10) -Tfilt_dirbe(*,0)=T1(ind) & Tfilt_dirbe(*,1)=T2(ind) & Tfilt_dirbe(*,2)=T3(ind) & Tfilt_dirbe(*,3)=T4(ind) -Tfilt_dirbe(*,4)=T5(ind) & Tfilt_dirbe(*,5)=T6(ind) & Tfilt_dirbe(*,6)=T7(ind) & Tfilt_dirbe(*,7)=T8(ind) -Tfilt_dirbe(*,8)=T9(ind) & Tfilt_dirbe(*,9)=T10(ind) -order=sort(nufilt_dirbe) -nufilt_dirbe=nufilt_dirbe(order) -Tfilt_dirbe=Tfilt_dirbe(order,*) +nu_dirbe=cmic/wfilt_dirbe/1.e9 ;GHz +wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -FOR i=0,Nband-1 DO BEGIN - nu_ptr(i)=ptr_new(nufilt_dirbe) - T_ptr(i)=ptr_new(Tfilt_dirbe(*,i)/max(Tfilt_dirbe(*,i))) - wav_ptr(i)=ptr_new(cmic/nufilt_dirbe) + +;; file=dir_dirbe+'dirbe_response.asc' +;; readcol,file,wavemic,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,/silent +;; ind=where(wavemic GT 1 AND wavemic LT 500,count) +;; ;wfilt_dirbe=[1.25,2.2,3.5,4.9,12,25.,60.,100.,140,240] +;; nufilt_dirbe=cmic/wavemic(ind) ;in Hz +;; Tfilt_dirbe=fltarr(count,10) +;; Tfilt_dirbe(*,0)=T1(ind) & Tfilt_dirbe(*,1)=T2(ind) & Tfilt_dirbe(*,2)=T3(ind) & Tfilt_dirbe(*,3)=T4(ind) +;; Tfilt_dirbe(*,4)=T5(ind) & Tfilt_dirbe(*,5)=T6(ind) & Tfilt_dirbe(*,6)=T7(ind) & Tfilt_dirbe(*,7)=T8(ind) +;; Tfilt_dirbe(*,8)=T9(ind) & Tfilt_dirbe(*,9)=T10(ind) +;; order=sort(nufilt_dirbe) +;; nufilt_dirbe=nufilt_dirbe(order) +;; Tfilt_dirbe=Tfilt_dirbe(order,*) +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) +;; FOR i=0,Nband-1 DO BEGIN +;; nu_ptr(i)=ptr_new(nufilt_dirbe) +;; T_ptr(i)=ptr_new(Tfilt_dirbe(*,i)/max(Tfilt_dirbe(*,i))) +;; wav_ptr(i)=ptr_new(cmic/nufilt_dirbe) +;; ENDFOR + +FOR k=0L,Nband-1 DO BEGIN + readcol,dir_dirbe+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions_E,/silent,format='F,F',comment='#' + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmissions_E/freq + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) ENDFOR + dirbe_struct={Name:'DIRBE',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_dirbe, $ central_frequencies:cmic/wfilt_dirbe, $ 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 ;====================================================== IF print_messages THEN message,'Reading ARCHEOPS filters',/continue -Nband=4 -filt_names=['ARCHEOPS4','ARCHEOPS3','ARCHEOPS2','ARCHEOPS1'] +filt_names=['ARCHEOPS1','ARCHEOPS2','ARCHEOPS3','ARCHEOPS4'] +Nband=n_elements(filt_names) wfilt_archeops=dustem_filter2wav(filt_names) nu_archeops=cmic/wfilt_archeops/1.e9 ;GHz wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_archeops+'Filter_545GHz.dat',nu,Trans, /silent -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) -readcol,dir_archeops+'Filter_353GHz.dat',nu,Trans, /silent -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) -readcol,dir_archeops+'bande217k04.txt',nu2,Trans2, /silent -nu=nu2 & Trans=Trans2 -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) -readcol,dir_archeops+'bande143k01.txt',nu2,Trans2, /silent -nu=nu2 & Trans=Trans2 -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) +FOR k=0L,Nband-1 DO BEGIN + readcol,dir_archeops+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions,/silent,format='F,F',comment='#' + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmissions + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) +ENDFOR + +;; readcol,dir_archeops+'Filter_545GHz.dat',nu,Trans, /silent +;; 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) +;; readcol,dir_archeops+'Filter_353GHz.dat',nu,Trans, /silent +;; 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) +;; readcol,dir_archeops+'bande217k04.txt',nu2,Trans2, /silent +;; nu=nu2 & Trans=Trans2 +;; 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) +;; readcol,dir_archeops+'bande143k01.txt',nu2,Trans2, /silent +;; nu=nu2 & Trans=Trans2 +;; 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) archeops_struct={Name:'ARCHEOPS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_archeops,central_frequencies:cmic/wfilt_archeops, $ 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 ;is probably wrong for Intensity (should devide them by 2) ... IF print_messages THEN message,'Reading HFI filters',/continue -Nband=6 -filt_names=['HFI6','HFI5','HFI4','HFI3','HFI2','HFI1'] +filt_names=['HFI1','HFI2','HFI3','HFI4','HFI5','HFI6'] +Nband=n_elements(filt_names) wfilt_hfi=dustem_filter2wav(filt_names) nu_hfi=cmic/wfilt_hfi/1.e9 ;GHz -;== below is for the F. Pajot files -band_names='*'+['100','143','217','353','545','857']+'GHz*.dat' -;== below is for the files provided by Guilaine -IF which_hfi_filters EQ 'GL' THEN BEGIN - band_names='bandpass'+'*'+['100','143','217','353','545','857']+'*.dat' -ENDIF -IF which_hfi_filters EQ 'OFFICIAL' THEN BEGIN - band_names=['100','143','217','353','545','857'] -ENDIF wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -IF which_hfi_filters NE 'OFFICIAL' THEN BEGIN - FOR k=0L,Nband-1 DO BEGIN - hfi_files=findfile(dir_hfi+band_names(k),count=Nfiles) -; IF k EQ Nband-1 THEN stop - FOR i=0L,Nfiles-1 DO BEGIN - IF i EQ 0 THEN BEGIN - readcol,hfi_files(i),cm1,Trans,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL - nu=cmic*(cm1/1.e4)/1.d9 ;GHz - IF which_hfi_filters EQ 'GL' THEN BEGIN - nu=cm1/1.d9 - ENDIF - ENDIF ELSE BEGIN - readcol,hfi_files(i),cm2,Trans2,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL - nu2=cmic*(cm2/1.e4)/1.d9 ;GHz - IF which_hfi_filters EQ 'GL' THEN BEGIN - nu2=cm2/1.d9 - ENDIF - Trans=Trans+interpol(Trans2,nu2,nu) - ENDELSE - ENDFOR - 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) -; stop - ENDFOR -ENDIF ELSE BEGIN ;This is the OFFICIAL version - ;CAUTION: filters for individual detectors added with flat weights -; hfi_filter_version='v101' - hfi_filter_version='v201' - bp = hfi_read_bandpass(hfi_filter_version, /rimo,path_rimo=dir_hfi) - bp_band=strmid(bp.name,3,3) - not_used=['70_143_8', '55_545_3', '74_857_4'] ;these should not be used (see in HFI official color_correction.pro) -;stop - FOR k=0L,Nband-1 DO BEGIN - Trans=0. - ind=where(bp_band EQ band_names(k),count) - ;set the reference frequencies for the band - iref=0L - nunu=bp(ind(iref)).freq/1.d9 - ind2=where(nunu NE 0.,count2) - nu=nunu(ind2) - FOR i=0L,count-1 DO BEGIN -; stop -; TT=[0.,bp(ind(i)).trans,0.] -; nunu=[min(nu),bp(ind(i)).freq/1.e9,max(nu)] - indd=where(not_used EQ bp(ind(i)).name,countt) - IF countt EQ 0 THEN BEGIN - TT=bp(ind(i)).trans - nunu=bp(ind(i)).freq/1.d9 - ind2=where(nunu NE 0.,count2) -; print,band_names(k),count2,minmax(nunu(ind2)) -; IF i EQ 0 THEN nu=nunu(ind2) ;we use the frequencies of the first filter - Trans=Trans+interpol(TT(ind2),nunu(ind2),nu) - ENDIF - ENDFOR - 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) - ENDFOR -ENDELSE + +;; ;== below is for the F. Pajot files +;; band_names='*'+['100','143','217','353','545','857']+'GHz*.dat' +;; ;== below is for the files provided by Guilaine +;; IF which_hfi_filters EQ 'GL' THEN BEGIN +;; band_names='bandpass'+'*'+['100','143','217','353','545','857']+'*.dat' +;; ENDIF +;; IF which_hfi_filters EQ 'OFFICIAL' THEN BEGIN +;; band_names=['100','143','217','353','545','857'] +;; ENDIF +;; wav_ptr=ptrarr(Nband) +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) +;; IF which_hfi_filters NE 'OFFICIAL' THEN BEGIN +;; FOR k=0L,Nband-1 DO BEGIN +;; hfi_files=findfile(dir_hfi+band_names(k),count=Nfiles) +;; ; IF k EQ Nband-1 THEN stop +;; FOR i=0L,Nfiles-1 DO BEGIN +;; IF i EQ 0 THEN BEGIN +;; readcol,hfi_files(i),cm1,Trans,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL +;; nu=cmic*(cm1/1.e4)/1.d9 ;GHz +;; IF which_hfi_filters EQ 'GL' THEN BEGIN +;; nu=cm1/1.d9 +;; ENDIF +;; ENDIF ELSE BEGIN +;; readcol,hfi_files(i),cm2,Trans2,/silent ;caution: frequencies in those files are in cm^(-1) for FP in Hz for GL +;; nu2=cmic*(cm2/1.e4)/1.d9 ;GHz +;; IF which_hfi_filters EQ 'GL' THEN BEGIN +;; nu2=cm2/1.d9 +;; ENDIF +;; Trans=Trans+interpol(Trans2,nu2,nu) +;; ENDELSE +;; ENDFOR +;; 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) +;; ; stop +;; ENDFOR +;; ENDIF ELSE BEGIN ;This is the OFFICIAL version +;; ;CAUTION: filters for individual detectors added with flat weights +;; ; hfi_filter_version='v101' +;; hfi_filter_version='v201' +;; bp = hfi_read_bandpass(hfi_filter_version, /rimo,path_rimo=dir_hfi) +;; bp_band=strmid(bp.name,3,3) +;; not_used=['70_143_8', '55_545_3', '74_857_4'] ;these should not be used (see in HFI official color_correction.pro) +;; ;stop +;; FOR k=0L,Nband-1 DO BEGIN +;; Trans=0. +;; ind=where(bp_band EQ band_names(k),count) +;; ;set the reference frequencies for the band +;; iref=0L +;; nunu=bp(ind(iref)).freq/1.d9 +;; ind2=where(nunu NE 0.,count2) +;; nu=nunu(ind2) +;; FOR i=0L,count-1 DO BEGIN +;; ; stop +;; ; TT=[0.,bp(ind(i)).trans,0.] +;; ; nunu=[min(nu),bp(ind(i)).freq/1.e9,max(nu)] +;; indd=where(not_used EQ bp(ind(i)).name,countt) +;; IF countt EQ 0 THEN BEGIN +;; TT=bp(ind(i)).trans +;; nunu=bp(ind(i)).freq/1.d9 +;; ind2=where(nunu NE 0.,count2) +;; ; print,band_names(k),count2,minmax(nunu(ind2)) +;; ; IF i EQ 0 THEN nu=nunu(ind2) ;we use the frequencies of the first filter +;; Trans=Trans+interpol(TT(ind2),nunu(ind2),nu) +;; ENDIF +;; ENDFOR +;; 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) +;; ENDFOR +;; ENDELSE + +FOR k=0L,Nband-1 DO BEGIN + readcol,dir_hfi+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmission, /silent,format='F,F',comment='#' + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmission + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) +ENDFOR + hfi_struct={Name:'HFI',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_hfi,central_frequencies:cmic/wfilt_hfi, $ 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: ;====================================================== ;==== PLANCK-LFI ;====================================================== -;Obtained from Marco Bersaneli, via Cyril Roset -;Filters for each detectors are just averaged simply IF print_messages THEN message,'Reading LFI filters',/continue -Nband=3 -filt_names=['LFI3','LFI2','LFI1'] +filt_names=['LFI1','LFI2','LFI3'] +Nband=n_elements(filt_names) wfilt_lfi=dustem_filter2wav(filt_names) nu_lfi=cmic/wfilt_lfi/1.e9 ;GHz -band_names='*'+['30','44','70']+'GHz*.dat' wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -goto,jump_over_this -FOR k=0L,Nband-1 DO BEGIN - lfi_files=findfile(dir_lfi+band_names(k),count=Nfiles) -; stop - FOR i=0L,Nfiles-1 DO BEGIN - IF i EQ 0 THEN BEGIN - readcol,lfi_files(i),nu,R0D0,R0D1,R1D0,R1D1,/silent - ENDIF ELSE BEGIN - readcol,lfi_files(i),nu2,R0D0_2,R0D1_2,R1D0_2,R1D1_2,/silent - stop - R0D0=R0D0+interpol(R0D0_2,nu2,nu) - R1D0=R1D0+interpol(R1D0_2,nu2,nu) - R0D1=R0D1+interpol(R0D1_2,nu2,nu) - R1D1=R1D1+interpol(R1D1_2,nu2,nu) - ENDELSE - ENDFOR - Trans=sqrt(R0D0^2+R1D1^2+R1D0^2+R0D1^2) ;I have no idea if this is how it should be done - T_ptr[k]=ptr_new(Trans/max(Trans)) - nu_ptr[k]=ptr_new(nu*1.e9) - wav_ptr[k]=ptr_new(cmic/nu/1.e9) -ENDFOR -jump_over_this: + +;; ;Obtained from Marco Bersaneli, via Cyril Roset +;; ;Filters for each detectors are just averaged simply +;; goto,jump_over_this +;; band_names='*'+['30','44','70']+'GHz*.dat' +;; FOR k=0L,Nband-1 DO BEGIN +;; lfi_files=findfile(dir_lfi+band_names(k),count=Nfiles) +;; ; stop +;; FOR i=0L,Nfiles-1 DO BEGIN +;; IF i EQ 0 THEN BEGIN +;; readcol,lfi_files(i),nu,R0D0,R0D1,R1D0,R1D1,/silent +;; ENDIF ELSE BEGIN +;; readcol,lfi_files(i),nu2,R0D0_2,R0D1_2,R1D0_2,R1D1_2,/silent +;; stop +;; R0D0=R0D0+interpol(R0D0_2,nu2,nu) +;; R1D0=R1D0+interpol(R1D0_2,nu2,nu) +;; R0D1=R0D1+interpol(R0D1_2,nu2,nu) +;; R1D1=R1D1+interpol(R1D1_2,nu2,nu) +;; ENDELSE +;; ENDFOR +;; Trans=sqrt(R0D0^2+R1D1^2+R1D0^2+R0D1^2) ;I have no idea if this is how it should be done +;; T_ptr[k]=ptr_new(Trans/max(Trans)) +;; nu_ptr[k]=ptr_new(nu*1.e9) +;; wav_ptr[k]=ptr_new(cmic/nu/1.e9) +;; ENDFOR +;; jump_over_this: +;; FOR k=0L,Nband-1 DO BEGIN +;; lfi_file=dir_lfi+'TRANS_LFI'+strtrim(k+1,2)+'.xcat' +;; st=read_xcat(lfi_file,/silent) +;; wav_ptr[k]=ptr_new(st.wav) +;; nu_ptr[k]=ptr_new(st.nu) +;; T_ptr[k]=ptr_new(st.T) +;; ENDFOR + FOR k=0L,Nband-1 DO BEGIN - lfi_file=dir_lfi+'TRANS_LFI'+strtrim(k+1,2)+'.xcat' - st=read_xcat(lfi_file,/silent) - wav_ptr[k]=ptr_new(st.wav) - nu_ptr[k]=ptr_new(st.nu) - T_ptr[k]=ptr_new(st.T) + readcol,dir_lfi+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmission, /silent,format='F,F',comment='#' + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmission + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) ENDFOR 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) FOR i=0L,Nband-1 DO BEGIN ; readcol,dir_iso+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment='#' tst=read_xcat(dir_iso+dustem_filter2filter_filename(filt_names[i]),/silent) - waves_mic=tst.waves_mic & Trans = tst.trans + waves_mic=tst.waves_mic + Trans = tst.trans freq=cmic/waves_mic T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) ENDFOR @@ -741,7 +820,7 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) FOR k=0L,Nband-1 DO BEGIN isophot_files=findfile(dir_isophot+band_names(k),count=Nfiles) - readcol,isophot_files(0),wav,Trans,/silent + readcol,isophot_files[0],wav,Trans,/silent nu=cmic/wav/1.e9 ;GHz T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.e9) & wav_ptr(k)=ptr_new(wav) ENDFOR @@ -767,7 +846,7 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) FOR k=0L,Nband-1 DO BEGIN isophot_files=findfile(dir_isophot+band_names(k),count=Nfiles) - readcol,isophot_files(0),wav,Trans,/silent + readcol,isophot_files[0],wav,Trans,/silent nu=cmic/wav/1.e9 ;GHz T_ptr(k)=ptr_new(Trans/max(Trans)) & nu_ptr(k)=ptr_new(nu*1.e9) & wav_ptr(k)=ptr_new(wav) ENDFOR @@ -785,9 +864,10 @@ IF print_messages THEN message,'Reading equivalent FIRAS filters',/continue ;Equivalent FIRAS filters (used in Boulanger et al 90) ;Defined as top-hat filters with 30% bandwidth (although not given in ;Boulanger et al). -Nband=8 + wfilt_efiras=[100. ,140 ,240 ,346 ,490 ,535 ,736 ,1100 ] filt_names=['F100','F140','F240','F346','F490','F535','F736','F1100'] +Nband=n_elements(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) 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 ;====================================================== IF print_messages THEN message,'Reading WISE filters',/continue -Nband=4 filt_names=['WISE1','WISE2','WISE3','WISE4'] +Nband=n_elements(filt_names) wfilt_wise=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_wise+'RSR-W1.EE.txt',lamb,Trans, /silent -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) -readcol,dir_wise+'RSR-W2.EE.txt',lamb,Trans, /silent -T_ptr(1)=ptr_new(Trans/max(Trans)) & nu_ptr(1)=ptr_new(cmic/lamb) & wav_ptr(1)=ptr_new(lamb) -readcol,dir_wise+'RSR-W3.EE.txt',lamb,Trans, /silent -T_ptr(2)=ptr_new(Trans/max(Trans)) & nu_ptr(2)=ptr_new(cmic/lamb) & wav_ptr(2)=ptr_new(lamb) -readcol,dir_wise+'RSR-W4.EE.txt',lamb,Trans, /silent -T_ptr(3)=ptr_new(Trans/max(Trans)) & nu_ptr(3)=ptr_new(cmic/lamb) & wav_ptr(3)=ptr_new(lamb) +readcol,dir_wise+'RSR-W1.EE.txt',lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) +readcol,dir_wise+'RSR-W2.EE.txt',lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(cmic/lamb) & wav_ptr[1]=ptr_new(lamb) +readcol,dir_wise+'RSR-W3.EE.txt',lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[2]=ptr_new(Trans/max(Trans)) & nu_ptr[2]=ptr_new(cmic/lamb) & wav_ptr[2]=ptr_new(lamb) +readcol,dir_wise+'RSR-W4.EE.txt',lamb,Trans, /silent,format='F,F',comment='#' +T_ptr[3]=ptr_new(Trans/max(Trans)) & nu_ptr[3]=ptr_new(cmic/lamb) & wav_ptr[3]=ptr_new(lamb) wise_struct={Name:'WISE',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_wise,central_frequencies:cmic/wfilt_wise, $ 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 ;====================================================== IF print_messages THEN message,'Reading LABOCA filters',/continue -Nband=1 filt_names=['LABOCA1'] +Nband=n_elements(filt_names) wfilt_laboca=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_laboca+'labocaRSRF.data',freq,Trans, /silent +readcol,dir_laboca+'laboca_passband_normalized.txt',freq,Trans, /silent,format='F,F',comment='#' lamb=cmic/(freq*1.e9) -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) laboca_struct={Name:'LABOCA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_laboca,central_frequencies:cmic/wfilt_laboca, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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'} ;====================================================== +;==== SABOCA +;====================================================== +IF print_messages THEN message,'Reading SABOCA filters',/continue + +filt_names=['SABOCA1'] +Nband=n_elements(filt_names) +wfilt_saboca=dustem_filter2wav(filt_names) +wav_ptr=ptrarr(Nband) +nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) +use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) + +readcol,dir_saboca+'saboca_passband_normalized.txt',freq,Trans, /silent,format='F,F',comment='#' +lamb=cmic/(freq*1.e9) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) + +saboca_struct={Name:'SABOCA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_saboca,central_frequencies:cmic/wfilt_saboca, $ + filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ + 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'} + +;====================================================== ;==== GISMO ;====================================================== IF print_messages THEN message,'Reading GISMO filters',/continue -Nband=1 filt_names=['GISMO1'] +Nband=n_elements(filt_names) wfilt_gismo=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_gismo+'GISMO_TRANSMISSION.txt',lamb,freq,Trans, /silent +readcol,dir_gismo+'GISMO_TRANSMISSION.txt',lamb,freq,Trans, /silent,format='F,F,F',comment='#' lamb=lamb*1000. ; in microns -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(cmic/lamb) & wav_ptr(0)=ptr_new(lamb) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(cmic/lamb) & wav_ptr[0]=ptr_new(lamb) gismo_struct={Name:'GISMO',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_gismo,central_frequencies:cmic/wfilt_gismo, $ 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 ;====================================================== IF print_messages THEN message,'Reading SPASS filters',/continue -Nband=1 filt_names=['SPASS1'] +Nband=n_elements(filt_names) wfilt_spass=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) 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) freq=st.frequency*1.e9 ;Hz Trans=st.transmission -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(freq) & wav_ptr(0)=ptr_new(cmic/freq) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq) spass_struct={Name:'SPASS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spass,central_frequencies:cmic/wfilt_spass, $ 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 ;====================================================== IF print_messages THEN message,'Reading CHIPASS filters',/continue -Nband=1 filt_names=['CHIPASS1'] +Nband=n_elements(filt_names) wfilt_chipass=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) 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) freq=st.frequency*1.e9 ;Hz Trans=st.transmission -T_ptr(0)=ptr_new(Trans/max(Trans)) & nu_ptr(0)=ptr_new(freq) & wav_ptr(0)=ptr_new(cmic/freq) +T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq) chipass_struct={Name:'CHIPASS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_chipass,central_frequencies:cmic/wfilt_chipass, $ 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 ;====================================================== IF print_messages THEN message,'Reading NIKA2 filters',/continue -;# NIKA1200 -;# photon -;# Average of array 1 and array3 of NIKA2, 1.2mm arrays -;# 1st column: wavelength in angstrom -Nband=2 filt_names=['NIKA21','NIKA22'] +Nband=n_elements(filt_names) wfilt_nika2=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_nika2+'NIKA1200.dat',waves_angstrom,transmissions -waves_mic=waves_angstrom/1.e10*1.e6 +;readcol,dir_nika2+'NIKA1200.dat',waves_angstrom,transmissions +st=read_xcat(dir_nika2+dustem_filter2filter_filename(filt_names[0]),/silent) +waves_mic=st.wave freq=cmic/waves_mic -Trans=transmissions +Trans=st.trans T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq) -readcol,dir_nika2+'NIKA2000.dat',waves_angstrom,transmissions -waves_mic=waves_angstrom/1.e10*1.e6 +;readcol,dir_nika2+'NIKA2000.dat',waves_angstrom,transmissions +;waves_mic=waves_angstrom/1.e10*1.e6 +st=read_xcat(dir_nika2+dustem_filter2filter_filename(filt_names[1]),/silent) +waves_mic=st.wave freq=cmic/waves_mic -Trans=transmissions +Trans=st.trans T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(freq) & wav_ptr[1]=ptr_new(cmic/freq) 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 ;====================================================== IF print_messages THEN message,'Reading SCUBA2 filters',/continue -Nband=1 -filt_names=['SCUBA21'] +filt_names=['SCUBA21','SCUBA22'] +Nband=n_elements(filt_names) wfilt_scuba2=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_scuba2+'JCMT_SCUBA2.850.dat',waves_angstrom,transmissions +readcol,dir_scuba2+dustem_filter2filter_filename(filt_names[0]),waves_angstrom,transmissions waves_mic=waves_angstrom/1.e10*1.e6 freq=cmic/waves_mic Trans=transmissions T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq) +readcol,dir_scuba2+dustem_filter2filter_filename(filt_names[1]),waves_angstrom,transmissions +waves_mic=waves_angstrom/1.e10*1.e6 +freq=cmic/waves_mic +Trans=transmissions +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(freq) & wav_ptr[1]=ptr_new(cmic/freq) + scuba2_struct={Name:'SCUBA2',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_scuba2,central_frequencies:cmic/wfilt_scuba2, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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'} ;====================================================== +;==== HAWCPLUS +;====================================================== +IF print_messages THEN message,'Reading HAWCPLUS filters',/continue + +filt_names=['HAWCPLUS1','HAWCPLUS2','HAWCPLUS3','HAWCPLUS4','HAWCPLUS5'] +Nband=n_elements(filt_names) +wfilt_hawcplus=dustem_filter2wav(filt_names) +wav_ptr=ptrarr(Nband) +nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) +use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) + +FOR k=0L,Nband-1 DO BEGIN + readcol,dir_hawcplus+dustem_filter2filter_filename(filt_names[k]),waves_angstrom,transmissions_E + waves_mic=waves_angstrom/1.e10*1.e6 + freq=cmic/waves_mic + Trans=transmissions_E/freq + T_ptr[k]=ptr_new(Trans/max(Trans)) & nu_ptr[k]=ptr_new(freq) & wav_ptr[k]=ptr_new(cmic/freq) +ENDFOR + +hawcplus_struct={Name:'HAWCPLUS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_hawcplus,central_frequencies:cmic/wfilt_hawcplus, $ + filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ + 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'} + +;====================================================== ;==== IRS ;====================================================== -IF print_messages THEN message,'Reading IRS filters',/continue +IF print_messages THEN message,'Reading IRS PUI filters',/continue -;# IRS16 -;# energy -;# Spitzer IRS 16 micron -;# 1st column: wavelength in angstrom -Nband=1 -filt_names=['IRS1'] +filt_names=['IRS1','IRS2'] +Nband=n_elements(filt_names) wfilt_irs=dustem_filter2wav(filt_names) wav_ptr=ptrarr(Nband) nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -readcol,dir_irs+'IRS16.dat',waves_angstrom,transmissions_E +readcol,dir_irs+dustem_filter2filter_filename(filt_names[0]),waves_angstrom,transmissions_E waves_mic=waves_angstrom/1.e10*1.e6 freq=cmic/waves_mic Trans=transmissions_E/freq T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq) +readcol,dir_irs+dustem_filter2filter_filename(filt_names[1]),waves_angstrom,transmissions_E +waves_mic=waves_angstrom/1.e10*1.e6 +freq=cmic/waves_mic +Trans=transmissions_E/freq +T_ptr[1]=ptr_new(Trans/max(Trans)) & nu_ptr[1]=ptr_new(freq) & wav_ptr[1]=ptr_new(cmic/freq) + +;readcol,dir_irs+'IRS16.dat',waves_angstrom,transmissions_E +;waves_mic=waves_angstrom/1.e10*1.e6 +;freq=cmic/waves_mic +;Trans=transmissions_E/freq +;T_ptr[0]=ptr_new(Trans/max(Trans)) & nu_ptr[0]=ptr_new(freq) & wav_ptr[0]=ptr_new(cmic/freq) + irs_struct={Name:'IRS',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_irs,central_frequencies:cmic/wfilt_irs, $ filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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 filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ 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'} -;====================================================== -;==== JWST-NIRCAM module A -;====================================================== -IF print_messages THEN message,'Reading NIRCAM module A filter transmissions',/continue +;; ;====================================================== +;; ;==== JWST-NIRCAM module A +;; ;====================================================== +;; IF print_messages THEN message,'Reading NIRCAM module A filter transmissions',/continue -Nband=29 -filt_names='NIRCAMA'+strtrim(indgen(Nband)+1,2) -wfilt_nircama=dustem_filter2wav(filt_names) -wav_ptr=ptrarr(Nband) -nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) -use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) +;; Nband=29 +;; filt_names='NIRCAMA'+strtrim(indgen(Nband)+1,2) +;; wfilt_nircama=dustem_filter2wav(filt_names) +;; wav_ptr=ptrarr(Nband) +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -FOR i=0L,Nband-1 DO BEGIN - readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' - freq=cmic/waves_mic - Trans=transmissions_E/freq - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) -ENDFOR +;; FOR i=0L,Nband-1 DO BEGIN +;; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' +;; freq=cmic/waves_mic +;; Trans=transmissions_E/freq +;; T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) +;; ENDFOR -nircama_struct={Name:'NIRCAMA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircama,central_frequencies:cmic/wfilt_nircama, $ - filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ - 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'} +;; nircama_struct={Name:'NIRCAMA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircama,central_frequencies:cmic/wfilt_nircama, $ +;; filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ +;; 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'} -;====================================================== -;==== JWST-NIRCAM -;====================================================== +;; ;====================================================== +;; ;==== JWST-NIRCAM +;; ;====================================================== -IF print_messages THEN message,'Reading NIRCAM module B filter transmissions',/continue +;; IF print_messages THEN message,'Reading NIRCAM module B filter transmissions',/continue -Nband=29 -filt_names='NIRCAMB'+strtrim(indgen(Nband)+1,2) -wfilt_nircamb=dustem_filter2wav(filt_names) -wav_ptr=ptrarr(Nband) -nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) -use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) +;; Nband=29 +;; filt_names='NIRCAMB'+strtrim(indgen(Nband)+1,2) +;; wfilt_nircamb=dustem_filter2wav(filt_names) +;; wav_ptr=ptrarr(Nband) +;; nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) +;; use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) -FOR i=0L,Nband-1 DO BEGIN - readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' - freq=cmic/waves_mic - Trans=transmissions_E/freq -; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment="#" - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) -ENDFOR +;; FOR i=0L,Nband-1 DO BEGIN +;; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' +;; freq=cmic/waves_mic +;; Trans=transmissions_E/freq +;; ; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment="#" +;; T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) +;; ENDFOR -nircamb_struct={Name:'NIRCAMB',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircamb,central_frequencies:cmic/wfilt_nircamb, $ - filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ - 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'} +;; nircamb_struct={Name:'NIRCAMB',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_nircamb,central_frequencies:cmic/wfilt_nircamb, $ +;; filter_wavelengths:wav_ptr,filter_frequencies:nu_ptr,filter_transmissions:T_ptr, $ +;; 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'} ;====================================================== ;==== JWST-NIRISS @@ -1123,7 +1260,10 @@ nu_ptr=ptrarr(Nband) & T_ptr=ptrarr(Nband) & wav_ptr=ptrarr(Nband) use_nu=ptrarr(Nband) & use_T=ptrarr(Nband) & use_w=ptrarr(Nband) FOR i=0L,Nband-1 DO BEGIN - readcol,dir_niriss+dustem_filter2filter_filename(filt_names[i]),waves_mic,thru_filt,transmissions_E,comment="#" +; readcol,dir_niriss+dustem_filter2filter_filename(filt_names[i]),waves_mic,thru_filt,transmissions_E,comment="#" + filter_dat=mrdfits(dir_niriss+dustem_filter2filter_filename(filt_names[i]),1,h,/silent) + waves_mic=filter_dat.wave + transmissions_E=filter_dat.throughput freq=cmic/waves_mic Trans=transmissions_E/freq 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={ $ BOLOCAM:bolocam_struct, $ WISE:wise_struct, $ LABOCA:laboca_struct, $ + SABOCA:laboca_struct, $ GISMO:gismo_struct, $ + HAWCPLUS:hawcplus_struct, $ SPASS:spass_struct, $ CHIPASS:chipass_struct, $ NIKA2:nika2_struct, $ @@ -1166,8 +1308,6 @@ dm_filter_struct={ $ IRS:irs_struct, $ MIRI:miri_struct, $ NIRCAM:nircam_struct, $ - NIRCAMA:nircama_struct, $ - NIRCAMB:nircamb_struct, $ NIRISS:niriss_struct $ } @@ -1205,8 +1345,8 @@ IF keyword_set(plot_it) THEN BEGIN ENDFOR ENDIF -close,unit -free_lun,unit +;; close,unit +;; free_lun,unit !quiet=quiet_old heap_gc -- libgit2 0.21.2