function BT = bright_m(wavelength,radiance)

%       Calculates the brightness temperatures of a MODIS image array.  
%       This is based on Liam Gumley's IDL routine called bright_m.pro.
%
%       Input:
%       ------
%       wavelength  Wavelength (microns)
%       radiance    Planck radiance (Watts per square meter per steradian per micron)
%
%       Output:
%       -------
%       BT        Brightness temperature (Kelvin)
%
%       Translated to Matlab by Von P. Walden
%                               16 April 1998
%

% Constants are from Cohen, E. R. and B. N. Taylor, 1993: 
%   "The Fundamental Physical Constants", Physics Today, August 1993.

h = 6.6260755d-34;   % Planck constant (Joule second)
c = 2.9979246d+8;    % Speed of light in vacuum (meters per second)
k = 1.380658d-23;    % Boltzmann constant (Joules per Kelvin)
c1 = 2.0 * h * c^2;
c2 = h * c / k;

ws = 1.0e-6 * wavelength;
BT = c2 ./ ( ws * log( c1 ./ ( 1.0e6 * radiance * ws^5 ) + 1.0 ) );

return;
