Using the ODC to quantify the impact of the 2022 drought in Kenya

Sebastian Egli
OpenDataCube
Published in
7 min readMay 30, 2022

In May 2022, the Famine Early Warning System Network (FEWS NET) warned that the current drought in Kenya, already in its fourth season, would worsen as a fifth poor season was forecast.

At agriBORA we are very concerned about the recent developments and the crop reports we are receiving from our local farmers in Bungoma. To be able to monitor and assess the current challenges in the agricultural sector on a large scale, we have set up an ODC in Kenya. This helps us to rapidly and efficiently use the many satellite data sets that are now publicly available — especially those from NASA and the European Copernicus program — to analyze current events and trends in the region.

Here we want to examine the impact of the drought on agricultural cultivation periods in Kenya at the end of May 2022 using the ODC. We will exploit data from the Sentinel-2 mission as well as the CHIRPS precipitation product for this purpose. For presentation purposes, this article focuses on two exemplary regions in

  1. West Kenya (Kabuchai/Chwele ward in Bungoma which is dominated by agricultural farming)
  2. East Kenya (Mutitu/Kaliku ward in Kitui which is dominated by lifestock farming)

Although only two small areas are analyzed here, the whole approach is easily scalable to complete counties or — given enough processing power — even the whole state.

The comparison between two Sentinel-2 RGB composites for April 2021 (top) and 2022 (bottom) shows the widespread impacts of the current drought in an agriculturally dominated area close to Chwele in West Kenya.

Assessing crop growth/health in West Kenya

Our first aim is to assess the temporal evolution of the normalized difference vegetation index (NDVI) as a proxy for crop growth/health in our area of interest:

For this purpose, we load the publicly available Sentinel-2 data from the AWS cloud as cloud optimized GeoTIFFs for the months January to May for the years from 2020 to 2022 using the ODC. We won’t go into the details of the ODC setup process in this article. However, you can find instructions on how to set up the ODC here and here and how to index products like Sentinel-2 L2A or CHIRPS here.

First, we define our area of interest by specifying its bounding box lat/lon coordinates and draw it on an interactive map using the folium functionalities of geopandas. We start with West Kenya:

We can now go ahead and load data for this area . Only Sentinel-2-bands 1–4, 8 and 9 are loaded as we don’t need the other bands here.

Let’s first take a look at a subset of the data to get a better feeling of what we are dealing with. Here we only compare data from 2021 to 2022:

Sentinel-2 RGB timelines of April/May 2021 and 2022 of AOI in Kabuchai/Chwele Ward.

As you can see, the timeline of these true color RGB composites shows that there is an obvious delay in crop growth at the beginning of the long rain season in April 2022 as compared to 2021. However, we are dealing with a lot of unusable image data due to cloud cover. Unfortunately, the scene classification band (SCL) but also all common cloud masking algorithms (eg. fmask, sen2cor, s2cloudless) might work well in Europe but fail (miserably) in Kenya. So let’s try to remove clouds and cloud shadows with a simple approach based on temporal statistics here:

As you can see, we filter for values above the (temporal) median of each pixel in band B01 to mask clouds and for values in the 10% quantile of band B09 to mask shadows. After temporally interpolating masked pixels via…

… we get the following result:

Cloud- and shadow-masked Sentinel-2 RGB timelines of April/May 2021 and 2022 of AOI in Kabuchai/Chwele ward with gaps filled by temporal interpolation.

We now have a cloud- and shadow-free time series of sentinel images over our study area. As we are interested in the NDVI, we calculate it for each time step:

Comparing the NDVI for mid February of each year via…

… gives us the following result:

NDVI for mid February in 2020 (top), 2021 (middle) and 2022 (bottom).

Here we can see a clear decrease from 2020 over 2021 to 2022. By averaging over our whole AOI using xarray’s powerful statistical functionalities via…

… we can compare the temporal evolution of the NDVI in all three years:

Temporal evolution of average NDVI values in the AOI in West Kenya for 2020, 2021 and 2022.

Two obvious conclusions can be drawn from this graph:

  • NDVI values generally decreased from 2020 over 2021 to 2022, especially during February and March by up to 30%.
  • While NDVI values recover early in 2021 (beginning of March) there is a long delay in 2022 where values increase about one month later and catch up with the other years only around end of April.

Assessing drought impacts in East Kenya

According to the latest FEWS NET report, drought impacts are most severe in North and East Kenya. Let’s see how our analysis looks like when applied there. We can easily re-apply the procedure from above to our AOI in East Kenya by changing the bounding box coordinates that we pass over to the ODC:

These coordinates define the following area:

Blue box: AOI in Mutitu/Kaliku ward in Kitui, ~250km East of Nairobi.

Comparing the Sentinel-2 images of March 19th in 2020, 2021 and 2022 (we looked for low cloud cover in all three years) gives us the following image:

Sentinel-2 RGB images of March 19th 2020, 2021 and 2022 in the AOI in Mutitu/Kaliku ward.

This image clearly shows the severe consequences of the four season drought in East Kenya with — in contrast to 2020 — hardly any green vegetation visible in 2021 and 2022.

After executing the code from above to generate NDVI average timelines, we get the following result:

Temporal evolution of average NDVI values in the AOI in East Kenya for 2020, 2021 and 2022.

Again, we can identify two main characteristics:

  • NDVI values were high in 2020 throughout the whole period from January to May. In contrast, in 2021 and 2022 NDVI values decreased significantly in February and March.
  • Whereas the vegetation seems to be able to recover in April 2021, NDVI values stay on a low level in 2022 until end of May (which is the time when this article was written).

It remains to be seen if vegetation will recover this year or if the ongoing drought will lead to further pasture decline with the associated consequences of animal feed shortages.

Let us now look into the precipitation data of the CHIRPS product in East Kenya to see if we can identify a decrease in rain rates in the drought years of 2021 and 2022. For this, we only have to change the “measurements” and “resolution” field in our query and load the “rainfall_chirps_daily” product as follows. We also adapt the time window to span from 1990 to 2022 in order to be able to compare our rainfall rates to the 1990–2019 reference period:

After loading the CHIRPS product, we can now first plot an overview of the cumulative rain rates in our AOI:

This results in the following graph:

Cumulative rain rates in our AOI in East Kenya for the reference period from 1990–2019 (black/grey) and the years 2020, 2021 and 2022 in colour. At the time of writing this article, CHIRPS data was only available till March 2022 which is why the green line ends after day 90.

We can see, that in comparison to the reference period from 1990–2019 in the year 2020 we had significantly higher rain rates (blue line) but that in 2021 (orange) and 2022 (green) the rates strongly decreased so that we have below average cumulative rainfall in the whole period from January to May.

We can also easily combine our NDVI data from Sentinel-2 with the CHIRPS rainfall data and plot them together in one graph:

This results in:

NDVI (green lines) and rain rates (blue bars) in the AOI in East Kenya in 2020, 2021 and 2022. At the time of writing this article, CHIRPS data was only available till March 2022 which is why no blue bars appear after day 90 in the bottom plot.

This graph, again, shows that rainfall rates were significantly higher in 2020 than in 2021 and 2022. Additionally, we can see that rainfall generally intensified in March and that the onset of heavy rainfall in April 2021 likely caused the NDVI recovery in this year. As NDVI values did not increase in April 2022, we can assume that rain rates remained very low during this period. We will have to wait for the data delivery to confirm this assumption, however.

In summary, our analysis clearly shows that the effects of the current drought in Kenya can be well discerned and quantified in the satellite data of Sentinel-2 and the CHIRPS product and that its impacts are more severe in the East than in the West, which is consistent with the reports from FEWS NET.

About agriBORA

agriBORA is a Kenyan-German agri-Fin-Tech platform that has developed a B2B2C Software as a Service solution to empower local agribusinesses with digital tools and processes that can improve farm productivity and facilitate effective trading between them and farmers.
The agriBORA technology combines basic feature phone functionalities such as SMS, USSD and mobile payment solutions with advanced analytics based on Earth observation satellite data to monitor and assess crop development during the season. Visit the agriBORA website here at https://agribora.com/ to learn more about our work.

About the author

Dr. Sebastian Egli is the Chief Data Scientist at agriBORA. He analyzes remote sensing data for agricultural use cases in Eastern Africa and helps to integrate large satellite data sets into information services that support local farmer communities. Within this context, his work focuses primarily on drought monitoring, crop mapping and yield prediction applications.

--

--