Inferring upper-mantle temperatures from seismic velocities