Learn R Programming

ASIP (version 0.4.9)

custom.eqn: Make your own custom satellite image product

Description

If any product or index is not available in this package, you don't need to do it manually. This function intakes a custom formula & produced new product according to the formula. This function converts DN bands to corresponding TOA reflectance prior to the computation of user defined formula.

Usage

custom.eqn(directory = getwd(), cus.formula = "none", crop = "n",
  ext2crop = "none")

Arguments

cus.formula

Assign custom formula to be computed AS TEXT input (inside double quotes). To assign bands, ONLY USE BELOW DEFINED WORDS to indicate different bands in the formula.

nir for NIR (Near Infra-red) Top Of Atmosphere (TOA) reflectance band.

red for Red TOA reflectance band.

green for Green TOA reflectance band.

blue for Blue TOA reflectance band.

swir1 for SWIR-1 (Short Wave Infra-red -1)

swir2 for SWIR-2 (Short Wave Infra-red -2)

aero for Aerosol/coastal band (Only on Landsat OLI images)

ext2crop, crop, directory

Same as mentioned in arvi.

Value

Computed custom equation based product.

References

Epema G F (1992) Atmospheric condition and its influence on reflectance of bare soil surfaces in southern Tunisia. International Journal of Remote Sensing, 13(5), pp:853-868. doi:10.1080/01431169208904159.

Examples

Run this code
# NOT RUN {
library (raster)
library (rgdal)
# Finding the path of the sample satellite image directory.
# User may define paths directly like "/home/ur_folder" or "C:/ur_folder"
path <- system.file ("TM_sample", package = "ASIP")
# Input equation should be as text (inside double quotes)
eqn <- "(2 * red) + (nir/blue)"
shapefil <- paste0 (path, "/test.shp")
op <- custom.eqn (directory = path, cus.formula = eqn, crop = "y", ext2crop = shapefil)
# }

Run the code above in your browser using DataLab