The de facto implemented formula is

T_K = valueBeam * SPEED_LIGHT_FACTOR / ( beamSolidAngle * FREQUENCY_FACTOR * pow(frequencyValue,2) )

where

valueBeam is the intensity in Jy/beam

SPEED_LIGHT_FACTOR = 9E-10 = 1E-26 * 3E8**2

FREQUENCY_FACTOR = 2 * 1.38E-23

beamSolidAngle [sr] is computed using pi*(bmin_arcsec/206264.8)*(bmaj_arcsec/206264.8)/4./ln(2)