User Tools

Site Tools


wiki:exercise6

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:exercise6 [2017/12/05 22:53] (current)
Line 1: Line 1:
 +====== Exercise 6: Create the cloud mask ======
 +In this exercise, the following tools will be used:
 +  * pktools: pkgetmask, pkfilter, pkreclass, pkdsm2shadow
 +  * bash: cat, redirect
 +
 +__Create a directory for this exercise__
 +
 +<code bash>
 +mkdir -p ${OUTPUTDIR}/​exercise6
 +</​code>​
 +
 +__Create a colour table__
 +<code bash>
 +cat > ${OUTPUTDIR}/​exercise6/​cloudmask_ct.txt <<EOF
 +0 0 0 0 255
 +1 255 255 255 255
 +EOF
 +</​code>​
 +
 +__Create the cloud mask using the thresholds found in exercise 5a__
 +<code bash>
 +pkgetmask -i ${LANDSATDIR}/​${LANDSATIMG} -ot Byte -b 0 -min 0 -max 150 -b 3 -min 0 -max 150 -b 6 -min 140 -max 256 -o ${OUTPUTDIR}/​exercise6/​cloudmask.tif -data 0 -nodata 1 -ct ${OUTPUTDIR}/​exercise6/​cloudmask_ct.txt
 +</​code>​
 +
 +__Dilate cloud mask with circular kernel of size 5x5__
 +<code bash>
 +pkfilter -i ${OUTPUTDIR}/​exercise6/​cloudmask.tif -o ${OUTPUTDIR}/​exercise6/​cloudmask_dil.tif -f dilate -dx 5 -dy 5 -c
 +</​code>​
 +
 +<note tip>
 +If slow computer, perform the morphological filter on subimage using pkcrop
 +\\
 +ULX=3217600\\
 +ULY=3127850\\
 +LRX=3225650\\
 +LRY=3119900\\
 +pkcrop -i ${OUTPUTDIR}/​exercise6/​cloudmask.tif -o ${OUTPUTDIR}/​exercise6/​cloudmask_crop.tif -ulx $ULX -uly $ULY -lrx $LRX -lry $LRY
 +</​note>​
 +
 +__Create cloud shadow mask, treating the cloud mask as a digital surface model__
 +
 +__Cloud heights should be introduced by setting the cloud flag to the potential cloud height__
 +<code bash>
 +pkreclass -i ${OUTPUTDIR}/​exercise6/​cloudmask_dil.tif -o ${OUTPUTDIR}/​exercise6/​clouddsm.tif -c 1 -r 1800 -ot UInt16
 +</​code>​
 +
 +__Create cloud shadow mask based on cloud height__
 +<code bash>
 +pkdsm2shadow -i ${OUTPUTDIR}/​exercise6/​clouddsm.tif -o ${OUTPUTDIR}/​exercise6/​shadowmask.tif -sza 20 -saa 155 -f 1 -ct ${OUTPUTDIR}/​exercise6/​cloudmask_ct.txt
 +</​code>​
 +
 +
 +<note tip>
 +Try different cloud heights, Sun zenith angles and Sun azimuth angles
 +</​note>​
  
wiki/exercise6.txt ยท Last modified: 2017/12/05 22:53 (external edit)