; NAME: ; syntphot ; ; PURPOSE: ; Synthetic photometry ; ; CATEGORY: ; Data Reduction ; ; CALLING SEQUENCE: ; syntphot,wobj,fobj,wvega,fvega,mvega,wtrans,trans,bandwidth,l_eff,l_ave, ; flux,mag,COVERAGE=coverage,CANCEL=cancel ; ; INPUTS: ; wobj - Wavelength array of the object spectrum ; fobj - Flux array of the object spectrum ; wvega - Wavelength array of the Vega spectrum (units same as wobj) ; fvega - Flux array of the Vega spectrum (units same as wobj) ; mvega - The magnitude of Vega for the given filter transmission ; wtrans - Wavelength array of the transmission profile ; trans - Array of the transmission profile (0 to 1) ; ; OUTUTS: ; bandwidth - The filter bandwidth in units of wobj ; coverage - Percent coverage of bandwidth due to spectrum overlap ; l_eff - The effective wavelength ; l_ave - The average wavelength ; flux - The flux in the filter in units of fobj ; mag - The magnitude of the object ; ; KEYWORD PARAMETERS: ; SILENT - Set to supress coverage message. ; CANCEL - Set on return if there is a problem ; ; PROCEDURES CALLED: ; Requires the Astronomy User's Library ; ; PROCEDURE: ; Later ; ;REVISION HISTORY: ; 2002-02-10 - Written by M. Cushing, Institute for Astronomy, UH ; pro syntphot,wobj,fobj,wvega,fvega,mvega,wtrans,trans,bandwidth,coverage,$ l_eff,l_ave,flux,mag,SILENT=silent,CANCEL=cancel cancel = 0 coverage = 0 if n_params() lt 8 then begin print, 'Syntax - syntphot,wobj,fobj,wvega,fvega,mvega,wtrans,trans,$' print, ' bandwidth,coverage,l_eff,l_ave,flux,mag,$' print, ' SILENT=silentCANCEL=cancel)' cancel = 1 return endif zparcheck, 'photscale', wobj, 1, [1,2,3,4,5],1, 'Wobj' zparcheck, 'photscale', fobj, 2, [1,2,3,4,5],1, 'Fobj' zparcheck, 'photscale', wvega, 3, [1,2,3,4,5],1, 'Wvega' zparcheck, 'photscale', fvega, 4, [1,2,3,4,5],1, 'Fvega' zparcheck, 'photscale', mvega, 5, [1,2,3,4,5],0, 'Mvega' zparcheck, 'photscale', wtrans, 6, [1,2,3,4,5],1, 'Wtrans' zparcheck, 'photscale', trans, 7, [1,2,3,4,5],1, 'Trans' twrange = [min(wtrans,max=max),max] owrange = [min(wobj,max=max),max] vwrange = [min(wvega,max=max),max] bandwidth = int_tabulated(wtrans,trans,/DOUBLE) ; Check to see if the object wavelength coverage encompasses the ; filter's entire wavelength range. if owrange[1] lt twrange[1] or owrange[0] gt twrange[0] then begin if not keyword_set(SILENT) then print, $ 'Warning - Object spectrum does not span full range of filter '+$ 'profile.' endif ; Interpolate Vega and the filter profile onto the object's ; wavelength sampling interpspec,wvega,fvega,wobj,rfvega interpspec,wtrans,trans,wobj,rtrans ztrans = where(finite(rtrans) eq 1 and finite(fobj) eq 1 ,count) if count ne n_elements(rtrans) then begin rfvega = rfvega[ztrans] fobj = fobj[ztrans] rtrans = rtrans[ztrans] wobj = wobj[ztrans] endif ; Compute intergated fluxes. sbandwidth = int_tabulated(wobj,rtrans,/DOUBLE) coverage = (max(wobj,min=min)-min)/(twrange[1]-twrange[0])*100. l_ave = int_tabulated(wobj,wobj*rtrans,/DOUBLE) / sbandwidth l_eff = int_tabulated(wobj,wobj*fobj*rtrans,/DOUBLE) / $ int_tabulated(wobj,fobj*rtrans,/DOUBLE) flux = int_tabulated(wobj,fobj*rtrans) ifvega = int_tabulated(wobj,rfvega*rtrans) mag = mvega -2.5*alog10(flux/ifvega) end