Recent bugfix of MAJA v4, please consider upgrading to 4.5.4
A bug affecting the AOT estimates and leading to underestimated surface reflectances in some rare cases concerns all MAJA v4.x versions prior to 4.5.4. Users activating the CAMS option shouldn’t have noticed, but if you don’t use CAMS auxiliary data you may face this issue.
Therefore, we highly recommend all users to upgrade to the latest MAJA 4.5.4 available for download here: Download Maja 4.5.4
MAJA version 4 was a complete recoding of MAJA version 3’s internal scheduler (the « Main » program). It went from a monolithic C++ code, hard to maintain, to the use of OTB applications chained in a Python orchestrator.
Despite all our tests (global, algorithmic, unitary), developed on a continuous integration platform, it seems we had missed one bug (let’s hope it’s the last one). This bug appeared in the aerosol estimation method, the most complex one, and caused in some parts of rare images, the apparition of high optical thicknesses and low surface reflectances. It then could propagate to the next images, as the method is multi-temporal.
It took us some time to figure out what was happening, and Julie Brossard finally found out that it was due to the reading of a float parameter as an integer (Wdark).
Wdark is the weight of an equation in the cost function of the aerosol optical thickness (AOT) estimates. This equation increases the cost if surface reflectances are really close or below 0. This equation is therefore useful if something goes wrong in the aerosol estimates, with a too high AOT, yielding very low surface reflectances.
In most cases this equation is not needed, but there are some cases when it is necessary: if the prescribed type of aerosol is wrong, or if there was an issue with the cloud detection. We are very conservative with clouds in MAJA and every suspicious pixel is not considered in the aerosol estimates, but still, some cases might escape to the detection, for example, thin clouds above shadows, whose reflectance stays in the expected range for a clear pixel.
In the original versions we used to use a value of 10, which is not affected by that bug. This value is still in use in our algorithmic tests. But a few years go, I figured out that Wdark was too high, and tended to bias the aerosol estimates even if the conditions were perfect for the estimate. After a lot of tests, it was set to 0.5 . And there, the truncated value has a huge effect.
Within THEIA, we process data using CAMS to decide which aerosol type has to be used. This eliminates one of the error causes which make Wdark useful. But users who do not use the CAMS data are somewhat more affected.
We thank the Sen2Agri project who raised this issue, and CS Group for the investigation and bugfix. If you are interested, you might follow the discussions here , and have an idea of the quantity of work needed to maintain a software like MAJA.
![]() |
![]() |
Example of MAJA v3 L2A | Same product as (left) with MAJA v4 before bugfix. After bugfix, both images are identical. |