calculation of emission and absorption rates for a two level system