HOUSTON  John Grunsfeld was sitting in an astronomical meeting in Atlanta in January of 2004 when he got a message to come back to headquarters in Washington to talk about the Hubble Space Telescope.

To say that he was excited would be an understatement. As an astronaut, Dr. Grunsfeld had twice journeyed to space to make repairs on humanity’s most vaunted eye on the cosmos, experiences he had described to a high-level panel pondering Hubble’s fate only a few months before as the most meaningful in his life. He was looking forward to leading the third and final servicing mission, which had been delayed by the loss of the shuttle Columbia and its crew the year before.

Thinking that the mission was now being scheduled, Dr. Grunsfeld raced to Washington, only to learn that Sean O’Keefe, NASA’s administrator, had canceled it on the ground that it was too risky. Wearing his other hat as NASA’s chief scientist, Dr. Grunsfeld now had the job of telling the world that the space agency was basically abandoning its greatest scientific instrument at the same time that it was laying plans for the even riskier and more expensive effort to return humans to the Moon.

He said he felt as if he had been hit by a two-by-four.

“Being an astronaut, there are not a lot of things that have really shocked me in my life,” Dr. Grunsfeld said in a recent interview. But, he added, “I don’t think anybody could ever prepare themselves for, you know, trying to bury something that they have said, ‘Hey, this is worth risking my life for.’ ”