A method for measuring temperature directly in the upper atmosphere with a rocket-borne magnetic mass spectrometer