Empirical Evidence and Assignment of Orbital Energies (Electron Filling)
As far as I know, it was a long and complex undertaking. You can't look at a single atomic species by itself. The understanding of level assignments to series slowly grew starting from the simplest cases.

Of course the first was hydrogen, where - at least initially - no series are discernible but one - there is almost perfect degeneration on l
. But that helped, as it allowed the first step, the one from wavelengths λ (or wavenumbers k=1/λ) to terms, later identified with energy levels. It was Ritz' combination principle:
k=Tm−Tn.
Already at this introductory level, a difficulty was to be overcome: the difference between emission and absorption spectra. The former is much richer. This was explained as a consequence of atoms in absorption initially being in the ground state alone, whereas in emission photons are emitted by excited atoms jumping to a lower state, not necessarily the ground one. For hydrogen this is especially notable, as there are no absorption lines in the visible region - the Balmer series has n=2

.

Then alkaline spectra were explored. In absorption spectra only lines Tn−T1
are observable, where T1 is what later would become the ground state energy (divided by hc). Note that here n=1, meaning the ground state, but this is not the principal quantum number of hydrogen-like classification, which is 2 for Li, 3 for Na, etc...

The main difference between hydrogen and alkaline spectra is that in the latter l degeneracy is broken. This required to separate terms in several series. Surely you know the origin of symbols S, P, D,... related to a different appearance of lines starting from different series towards the same final term. An instance is transitions S-P and D-P (in emission), In absorption only S-P transition is visible, giving rise to the principal series (therefrom P-terms).

But a second feature appears in alkaline spectra: the so-called "fine structure". It exists in hydrogen lines too, but is much less prominent, whereas the famous sodium doublet requires a modest resolving power to be seen. Its interpretation required the discovery of electron spin and of L-S coupling. The effect was a doubling of columns for all series, S excepted.

Well, this is a rough history, as I'm able to follow. Maybe a book could be of help: G. Herzberg, "Atomic Spectra and Atomic Structure". It's outdated as far as theory is concerned, but thanks to its publication date (first edition 1936) is nearer to the times when the studies were carried out.