Media playback is unsupported on your device Media caption Aeolus wind satellite: Take a look inside the spacecraft

They say there is no gain without pain, but when the European Space Agency (Esa) set out in 2002 to develop its Aeolus satellite, no-one could have imagined the grief the project would bring.

Designed to make the most comprehensive maps of winds across the Earth, the mission missed deadline after deadline as engineers struggled to get its key technology - an ultraviolet laser system - working for long enough to make the venture worth flying.

But now, 16 years on, the Aeolus satellite is finished and ready to ship to the launch pad. And far from being snuck out the back door at night in embarrassment at the huge delay, the spacecraft will be mated to its launch rocket with something of a fanfare.

Esa is taking pride in the fact that it overcame a major technical challenge.

"Many times I remember people saying, 'there's just no point in continuing because it is simply not possible to build a UV laser for space'. But this is the DNA of Esa - we do the difficult things and we don't give up," said the agency's Earth observation director, Dr Josef Aschbacher.

It helped of course that Aeolus promises data that many experts still believe will be transformative.

From its vantage point some 320km above the planet, the laser will track the movement of molecules and tiny particles to get a handle on the direction and speed of the wind.

How to measure the wind from space

Image copyright ESA

Aeolus will fire a laser through the atmosphere and measure the return signal

The light will scatter back off air molecules and particles moving in the wind

Meteorologists will adjust their numerical models to match this information

The biggest benefits should be in medium-range forecasts - a few days hence

Aeolus should pave the way for operational weather satellites with lasers

Currently, we measure the dynamics of the atmosphere using an eclectic mix of tools - everything from whirling anemometers to other types of satellite that judge wind behaviour from the choppiness of seawater. But these are all limited indications, telling us what is happening in particular places or at particular heights.

Aeolus, on the other hand, will attempt to build a truly global view of what the winds are doing on Earth, from the surface of the planet all the way up through the troposphere and into the stratosphere (from 0km to 30km).

"The lack of wind profile observations is one of the most important gaps to fill in order to improve numerical weather prediction," Dr Florence Rabier, the DG at the European Centre for Medium-Range Weather Forecasts (ECMWF), told BBC News.

"The Aladin Doppler wind lidar instrument onboard Aeolus will be the first satellite instrument that provides wind profiles from space.

"We have very high expectations regarding the quality of the Aeolus wind profile data, and we are anticipating forecast quality to increase by 2-4% in the extra-tropics and up to 15% in the tropics. Aeolus is paving the way for significant improvements in weather forecasting".

Image copyright Getty Images Image caption There are certain industrial sectors that absolutely depend on wind forecasts

There is an example that meteorologists quote from March 2014 - storminess that led to flooding in northern Europe.

When they did the post-event analysis to figure out why no-one had seen it coming, the conclusion was that inaccurate wind data six days previously had been used in the models. Dr Alain Dabas from MeteoFrance explained: "The error was in the central Pacific at an altitude of about 11km. There was a mistake in the initial winds given to the models and that propagated to Europe.

"The question now is would Aeolus have solved this problem? Probably, yes."

It goes without saying that knowing what the wind is going to do reaches beyond just the nightly weather forecast on TV. How it blows affects the distribution and transport of pollutants, and how quickly bad air in a hazy city, say, can be cleared away.

Then there are the requirements of safety to consider - think sailors at sea, or construction on high-rise buildings. And don't forget the sectors whose whole reason to exist rests on the wind.

"For instance, the wind energy industry," said Dr Anne Grete Straume, Esa's Aeolus mission scientist. "They're exploiting the winds and they need to know how much energy they can produce at any point in time. For that they need very accurate forecasts and we hope that our mission can help them with their management."

Image copyright Airbus Image caption Engineers had to find a way to stop the laser damaging its own optics

But all this depends on the UV laser doing its job. The engineers are very confident now that it can. They recently put the finished Aeolus satellite in a space chamber for six months to simulate the conditions of being in orbit. The whole system passed with flying colours.

It is worth recalling some of the past frustrations. The first problem was in finding diodes to generate laser light with a long enough lifetime. When those were identified, the mission looked in great shape until engineers discovered their design wouldn't actually operate in a vacuum - a significant barrier for a space mission.

Tests revealed that in the absence of air, the laser was degrading its own optics; as the high-energy light hit the lenses and mirrors, it would blacken them.

Companies across Europe were pushed to develop new coatings for the various elements. The key breakthrough, however, was to introduce a small amount of oxygen to the instrument to prevent surfaces carbonising.

It's a tiny puff of gas - 40 pascals' worth; the same pressure you might expect to develop from the presence of a photosynthesising plant. But it is sufficient to oxidise contaminants and remove them.

Image copyright Getty Images Image caption Saharan dust blown over London by the remnants of Hurricane Ophelia in 2017

"When we started, the only references we had were classified because these types of lasers are used to represent atomic bombs, and those technologies were totally locked out," said Anders Elfving, Esa's Aeolus project manager.

"The motivation for my team all these years was that there is no alternative, and of course the user community is still so enthusiastic for what we've built.

"We want to see what is invisible - to see the wind in clear skies. And I think active lidars like Aladin are the future - for much more accurate measurements of CO2 and other trace gases in the atmosphere."

The launch of Aeolus on a Vega rocket is currently set for 21 August.

Media playback is unsupported on your device Media caption Anders Elfving: "There were phases when I thought we wouldn't get here"

Jonathan.Amos-INTERNET@bbc.co.uk and follow me on Twitter: @BBCAmos