Skip to contents

Function to set by reference the "Rfr.type" attribute of an existing reflector_spct or object_spct object, and function to query its current status.

Usage

setRfrType(x, Rfr.type = c("total", "specular"))

getRfrType(x)

Arguments

x

a reflector_spct or an object_spct object.

Rfr.type

character String, either "total" or "specular".

Value

x, with the modified attribute in the case of setRfrType() or the character value, "total" or "specular", stored in the "Rfr.type" attribute of x in the case of getRfrType(). If x is not a reflector_spct or an object_spct object, NA is returned.

Details

Reflectance can be measured by collecting the light reflected out of a surface in all directions, using an integrating sphere, obtaining a quantity called total reflectance. If instead, the reflected light is collected at a narrow angle mirroring the incident angle, only part of the reflected radiation is collected, corresponding to mirror-like reflection, called specular. Thus,

$$\rho = \rho_s + \rho_d$$

where, \(\rho\) is total reflectance, and its components, \(\rho_s\), specular reflectance, and \(\rho_d\), diffuse or scattered reflectance. When strong scattering takes place, total reflectance can be much more than the specular component. In most cases \(\rho_d\) is not measured directly.

The distinction depends on the measuring procedure, and this information is stored as metadata in an attribute of objects of classes reflector_spct or an object_spct.

When converting between internal and total transmittance, or computing absorptance by difference based on transmittance and reflectance, only total reflectance can be meaningfully used (if the object does not noticeably scatter light, it may be possible to assume that specular reflectance represents most of the total reflectance.) Consequently, checking the stored value of this attribute is used as a safeguard in these compuations.

This attribute is normally set when the source_spct object is created.

Note

Function setRfrType() alters x itself by reference and in addition returns x invisibly. If x is not a reflector_spct or an object_spct object, x is not modified. The behaviour of this function is 'unusual' in that the default for parameter Rfr.type is used only if x does not already have this attribute set.

See also

Examples

my.spct <- reflector_spct(w.length = 400:409, Rfr = 0.1)
getRfrType(my.spct)
#> [1] "total"
setRfrType(my.spct, "specular")
getRfrType(my.spct)
#> [1] "specular"