; convolves and entire AVIRIS cube to Landsat bandpasses -- will not work for; other sensors because it makes a specific assumption about the number of; bands and center positions in the input cube ; ; input cube must be in BIP formatpro conv_avcub,fname,ns,nl,nb,ofname,landsat=landsat, avwavfile=avwavfile; default to landsat 7 bandpassesif (keyword_set(landsat) eq 0) then landsat = 7; number of landsat bandslsbands = 6openr,un1,/get,fnameslice = intarr(nb,ns)openw,un2,/get,ofnameoutslice = intarr(lsbands,ns)print,load_cols(avwavfile,avwav)junk = load_cols('band1', lsfilter1)junk = load_cols('band2', lsfilter2)junk = load_cols('band3', lsfilter3)junk = load_cols('band4', lsfilter4)junk = load_cols('band5', lsfilter5)junk = load_cols('band7', lsfilter7); set the index to the column in the bandpass filesif (landsat eq 4) then begin   index=2endif else if (landsat eq 5) then begin   index=3endif else begin   index=1end; resample the landsat filter functions to AVIRIS wavelengths.  Normalize; the filter function to 1. super_resample,lsfilter1(index,*),lsfilter1(0,*),bp1,avwav(1,*)*1000.,avwav(2,*)*1000.bp1(0:5)=0bp1(17:*)=0bp1 = bp1/total(bp1)super_resample,lsfilter2(index,*),lsfilter2(0,*),bp2,avwav(1,*)*1000.,avwav(2,*)*1000.bp2(0:13)=0bp2(26:*)=0bp2 = bp2/total(bp2) super_resample,lsfilter3(index,*),lsfilter3(0,*),bp3,avwav(1,*)*1000.,avwav(2,*)*1000.bp3(0:25)=0bp3(38:*)=0bp3 = bp3/total(bp3)super_resample,lsfilter4(index,*),lsfilter4(0,*),bp4,avwav(1,*)*1000.,avwav(2,*)*1000.bp4(0:40)=0bp4(61:*)=0bp4 = bp4/total(bp4)super_resample,lsfilter5(index,*),lsfilter5(0,*),bp5,avwav(1,*)*1000.,avwav(2,*)*1000.bp5(0:120)=0bp5(151:*)=0bp5 = bp5/total(bp5)super_resample,lsfilter7(index,*),lsfilter7(0,*),bp7,avwav(1,*)*1000.,avwav(2,*)*1000.bp7(0:168)=0bp7(212:*)=0bp7 = bp7/total(bp7)for i=0,nl-1 do begin  readu,un1,slice  for j=0,ns-1 do begin    outslice(0,j) = total(bp1*slice(*,j))    outslice(1,j) = total(bp2*slice(*,j))    outslice(2,j) = total(bp3*slice(*,j))    outslice(3,j) = total(bp4*slice(*,j))    outslice(4,j) = total(bp5*slice(*,j))    outslice(5,j) = total(bp7*slice(*,j))  endfor  writeu,un2,outsliceendforfree_lun,un1,un2end ; conv_avcub