Author: Jose Gómez-Dans (NCEO & UCL) j.gomez-dans@ucl.ac.uk
%load_ext autoreload
%autoreload 2
import numpy as np
import datetime as dt
import matplotlib.pyplot as plt
import gdal
import pandas as pd
%matplotlib inline
from modis_funcs import *
/home/ucfajlg/.local/lib/python3.6/site-packages/tqdm/autonotebook/__init__.py:14: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console) " (e.g. in jupyter console)", TqdmExperimentalWarning)
The MODIS sensors have been acquiring data for the past two decades. The MODIS team has produced a large set of useful global land, atmosphere and ocean products, incluiding an LAI and fAPAR product. We have processed data over Ghana since 2002, and will now explore how the data looks like. We will be extracting area averaged estimates (in this case, we'll average over one of Ghana's 216 districts). We will also use a land cover product to select a particular land cover type (e.g. croplands, or forests). Our aim is to visualise and try to understand the dynamics of LAI over time.
We have downloaded and processed the MODIS MCD15A2H product, which provides LAI and $fAPAR$ every 8 days from the combined observations of the TERRA and AQUA satellites. The product has been mosaicked to cover the whole of Ghana, and is available remotely. We have also collated the MODIS MCD12Q1 product so you can select pixels that were classified as comin g from a particular land cover class.
The next cell gives you an easy GUI to extract the data. The data is extracted into a pandas dataframe, so you can easily save it to a CSV file for further playing around with it.
Be aware that running the data extraction GUI takes a bit! There's a lot of data to chomp through!!
Try selecting a particular district (e.g. Garu Tempane), and plotting
Both plots and data are saved in the main folder (you can download them to your local disk). Feel free to experiment with them.
w = select_region_modis_lai()
w
interactive(children=(Dropdown(description='district', index=193, options=('Jomoro', 'Ellembelle', 'Nzema East…
You can easily plot all your attempts in here. Double click on this cell, and add the following Markdown code to plot graphs:
![](./Garu%20Tempane_Croplands_fAPAR.png)
In the absence of any information, we may think about ways of interpreting LAI and/or fAPAR. If we think of these two parameters are indicating the amount of leaves in the canopy, we can probably guess that a year where we have "fewer" leaves is a bad year, and one where we have "lots of leaves" is a good year. With this data, we can define a climatology and maybe look at some form of anomaly (e.g. a $z$ score). But we have data every (say) 8 days: what period do we choose? Obviously, we need to know when crops are likely to be in the ground. We could actually use the LAI to figure things out, but the data appears quite noisy. Let's just see whether we can see any differences by selecting the dates ourselves.
The next bit of code allows you to play around with the timing and plots the cummulative LAI as a function of day of year for the years you have extracted.
df = w.result
# or
# df = pd.read_csv("./Garu Tempane_Croplands_LAI.csv")
cummulative_lai_plots(df);
interactive(children=(SelectionRangeSlider(description='Sowing & Harvest', index=(0, 364), layout=Layout(width…
The examples above extract a great deal of data and visualise it, allowing you to maybe guess what's happening between different years. However, it is worth thinking about the following issues:
Based on your own experience, you may have an expectation of things like the amount of leaves in a crop to change slowly in a scale of days. Is this something you see in the plots above? (hint: No!!!! They're really noisy!)
Think about what may be causing this. Remember the processing we've done:
Think about the pixel size (~500 m nominally, but often close to 1.5km), and how the landscape looks like. Also think what e.g. "Croplands" means, and how different crops might behave.
Directed link the previous point. What if we are interested in monitoring maize, or sorghum, or cowpea? In general, different crops have different calendars, with different sowing, development and harvesting dates. What would we need to make an impact on this aspect?
Small holder farms in Ghana also have tree crops (e.g. cocoa) in the middle of the fields. Will this affect our understanding of the LAI/fAPAR signal? How does the average size of the field with respect to the resolution cell affect things?
Clearly, the spatial resolution of MODIS might be an issue for monitoring small farms in Ghana. The very frequent overpasses (~twice a day) result in large pixels that blur the individual responses of different crops/fields. But we have higher spatial resolution sensors, albeit with a less frequent overpass, such as Sentinel 2.
The following notebook visualises some Sentinel 2 over the area around Tamale:
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.