Determination of rotational temperatures of diatomic molecules from absorption spectra measured at moderate resolution