It's been decades in the making, but the successor to the Hubble Telescope may finally go into space later this week.
The James Webb Space Telescope (JWST) is the biggest, most powerful space telescope ever built.
With its massive gold-coated mirror, it promises to shine new light on the first stars and galaxies that formed after the Big Bang nearly 14 billion years ago.
The new telescope will extend what we know about the universe, said astrophysicist John Mather, JWST's senior project scientist at NASA's Goddard Space Flight Center.
"I'm hoping that it will tell us about the beginning of everything," said the Nobel laureate, whose work was instrumental in confirming the Big Bang theory of the universe.
The telescope will also be able to detect atmospheres around alien planets in the Milky Way, and moons in our own solar system.
After years of delays, the long-awaited $US9.7 billion ($13 billion) telescope is due to blast off from French Guiana about 11.20pm (AEDT) on Saturday, December 25 (but there have been issues with the rocket and launch pad recently so this may change).
The next few months will be critical to its success, said Amber Straughn, deputy project scientist for the JWST at NASA's Goddard Space Flight Center.
"The launch is a big moment for any mission, but the telescope's journey is only just beginning."
Before it starts to explore the universe, the telescope must unfurl from its position inside the rocket capsule in the trickiest set of manoeuvres that NASA has ever performed.
"We have a six-month period to get this telescope ready to do science, and it is an intense six months," Dr Straughn said.
The biggest telescope in space
The James Webb Space Telescope is named after the administrator of NASA during the Apollo era, despite protests by some scientists.
It's the most complex telescope ever built by NASA, the European Space Agency (ESA) and the Canadian Space Agency.
"[JWST] turned out to be much more complicated than anyone could imagine," said Dr Mather, who has worked on the project since 1995.
The telescope has four instruments — cameras and spectrographs — that can take images and detect energy in the infrared light spectrum.
At the heart of the telescope is a 6.5-metre gold-plated mirror made up of 18 segments.
"The larger your mirror, the more light you can collect, and the sharper images you can collect," Dr Straughn said.
Surrounding the mirror is a five-layer silver shield the size of a tennis court that will protect the telescope from the heat of the Sun.
The heat shield will keep the telescope super cold — minus 223 degrees Celsius, close to absolute zero — so it's able to observe objects in the infrared.
At these cool temperatures, the telescope is extraordinarily sensitive, Dr Mather said.
"If you were a small insect, a 1-square-centimetre object at the distance of the Moon away from the telescope, we would be able to see the sunshine you reflect and the heat you emit," he said.
Sitting about 1.5 million kilometres away from Earth, the JWST will be much further away from us than the Hubble Space Telescope.
Its position in space is also critical to protecting the telescope from the Sun, making sure it doesn't heat up and distort images.
As it orbits the Sun, the JWST will sit in Earth's shadow all year long in a position known as the second Lagrange point.
"That's the only spot in the Solar System that's like that," Dr Mather said.
"That means you can have a one-sided umbrella to protect you."
How does it compare with the Hubble Space Telescope?
The Hubble Space Telescope has transformed our view of our universe for more than 30 years.
But even before it was launched in 1990, plans were already in the making for a next-generation telescope that could peer deeper into space.
"We like to say the James Webb is 100 times more powerful than Hubble, but that's not really quite accurate because it does different things," Dr Mather said.
The Hubble mainly looks at objects in visible and ultraviolet light as well as a little bit of infra-red light, which can penetrate through dust.
This can be seen in its famous images of the "Pillars of Creation" in the Eagle Nebula, a giant cloud of dust, gas and stars in the constellation of Serpens.
"One of the reasons Hubble has become such a beloved icon more widely than among just astronomers is because these images are just gorgeous," Dr Straughn said.
While the James Webb telescope won't see things in visible light, its images will be much more powerful than Hubble's in the infrared range.
"By looking at this near-infrared image of the Eagle Nebula, we do get a little bit of a hint at what these images will look like," Dr Straughn said.
"With JWST, we have a bigger mirror in that wavelength range, which means we'll see more details.
The telescope will give astronomers a new way of seeing things, Dr Mather said.
"We hope [it will give us] a new way of seeing inside dust clouds where stars are being born, as well as seeing further back in time and far further away in space."
When will we see the first images from James Webb?
We should see the first images about six months after launch. But there are a lot of things that have to go right before then.
Because the telescope is too big to fit into any rocket capsule, it has been folded like origami for its ride into space onboard ESA's Ariane rocket.
"The mirrors are folded up, the sunshade is folded up, the solar panels are folded up, the antenna is folded up, everything is folded and it has to all survive launch and then be released from the protective devices," Dr Mather said.
The two weeks following launch are the most intense, because that's when most of the major deployments take place, Dr Straughn said.
"Within a few days we start unfolding the giant sun shield, which involves hundreds of individual deployments," she said.
More than 370 mechanisms have to operate all at the same time for this to go smoothly.
The 18 mirror segments start to unfold on day 10 and take about three weeks to move into place.
By the end of the first month, the telescope will fire up its thrusters and head out to its final position in space.
That ends the deployment sequence, but lining up the individual mirror segments into one larger mirror will take months.
"That's an iterative process. We'll take an image of a star and then see how the mirror shapes up and tweak the mirror so it eventually makes one perfect surface," Dr Straughn said.
It also takes time too for all of the instruments to cool down.
How long will the telescope work for?
Unlike the Hubble, which has had several upgrades over the year, the James Webb will be too far away from Earth for astronauts to fix if something isn't working after it's fully deployed.
So each step in the six-month deployment is checked along the way, to give the telescope the best chance of succeeding.
"It's not like the Mars lander," Dr Straughn said.
"The Mars folks just hit 'go' and hold their breath for seven minutes and hope everything works. It's completely different with our telescope.
"If something doesn't work quite like expected, we can pause and say, 'OK, what's the data telling us?' and make adjustments."
Then, if everything goes to plan in the first six months, the telescope should have at least 10 years of fuel to keep it in its orbit, Dr Mather said.
"And if we're lucky, we don't spend the fuel too much on the initial orbit and then we might have a much longer observing time."
Meanwhile, despite a few recent technical glitches, the Hubble Space Telescope should continue to send back spectacular images in the visual and ultraviolet ranges.
"We certainly expect to overlap with Webb and Hubble together for a good long time," Dr Mather said.
But the first step will be getting off the ground.
"It's very exciting to imagine that this is going to be up there and doing its thing very soon," Dr Mather said.
"Of course, there's always this little nagging doubt in the back of my mind that says, 'Well, we've worked for all this time and we're putting our billions of dollars and our life work on top of all the explosive material you can possibly find and trusting that process.'
"But it is what we do."