auto_cloud_fill: Automated removal of clouds from Landsat CDR imagery

Description Usage Arguments Details Value References

View source: R/auto_cloud_fill.R


Uses one of four cloud removal algorithms (see cloud_remove) to remove thick clouds from Landsat imagery. In hilly areas, topographic correction should be done before cloud fill.


auto_cloud_fill(data_dir, wrspath, wrsrow, start_date, end_date, out_name,
  base_date = NULL, tc = TRUE, ext = "tif", sensors = c("L4T", "L5T",
  "L7E", "L8C"), img_type = "CDR", threshold = 1, max_iter = 5,
  notify = print, verbose = 1, overwrite = FALSE, ...)



folder where input images are located, with filenames as output by the auto_preprocess_landsat function. This folder will be searched recursively for images (taking the below path/row, date, and topographic correction options into account).


World Reference System (WRS) path


World Reference System (WRS) row


start date of period from which images will be chosen to fill cloudy areas in the base image (as Date object)


end date of period from which images will be chosen to fill cloudy areas in the the base image (as Date object)


base filename (without an extension - see ext argument) for cloud filled image. The mask file for the cloud filled image will be saved with the same name, with the added suffix "_mask".


ideal date for base image (base image will be chosen as the image among the available images that is closest to this date). If NULL, then the base image will be the image with the lowest cloud cover.


if TRUE, use topographically corrected imagery as output by auto_preprocess_landsat. IF FALSE use bands 1-5 and 7 surface reflectance as output by unstack_ledaps or auto_preprocess_landsat (if auto_preprocess_landsat was also run with tc=FALSE).


file extension to use when searching for input rasters and when saving output rasters (determines output file format). Should match file extension of input rasters (and should most likely match the value chosen for ext when auto_preprocess_landsat was run).


choose the sensors to include when selecting images (useful for excluding images from a particular satellite if desired). Can be any of "L4T", "L5T", "L7E", and/or "L8C".


type of Landsat imagery to preprocess. Can be "CDR" for Landsat Climate Data Record (CDR) imagery in HDR format, or "L1T" for Standard Terrain Correction (Level 1T) imagery. Note that if L1T imagery is used, fmask must be run locally (see prior to using auto_preprocess_landsat.


maximum percent cloud cover allowable in base image. Cloud fill will iterate until percent cloud cover in base image is below this value, or until max_iter iterations have been run


maximum number of times to run cloud fill script


notifier to use (defaults to print function). See the notifyR package for one way of sending notifications from R. The notify function should accept a string as the only argument.


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.


whether to overwrite out_name if it already exists


additional arguments passed to cloud_remove, such as DN_min, DN_max, algorithm, byblock, verbose, etc. See cloud_remove for details


The auto_cloud_fill function allows an analyst to automatically construct a cloud-filled image after specifying: data_dir (a folder of Landsat images), wrspath and wrsrow (the WRS-2 path/row to use), and start_date and end_date (a start and end date limiting the images to use in the algorithm). The analyst can also optionally specify a base_date, and the auto_cloud_fill function will automatically pick the image closest to that date to use as the base image.

As the auto_cloud_fill function automatically chooses images for inclusion in the cloud fill process, it relies on having images stored on disk in a particular way, and currently only supports cloud fill for Landsat CDR surface reflectance images. To ensure that images are correctly stored on your hard disk, use the auto_preprocess_landsat function to extract the original Landsat CDR hdf files from the USGS archive. The auto_preprocess_landsat function will ensure that images are extracted and renamed properly so that they can be used with the auto_cloud_fill script.


a list with two elements: "filled", a Raster* object with cloud filled image, and "mask", a RasterLayer object with the cloud mask for the cloud filled image.


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. doi:10.1109/LGRS.2011.2173290

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