User Tools

Site Tools


wiki:exercise3b

Exercise 3b: Study phenology from MODIS NDVI time series (forest vector)

In this exercise the following tools will be used:

  • pktools: pkextract, pkstatogr
  • bash: for loop, redirection (> and »)
  • gdal/ogr tools: ogr2ogr

If not performed yet in Exercise 2b: Phenology of forest and golf course

Extract golf courses from points of interests in Cornwall and reproject to EPSG:3035 (ETRS89/LAEA)

ogr2ogr -t_srs epsg:3035 -where 'NAME like "Golf course:%"' ${OUTPUTDIR}/exercise2/cornwall_golf_3035.shp ${VECTORDIR}/cornwall_poi.shp

Remove old output

rm -f ${OUTPUTDIR}/exercise3/golf_ndvi_mean_stdev.txt

Extract NDVI time series from golf in Cornwall (mean value for each polygon)

make sure to set OUTPUTDIR and vector file is available
for MONTH in 01 02 03 04 05 06 07 08 09 10 11 12;do
    MODIS250IMG=2006${MONTH}-A_MOT_CX-MED16_3500035000-AA.tif
    rm -f ${OUTPUTDIR}/exercise3/golf_modis_${MONTH}.shp
    echo "extract NDVI for month $MONTH"
    pkextract -i ${OUTPUTDIR}/exercise3/2006${MONTH}-MODIS250_CW_NDVI.tif -s ${OUTPUTDIR}/exercise3/cornwall_golf_3035.shp -m ${OUTPUTDIR}/exercise3/2006${MONTH}-MODIS250_CW_MASK.tif -msknodata 0 -o ${OUTPUTDIR}/exercise3/golf_modis_${MONTH}.shp -bn NDVI --ftype Integer
    echo "calculate statistics using pkstatogr"
    pkstatogr -i ${OUTPUTDIR}/exercise3/golf_modis_${MONTH}.shp -n NDVI -mean -stdev| awk '{print $4,$6}' >> ${OUTPUTDIR}/exercise3/golf_ndvi_mean_stdev.txt
done


Plot the profiles in gnuplot (click here for the code).

Try different smoothing functions in gnuplot (click here for the code).

wiki/exercise3b.txt · Last modified: 2017/12/05 22:53 (external edit)