Here's why:
* Atomic Emission Spectra are Intrinsic: The characteristic spectral lines emitted by an element are determined by the energy levels of its electrons. These energy levels are dictated by the fundamental laws of quantum mechanics and are inherent to the element itself.
* External Factors Don't Affect Energy Levels: The gravitational field, atmospheric pressure, or the presence of other elements in the environment don't change the fundamental structure of an atom and its energy levels.
* Sodium's Spectra: The bright yellow lines in sodium's emission spectrum are produced by the transition of electrons between specific energy levels within the sodium atom. These transitions are independent of the location.
Therefore, whether you excite sodium atoms on Earth or on the Moon, the resulting emission spectra will be identical.