;******************************************* ; Convert radiances to brightness temp ;******************************************* pro rad_to_tb,radiances,tb,channel h=6.62606876e-34 ;Js ;Planck k=1.3806503e-23 ;J/K ;Boltzmann c=3.0e8 ;m/s ;speed of light ; lambda ;um ;wavelength of radiances if channel eq 31 then lambda=11.03 else $ if channel eq 33 then lambda=13.34 else $ if channel eq 36 then lambda=14.24 else begin print,'no lambda for this wavelength' print,'no tb conversion possible' stop endelse lambda=lambda*1e-6 ;convert to meters wvnum=1.0/lambda ;wavenumber do_lam='yes' if do_lam eq 'yes' then begin part1=(h*c)/(k*lambda) part2=(2.0*h*(c^2.0))/(lambda^5.0*radiances*1e6) part2=alog(part2+1.0) tb=part1/part2 endif do_wvnum='no' if do_wvnum eq 'yes' then begin part1=(h*c*wvnum)/k part2=2.0*h*(c^2.0)*(wvnum^5.0) part2=part2/(radiances*1e6) part2=alog(part2+1.0) tb=part1/part2 endif ; Put the missing flag in the tb array result=where(radiances le -8888,count) if count gt 0 then tb[result]=-8888 return end