The phrase "learn'd astronomer" contains irony. Whitman uses this phrase to say that the astronomer was well-versed yet his lectures could not inspire him. When he came out in nature, he felt more inspired than his factual lecture.