When I heard the learn'd astronomer; (line 1)
We might be reading too far into this line, but you could compare the lecture to a kind of secular church service. Everyone is seated in a cramped room, listening to someone lecturing about the heavens. Whitman preferred individual, mystical experience to organized worship.
When the proofs, the figures, (line 2)
This line raises the question of what constitutes "proof," not only in science, but in spirituality. Is it logic and reason, or intuition and feeling? Whitman clearly goes for the latter in this poem.
Till rising and gliding out, I wander'd off by myself, (line 6)
When he "rises" from his seat, you could easily read the situation metaphorically as the "rising" of his spirit. This line makes us think of one of those little transparent ghosts floating out of the body of cartoon characters when they suffer some horrible accident. (But as we know, they always end up back in their bodies for the next scene!)