The next generation of great space telescopes is heading into its final round of ground tests. The nearly $9 billion James Webb Space Telescope will replace the aging Hubble Space Telescope. It's designed to provide unprecedented images of the earliest stars and galaxies that formed in the universe.

But before the telescope can get to work, there are still a lot of engineering challenges to overcome.

For example, the Webb telescope is designed to look at the infrared wavelengths of light given off by stars. Infrared is needed to see some of the earliest stars and galaxies that formed billions of years ago.

But to work properly, infrared telescopes have to be kept cold — very cold. So engineers had to design a multilayered sun shield to protect the telescope from the sun's heat.

"That's like a big umbrella — beach umbrella — so, we keep that facing the sun and the Earth so it dissipates all the heat through all the layers," says Begoña Vila, an astrophysicist and systems engineer at NASA's Goddard Space Flight Center, in Greenbelt, Md. "That allows all the instruments to cool to the temperatures that we need."

Now, the sun shield is big, about the size of a tennis court, and for launch it has to fit into a much smaller space — about the size of a school bus. So engineers had to come up with a way to fold it up. They also had to design a way to fold up the main mirror, and several other critical instruments.

Then, after launch, everything has to unfold in a carefully choreographed sequence of steps over two weeks. You can see that sequence in this video.

Many of the steps are absolutely crucial. A failure would compromise the telescope's functionality and could render it useless. For the army of scientists and engineers who have been working on the telescope for nearly two decades, the deployment phase will be nerve-wracking.

"Yes, I think that scares all of us," says Vila. But there's no way around it. "We do as much testing as we can."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.