Skip to contents

general_mask takes one or multiple input rasters and applies pre-generated mask/s to exclude areas or clean up rasters.

Usage

general_mask(irast, imask, ext = ".tif", mval = 0)

Arguments

irast

Character file path to directory veg density input rasters.

imask

Character file path to directory of raster masks to apply.

ext

Character representation of the file extension of the input rasters. Defaults to ".tif" as this is the preferred file type.

mval

Numeric indicating the value to mask, e.g. a 0 indicates to mask out this value occurs in the mask.

Value

For each input raster a masked product will be written to file in a folder named `veg_dens_mskd/`. Masked values will now be NA.

Details

When producing raster products for an area there are often regions that occur at every time step that are not required for further analysis. Things like water bodies or non-target vegetation are examples. A folder full of different raster masks can be applied with this function. This function will apply all masks to all data time steps.

Masks are a raster indicating spatially where values of interest are. Masks must contain only 1's and 0 values. A value of 1 indicates the areas of interest. A land mask to exclude vegetation inland of the mangroves would contain a 0 for this vegetation and a 1 for the mangroves and everything else.

Author

Bart Huntley, bart.huntley@dbca.wa.gov.au

Examples

if (FALSE) { # \dontrun{
general_mask(irast = "veg_dens", imask = "raster_masks")
} # }