User Tools

Site Tools


wiki:exercise4b

Exercise 4b: Long time series for user defined pixels

In this exercise the following tools will be used:

  • pktools: pkndvi, pkinfo
  • bash: for loop, redirect.

Create colour table for NDVI image (or use an existing one)

pkcreatect -min 0 -max 100 > ${OUTPUTDIR}/exercise4/ct_ndvi.txt

Create NDVI long time series based on MODIS at 500 m (2006-2010)

for YEAR in 2006 2007 2008 2009 2010;do
    for MONTH in 01 02 03 04 05 06 07 08 09 10 11 12;do
	pkndvi -min 0 -max 100 -dst_s 100 -ot Byte -b 0 -b 1 -i ${MODIS500DIR}/${YEAR}${MONTH}-MODIS500_CW.tif -o ${OUTPUTDIR}/exercise4/${YEAR}${MONTH}-MODIS500_CW_NDVI.tif
    done
done

Extract NDVI long time series from MODIS at 500 m (2006-2010)

cat ${OUTPUTDIR}/exercise4/points.txt |while read LC X Y;do
    echo "create a time series of this NDVI over $LC"
    for YEAR in 2006 2007 2008 2009 2010;do
	for MONTH in 01 02 03 04 05 06 07 08 09 10 11 12;do
	    NDVIIMG=${OUTPUTDIR}/exercise4/${YEAR}${MONTH}-MODIS500_CW_NDVI.tif
	    pkinfo -i $NDVIIMG -x $X -y $Y -geo -r
	done
    done > ${OUTPUTDIR}/exercise4/${LC}_modis500_ndvi.txt
done

Plot the profiles in gnuplot (click here for thecode)

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