cloud_remove: Remove clouds From Landsat imagery

Description Usage Arguments Details Value References Examples

View source: R/cloud_remove.R

Description

This code uses one of several different algorithms (depending on the settings, see Details) to fill heavy clouds in a Landsat image.

Usage

1
2
3
4
5
cloud_remove(cloudy, clear, cloud_mask, out_name = NULL,
  algorithm = "simple", num_class = 4, min_pixel = 20, max_pixel = 1000,
  cloud_nbh = 10, DN_min = 0, DN_max = 10000,
  idl = "C:/Program Files/Exelis/IDL83/bin/bin.x86_64/idl.exe",
  verbose = FALSE, byblock = TRUE, overwrite = FALSE, ...)

Arguments

cloudy

the cloudy image (base image) as a Raster*

clear

the clear image as a Raster* to use for filling img_cloudy

cloud_mask

the cloud mask as a RasterLayer, with each cloud patch assigned a unique integer code. Areas that are clear in both cloudy_rast and clear_rast should be coded 0, while areas that are clouded in clear_rast should be coded -1.

out_name

filename for cloud filled image

algorithm

must be one of: "CLOUD_REMOVE", "CLOUD_REMOVE_FAST", "teamlucc", or "simple". Default is "simple". See Details.

num_class

set the estimated number of classes in image

min_pixel

the sample size of similar pixels (ignored when algorithm==TRUE)

max_pixel

the maximum sample size to search for similar pixels (ignored when algorithm==TRUE)

cloud_nbh

the range of cloud neighborhood (in pixels)

DN_min

the minimum valid DN value (default of 0)

DN_max

the maximum valid DN value (default of 10000 assumes 2 byte integer imagery)

idl

path to the IDL binary on your machine (on Windows, the path to idl.exe)

verbose

whether to print detailed status messages. Set to FALSE or 0 for no status messages. Set to 1 for basic status messages. Set to 2 for detailed status messages.

byblock

whether to process images block by block (byblock=TRUE) or all at once (byblock=FALSE). Use byblock=FALSE with caution, as this option will cause the cloud fill routine to consume a large amount of memory.

overwrite

whether to overwrite out_name if it already exists

...

additional arguments passed to the chosen cloud fill routine

Details

The algorithm parameter determines what algorithm is used for the cloud fill. algorithm must be one of: "CLOUD_REMOVE", "CLOUD_REMOVE_FAST", "teamlucc", or "simple" (the default). If set to "CLOUD_REMOVE" the script uses a (slightly modified to be called from R) version of Xiaolin Zhu's NSPI IDL code. If set to "CLOUD_REMOVE_FAST", the algorithm uses the "fast" version of Xiaolin's code. Both of these two algorithms require an IDL license to run (and therefore idl_path must be set). The "teamlucc" algorithm uses a version of the NSPI algorithm (based on the CLOUD_REMOVE code) that is coded in C++ and can be run from R without an IDL license. The "simple" algorithm uses a cloud fill model that is based on fitting a linear model to the surface reflectance from the clear image in a window around each cloud, and using this linear model to predict reflectance in unobserved (cloudy) areas.

Value

Raster* with cloud-filled image

References

Zhu, X., Gao, F., Liu, D., Chen, J., 2012. A modified neighborhood similar pixel interpolator approach for removing thick clouds in Landsat images. Geoscience and Remote Sensing Letters, IEEE 9, 521–525.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
cloudy <- raster(system.file('tests', 'testthat_idl', 'cloud_remove', 
'L20080724_cloudy', package='teamlucc'))
clear <- raster(system.file('tests', 'testthat_idl', 'cloud_remove', 
'L20080606', package='teamlucc'))
cloud_mask <- raster(system.file('tests', 'testthat_idl', 'cloud_remove', 
'cloud_mask', package='teamlucc'))
filled <- cloud_remove(cloudy, clear, cloud_mask, fast=TRUE)

## End(Not run)

azvoleff/teamlucc documentation built on June 4, 2017, 12:08 a.m.