Learn R Programming

photobiology (version 0.11.4)

thin_wl: Thin the density of wavelength values

Description

Increase the wavelength step in stored spectral data in featureless regions to save storage space.

Usage

thin_wl(x, ...)

# S3 method for default thin_wl(x, ...)

# S3 method for generic_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, col.names, ... )

# S3 method for source_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, unit.out = getOption("photobiology.radiation.unit", default = "energy"), ... )

# S3 method for response_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, unit.out = getOption("photobiology.radiation.unit", default = "energy"), ... )

# S3 method for filter_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, qty.out = getOption("photobiology.filter.qty", default = "transmittance"), ... )

# S3 method for reflector_spct thin_wl(x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, ...)

# S3 method for solute_spct thin_wl(x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, ...)

# S3 method for raw_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, col.names, ... )

# S3 method for cps_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, col.names, ... )

# S3 method for object_spct thin_wl( x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, col.names, ... )

# S3 method for chroma_spct thin_wl(x, ...)

# S3 method for calibration_spct thin_wl(x, ...)

# S3 method for generic_mspct thin_wl(x, max.wl.step = 10, max.slope.delta = 0.001, span = 21, ...)

# S3 method for chroma_mspct thin_wl(x, ...)

# S3 method for calibration_mspct thin_wl(x, ...)

Value

An object of the same class as x but with a reduced density of wavelength values in those regions were slope is shallow and featureless.

Arguments

x

An R object

...

additional named arguments passed down to f.

max.wl.step

numeric. Largest allowed wavelength difference between adjacent spectral values in nanometres (nm).

max.slope.delta

numeric in 0 to 1. Largest allowed change in relative slope of the spectral quantity per nm between adjacent pairs of values.

span

integer A peak (or valley) is defined as an element in a sequence which is greater (or smaller) than all other elements within a window of width span centred at that element. Use NULL for the global peak.

col.names

character. Name of the column of x containing the spectral data to check against max.slope.delta. Currently only one column supported.

unit.out

character Allowed values "energy", and "photon", or its alias "quantum".

qty.out

character Allowed values "transmittance", and "absorbance".

Methods (by class)

  • thin_wl(default): Default for generic function

  • thin_wl(generic_spct):

  • thin_wl(source_spct):

  • thin_wl(response_spct):

  • thin_wl(filter_spct):

  • thin_wl(reflector_spct):

  • thin_wl(solute_spct):

  • thin_wl(raw_spct):

  • thin_wl(cps_spct):

  • thin_wl(object_spct):

  • thin_wl(chroma_spct):

  • thin_wl(calibration_spct):

  • thin_wl(generic_mspct):

  • thin_wl(chroma_mspct):

  • thin_wl(calibration_mspct):

Details

The algorithm used for spectra is "naive" in an effort to keep it efficient. It works by iteratively attempting to delete every other observation along wavelengths, based on the criteria for maximum wavelength step and maximum relative step in the spectral variable between adjacent data values.

See Also

Other experimental utility functions: collect2mspct(), drop_user_cols(), uncollect2spct()

Examples

Run this code

nrow(yellow_gel.spct)
wl_stepsize(yellow_gel.spct)
thinned.spct <- thin_wl(yellow_gel.spct)
nrow(thinned.spct)
wl_stepsize(thinned.spct)

Run the code above in your browser using DataLab