Learn R Programming

uFTIR (version 0.1.4)

clipper: Clipper

Description

A function to clip a SAM or Smooth object object (also a matrix, but I recommed this only for debugging). ALthough you can use this function in a 'step by step' process it is otherwise directly called by summary_sam which uses a clipmask object (returned by toClip as a clipping mask.

Usage

clipper(tarjet, centre = c(128, 128), rad = 120, slice = 1)

Arguments

tarjet

object of class SAM or Smooth (or matrix) to clip.

centre

The coordinates of the polygon centre (x,y).

rad

The circle radius.

slice

which slice of the SAM or Smooth object should be clipped? (only one!)

Value

The tarjet object clipped as matrix (and S3 clipper -not for human consumption).

See Also

toClip codeclipmask summary_sam.

Examples

Run this code
# NOT RUN {
x <- tile_read(base::system.file("extdata/tile.bsp", package = "uFTIR"))
x <- tile_base_corr(x)
x <- wavealign(x, primpke)
x <- tile_sam(x)
x <- smooth_sam(x, as.integer(length(primpke@clusternames)), window = 3, 1)

clip <- toClip(8,20,c(10,10))
plot(x)
polygon(clip@xycoords)

x <- clipper(x, clip@centre, clip@rad, 1)

# }

Run the code above in your browser using DataLab