mask_s: Mask of saturated pixels

View source: R/mask_saturation.R

mask_sR Documentation

Mask of saturated pixels

Description

This function creates a raster mask for saturated pixels based on the raw digital counts hyperspectral cube.

Usage

mask_s(file, wave, wrange, bits = 12, layers = FALSE, rotate = TRUE)

Arguments

file

Path to raw (digital counts) ENVI hyperspectral cube.

wave

Optional specific wavelengths to be used in the saturation mask. It must be provided in the same units as the data reference. Default is to use all bands.

wrange

Alternative selection of wavelnegths to be used if wave is not provided. It must be provided in the same units as the data reference. Default is to use all bands.

bits

The number of bits of data acquisition. Default is 12 bits from the SOC-710 model.

layers

Logical. Should a single raster be returned or a mask be created per layer (stack)?

rotate

Logical. SOC imagery in raw and radiance have different orientations. Default is set to TRUE to rotate the mask to the same orientation of the calibrated cube.

Details

The function will set the maximum integer possible for the number of bits in the data to NA. If layers is set to FALSE (default) it will provide a single raster layer mask where a pixel is set to NA if it is saturated at any bands in wave or wrange. Note that for the function to perform as intended, it is necessary to provide the raw (uncalibrated) hyperspectral cube.

The wavelengths in wave do not have to be exact, the bands with the closet nominal wavelength will be returned.

Value

A raster layer or raster stack object with saturated pixels set to NA and non-saturated pixels set to 1.


AlexCast/surfspec documentation built on July 7, 2022, 9:35 a.m.