Calculations of impurity radiation and its effects on tokamak experiments