China has a lot of coal power plants, and is planning to build even more. At the rate construction is going, China will have a fifth of the world’s fossil-fuel power plants by 2040. If that happens, there will be no chance that the world will hit the goals set under the Paris climate agreement and will be facing catastrophic climate change.

It doesn’t have to be this way. A new analysis published by Carbon Tracker, a UK-based, non-profit financial think tank, has some startling results:

Owing to high fuel costs, 40% of China’s coal fleet are likely to generate net losses in 2018. By 2040, 95% of the fleet can be expected to be losing money, because of projected carbon pricing (about $40 per metric ton by that point) and air-pollution regulations. By 2021, it will be cheaper to build new onshore-wind farms than to operate similar-sized coal plants, and by 2025, the same will be true about building new solar farms. Chinese coal-power owners could avoid losing some $390 billion by retiring the existing fleet in a manner consistent with the Paris Agreement, which would result in China cutting its emissions alongside global targets.

Currently, China doesn’t publish data its coal power-plant use in any given year until the next year. Those data, however, are essential. They can be used to estimate the country’s emissions, its fuel stocks, and other commercially important measures. For example, the delayed reporting means financial organizations get the information too late to make annual decisions on, say, whether it makes sense to fund a new coal power plant.

To overcome the delay, Carbon Tracker used satellite images to estimate more up-to-date usage rates for China’s coal power plants.

Carbon Tracker was able to look at the plumes produced by coal power plants in China and estimate how long the power plant was in “on” state. It also applied machine learning—using data from US and European coal power plants (which typically report without much delay)—to the images of Chinese plants and estimated how much power each plant was generating while running.

It’s relatively easy to understand Carbon Tracker’s conclusion that, already, some 40% of coal power plants in China operate at a loss. We know, roughly, the cost of coal, and we roughly know what Chinese consumers pay for electricity. Put those together and you can estimate profits and losses.

Carbon Tracker found that China’s coal fleet was actually producing power for less than half the time it could have been generating energy. In industry terms, its utilization rate was below 50%. That’s partly because China has other means to generate power and partly because the country is looking to cut air pollution. It’s a major underuse of very expensive assets.

Projections for coming years is trickier. Carbon Tracker assumes China will levy some form of carbon pricing, starting in 2021 at $5 per metric ton of carbon dioxide emissions and rising to about $40 by 2040. That will add to the operating expenses of coal power plants, and eat into potential profits. Under those assumptions, as many as 95% of China’s coal fleet will cause their owners to lose money.

Based on those same carbon price predictions, it will be cheaper to build brand new wind and solar farms in China than to operate an existing coal power plant in 2021 and 2025, respectively, according to Carbon Tracker.

This is the first time an analysis of power generation based on satellite images has been done, which means the results are likely to have large margin of error. For example, Carbon Tracker has already found that, when running its models on historical images of coal power plants, its predictions for how much power those plants generated were slightly higher than the actual data provided by the Chinese government. The models also make a number of assumptions to simplify calculations. And the models cannot predict a wild change in Chinese policy, which hasn’t been a rare occurrence in recent history. However, despite those caveats, this kind of analysis still provides new insights into coal’s future in China.