getNormalized: Query the "normalized" and "normalization" attributes

View source: R/spct.normalize.r

getNormalizedR Documentation

Query the "normalized" and "normalization" attributes

Description

Functions to read the "normalized" and "normalization" attributes of an existing generic_spct object.

Usage

getNormalized(x, .force.numeric = FALSE)

getNormalised(x, .force.numeric = FALSE)

getNormalization(x)

getNormalisation(x)

Arguments

x

a generic_spct object.

.force.numeric

logical If TRUE always silently return a numeric value, with FALSE encoded as zero, and character values as NA.

Details

Spectral data that has been normalized needs to be used diffferently in computations than data expresed in original units. These two functions make it possible to query if data stored in an object of class generic_spct or of a derived class contains data expressed in physical units or normalized. In the later case, it is possible to also query how the normalization was done.

Value

getNormalized() returns numeric or logical (possibly character for objects created with earlier versions). If x is not a generic_spct object, NA or a list with fields set to NAs is returned. Objects created with versions of package 'photobiology' earlier than 0.10.8 are lacking the normalization metadata.

getNormalization() returns a list with five fields: norm.type, norm.wl, norm.factors, norm.cols, norm.range. See setNormalized() for the values stored in the fields.

Note

getNormalised() is a synonym for this getNormalized() method.

See Also

Other rescaling functions: fscale(), fshift(), getScaled(), is_normalized(), is_scaled(), normalize(), setNormalized(), setScaled()

Examples


getNormalized(sun.spct)
getNormalization(sun.spct)

sun_norm.spct <- normalize(sun.spct)

getNormalized(sun_norm.spct)
getNormalization(sun_norm.spct)

getNormalization(e2q(sun_norm.spct))

gel_norm.spct <- normalize(yellow_gel.spct)

getNormalized(gel_norm.spct)
getNormalization(gel_norm.spct)

getNormalization(T2Afr(gel_norm.spct))
getNormalization(any2A(gel_norm.spct))


photobiology documentation built on Oct. 21, 2023, 1:06 a.m.