auto_preprocess_landsat: Preprocess surface reflectance imagery from the Landsat CDR...

Description Usage Arguments Details Value See Also

View source: R/auto_preprocess_landsat.R


This function preprocesses surface reflectance imagery from the Landsat Climate Data Record (CDR) archive. auto_preprocess_landsat can reproject CDR tiles to match the projection of a given aoi, crop the tiles to match the aoi or a common WRS-2 path/row polygon, mask missing data and clouds out of the CDR tiles, and perform topographic correction.


auto_preprocess_landsat(image_dirs, prefix, tc = FALSE, dem_path = NULL,
  aoi = NULL, output_path = NULL, mask_type = "fmask",
  mask_output = FALSE, n_cpus = 1, cleartmp = FALSE, overwrite = FALSE,
  of = "GTiff", ext = "tif", notify = print, verbose = FALSE)



list of paths to a set of Landsat CDR image files as downloaded from ESPA and extracted by espa_extract


string to use as a prefix for all filenames


whether to topographically correct imagery (if TRUE, then dem_path must be specified)


path to a set of DEMs as output by auto_setup_dem (only required if tc=TRUE)


area of interest (AOI), as a SpatialPolygonsDataFrame. If supplied, this aoi is used to crop and set the projection system of the output. Must be in a projected coordinate system.


the path to use for the output (optional - if NULL then output images will be saved alongside the input images in the same folder).


which cloud mask to use to mask clouds when performing topographic correction. Can be one of "fmask", "6S", or "both". See Details. (Ignored if tc=FALSE).


if TRUE, cloud, cloud shadow, and fill areas (SLC-off gaps and areas with no data) will be set to NA in the output. Note this setting affects the final output file only - cloud, cloud shadow, and gap areas are masked out of the image during topographic correction regardless of the value of mask_output.


the number of CPUs to use for processes that can run in parallel


whether to clear temp files on each run through the loop


whether to overwrite existing files (otherwise an error will be raised)


output format to use when saving output rasters. See description of of in gdalwarp.


file extension to use when saving output rasters (determines output file format). Should match file extension for output format chosen by of.


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 and timing information


mask_type chooses the cloud mask to use if topographic correction is performed (tc=TRUE). The mask can be one of three different options: "6S", "fmask", or "combined". Each option uses a different combination of cloud mask layers from the CDR product. The "6S" masks out any areas coded as fill (fill_QA=255), cloud (cloud_QA=255), cloud shadow (cloud_shadow_QA=255) or adjacent to cloud (adjacent_cloud_QA=255). The "fmask" option masks out any areas coded as fill (fmask=255), cloud (fmask=4) or cloud shadow (fmask=2). The combined option combines the "6S" and "fmask" approaches to masks out areas coded as fill, cloud, cloud shadow, or adjacent to cloud using either method. Note that "fmask" is the only supported option when file_format is L1T. Further, if L1T imagery is used, fmask must be run locally (see prior to using auto_preprocess_landsat.

Prior to running auto_preprocess_landsat, espa_extract should be used to extract the original zipfiles supplied by USGS. To perform topographic correction with auto_preprocess_landsat, first run auto_setup_dem to preprocess a set of DEM tiles. Then run auto_preprocess_landsat with the tc=TRUE option.

This function will run in parallel if a parallel backend is registered with foreach.


nothing - used for the side effect of preprocessing imagery

See Also

espa_extract, unstack_ledapscdr, auto_setup_dem

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