Package overview

photobiology-package

photobiology: Photobiological Calculations

Spectra

source_spct() calibration_spct() raw_spct() cps_spct() generic_spct() response_spct() filter_spct() reflector_spct() object_spct() chroma_spct()

Spectral-object constructor

is.generic_spct() is.raw_spct() is.calibration_spct() is.cps_spct() is.source_spct() is.response_spct() is.filter_spct() is.reflector_spct() is.object_spct() is.chroma_spct() is.any_spct()

Query class of spectrum objects

as.generic_spct() as.calibration_spct(<default>) as.raw_spct(<default>) as.chroma_spct(<default>)

Coerce to a spectrum

as.calibration_spct()

Coerce to a spectrum

as.raw_spct()

Coerce to a spectrum

as.cps_spct()

Coerce to a spectrum

as.source_spct()

Coerce to a spectrum

as.response_spct()

Coerce to a spectrum

as.filter_spct()

Coerce to a spectrum

as.reflector_spct()

Coerce to a spectrum

as.object_spct()

Coerce to a spectrum

as.chroma_spct()

Coerce to a spectrum

setGenericSpct() setCalibrationSpct() setRawSpct() setCpsSpct() setFilterSpct() setReflectorSpct() setObjectSpct() setResponseSpct() setSourceSpct() setChromaSpct()

Convert an R object into a spectrum object.

generic_mspct() calibration_mspct() raw_mspct() cps_mspct() source_mspct() filter_mspct() reflector_mspct() object_mspct() response_mspct() chroma_mspct()

Collection-of-spectra constructor

class_spct()

Query which is the class of an spectrum

spct_classes()

Function that returns a vector containing the names of spectra classes.

rmDerivedSpct()

Remove "generic_spct" and derived class attributes.

Collections of spectra

generic_mspct() calibration_mspct() raw_mspct() cps_mspct() source_mspct() filter_mspct() reflector_mspct() object_mspct() response_mspct() chroma_mspct()

Collection-of-spectra constructor

is.generic_mspct() is.calibration_mspct() is.raw_mspct() is.cps_mspct() is.source_mspct() is.response_mspct() is.filter_mspct() is.reflector_mspct() is.object_mspct() is.chroma_mspct() is.any_mspct()

Query class of spectrum objects

as.generic_mspct() mat2mspct()

Coerce to a collection-of-spectra

as.calibration_mspct()

Coerce to a collection-of-spectra

as.raw_mspct()

Coerce to a collection-of-spectra

as.cps_mspct()

Coerce to a collection-of-spectra

as.source_mspct()

Coerce to a collection-of-spectra

as.response_mspct()

Coerce to a collection-of-spectra

as.filter_mspct()

Coerce to a collection-of-spectra

as.reflector_mspct()

Coerce to a collection-of-spectra

as.object_mspct()

Coerce to a collection-of-spectra

as.chroma_mspct()

Coerce to a collection-of-spectra

as.matrix(<generic_mspct>) mspct2mat()

Coerce a collection of spectra into a matrix

setGenericSpct() setCalibrationSpct() setRawSpct() setCpsSpct() setFilterSpct() setReflectorSpct() setObjectSpct() setResponseSpct() setSourceSpct() setChromaSpct()

Convert an R object into a spectrum object.

mspct_classes()

Names of multi-spectra classes

rmDerivedMspct()

Remove "generic_mspct" and derived class attributes.

shared_member_class()

Classes common to all collection members.

Summaries from spectra

summary(<generic_spct>)

Summary of a spectral object

is.summary_generic_spct() is.summary_raw_spct() is.summary_cps_spct() is.summary_source_spct() is.summary_response_spct() is.summary_filter_spct() is.summary_reflector_spct() is.summary_object_spct() is.summary_chroma_spct() is.any_summary_spct()

Query class of spectrum summary objects

print(<generic_spct>) print(<generic_mspct>)

Print a spectral object

print(<summary_generic_spct>)

Print spectral summary

head_tail

Return the First and Last Part of an Object

summary_spct_classes()

Function that returns a vector containing the names of spectral summary classes.

Summary spectra from collections of spectra

s_sum()

Sum from collection of spectra

s_prod()

Product from collection of spectra

s_mean()

Mean from collection of spectra

s_median()

Median of a collection of spectra

s_range()

Range of a collection of spectra

s_var()

Variance of a collection of spectra

s_sd()

Standard Deviation of a collection of spectra

s_se()

Standard Error of a collection of spectra

s_mean_se()

Mean and standard error from collection of spectra

Wavebands

waveband() new_waveband()

Waveband constructor method

is.waveband()

Query if it is a waveband

split_bands()

List-of-wavebands constructor

wb2spct()

Create spectrum from wavebands

wb2rect_spct()

Create tagged spectrum from wavebands

wb2tagged_spct()

Create tagged spectrum from wavebands

print(<waveband>)

Print a "waveband" object

Metadata attributes

is_photon_based() is_energy_based()

Query if a spectrum contains photon- or energy-based data.

getBSWFUsed()

Get the "bswf.used" attribute

setBSWFUsed()

Set the "bswf.used" attribute

is_effective()

Is an R object "effective"

getInstrDesc()

Get the "instr.desc" attribute

setInstrDesc()

Set the "instr.desc" attribute

trimInstrDesc()

Trim the "instr.desc" attribute

isValidInstrDesc()

Check the "instr.desc" attribute

getInstrSettings()

Get the "instr.settings" attribute

setInstrSettings()

Set the "instr.settings" attribute

trimInstrSettings()

Trim the "instr.settings" attribute

isValidInstrSettings()

Check the "instr.settings" attribute

getMultipleWl()

Get the "multiple.wl" attribute

setMultipleWl()

Set the "multiple.wl" attribute

getNormalized()

Get the "normalized" attribute

setNormalized()

Set the "normalized" attribute

is_normalized()

Query whether a generic spectrum has been normalized.

getRfrType()

Get the "Rfr.type" attribute

setRfrType()

Set the "Rfr.type" attribute

getScaled()

Get the "scaled" attribute

setScaled()

Set the "scaled" attribute

is_scaled()

Query whether a generic spectrum has been scaled

getTfrType()

Get the "Tfr.type" attribute

setTfrType()

Set the "Tfr.type" attribute

getAfrType()

Get the "Afr.type" attribute

setAfrType()

Set the "Afr.type" attribute

is_absorbance_based() is_transmittance_based()

Query if a spectrum contains absorbance or transmittance data

getTimeUnit()

Get the "time.unit" attribute of an existing source_spct object

setTimeUnit()

Set the "time.unit" attribute of an existing source_spct object

getWhatMeasured()

Get the "what.measured" attribute

setWhatMeasured()

Set the "what.measured" attribute

getWhenMeasured()

Get the "when.measured" attribute

setWhenMeasured()

Set the "when.measured" attribute

getWhereMeasured()

Get the "where.measured" attribute

setWhereMeasured()

Set the "where.measured" attribute

getHowMeasured()

Get the "how.measured" attribute

setHowMeasured()

Set the "how.measured" attribute

getIdFactor()

Get the "idfactor" attribute

setIdFactor()

Set the "idfactor" attribute

is_tagged()

Query if it is an spectrum is tagged

dim(<generic_mspct>) `dim<-`(<generic_mspct>)

Dimensions of an Object

labels(<waveband>) labels(<generic_spct>)

Find labels from "waveband" object

add_attr2tb() when_measured2tb() lonlat2tb() lon2tb() lat2tb() geocode2tb() what_measured2tb()

Copy attributes from members of a generic_mspct

copy_attributes()

Copy attributes

Summary quantities

irrad()

Irradiance

e_irrad()

Energy irradiance

q_irrad()

Photon irradiance

fluence()

Fluence

e_fluence()

Energy fluence

q_fluence()

Photon fluence

response()

Integrated response

e_response()

Energy-based photo-response

q_response()

Photon-based photo-response

absorbance()

Absorbance

absorptance()

Absorptance

transmittance()

Transmittance

reflectance()

Reflectance

average_spct()

Average spectral data.

integrate_spct()

Integrate spectral data.

color_of() colour_of() color()

Color of an object

rgb_spct()

RGB color values

e_ratio()

Energy:energy ratio

q_ratio()

Photon:photon ratio

eq_ratio()

Energy:photon ratio

qe_ratio()

Photon:energy ratio

normalized_diff_ind()

Calculate a normalized index.

wl_min() min(<waveband>) min(<generic_spct>) min(<generic_mspct>)

Wavelength minimum

wl_max() max(<waveband>) max(<generic_spct>) max(<generic_mspct>)

Wavelength maximum

wl_range() range(<waveband>) range(<generic_spct>) range(<generic_mspct>)

Wavelength range

spread() wl_expanse() expanse()

Expanse

wl_midpoint() midpoint()

Midpoint

wl_stepsize() stepsize()

Stepsize

Spectral features

peaks()

Peaks or local maxima

valleys()

Valleys or local minima

wls_at_target()

Find wavelengths values corresponding to a target spectral value

Transformations

normalize()

Normalize spectral data

normalization()

Normalization of an R object

fscale() fshift(<default>)

Rescale a spectrum using a summary function

fshift()

Shift the scale of a spectrum using a summary function

clean()

Clean (=replace) off-range values in a spectrum

insert_hinges()

Insert wavelength values into spectral data.

interpolate_wl()

Map spectra to new wavelength values.

interpolate_spct() interpolate_mspct()

Map a spectrum to new wavelength values.

smooth_spct()

Smooth a spectrum

trim_wl()

Trim head and/or tail of a spectrum

trim_spct() trim_mspct() trim2overlap() extend2extremes()

Trim (or expand) head and/or tail of a spectrum

clip_wl()

Clip head and/or tail of a spectrum

convertTimeUnit()

Convert the "time.unit" attribute of an existing source_spct object

e2q()

Convert energy-based quantities into photon-based quantities.

q2e()

Convert photon-based quantities into energy-based quantities

T2A()

Convert transmittance into absorbance.

A2T()

Convert absorbance into transmittance

T2Afr()

Convert transmittance into absorptance.

T2T()

Convert transmittance type.

tag()

Tag a spectrum

untag()

Remove tags

cps2irrad() cps2Rfr() cps2Tfr()

Conversion from counts per second to physical quantities

na.omit(<generic_spct>) na.omit(<source_spct>) na.omit(<response_spct>) na.omit(<filter_spct>) na.omit(<reflector_spct>) na.omit(<cps_spct>) na.omit(<raw_spct>) na.omit(<chroma_spct>) na.exclude(<generic_spct>) na.exclude(<source_spct>) na.exclude(<response_spct>) na.exclude(<filter_spct>) na.exclude(<reflector_spct>) na.exclude(<cps_spct>) na.exclude(<raw_spct>) na.exclude(<chroma_spct>)

Handle Missing Values in Objects

Mathematical operators and functions for spectra

`+`(<generic_spct>)

Arithmetic Operators

`%/%`(<generic_spct>)

Arithmetic Operators

`-`(<generic_spct>)

Arithmetic Operators

`%%`(<generic_spct>)

Arithmetic Operators

`/`(<generic_spct>)

Arithmetic Operators

`*`(<generic_spct>)

Arithmetic Operators

`^`(<generic_spct>)

Arithmetic Operators

cos(<generic_spct>) sin(<generic_spct>) tan(<generic_spct>) acos(<generic_spct>) asin(<generic_spct>) atan(<generic_spct>) cospi.generic_spct() sinpi.generic_spct() tanpi.generic_spct()

Trigonometric Functions

log(<generic_spct>) log2.generic_spct() log10.generic_spct() exp(<generic_spct>)

Logarithms and Exponentials

sqrt(<generic_spct>) abs(<generic_spct>)

Miscellaneous Mathematical Functions

sign(<generic_spct>)

Sign

round(<generic_spct>) signif(<generic_spct>) ceiling(<generic_spct>) floor(<generic_spct>) trunc(<generic_spct>)

Rounding of Numbers

Options

using_Tfr() using_Afr() using_A() using_energy() using_photon() using_quantum()

Use photobiology options

energy_as_default() photon_as_default() quantum_as_default() Tfr_as_default() Afr_as_default() A_as_default() unset_radiation_unit_default() unset_filter_qty_default() unset_user_defaults()

Set spectral-data options

wb_trim_as_default() use_cached_mult_as_default()

Set computation options

verbose_as_default() strict_range_as_default()

Set error reporting options

Extract, replace and combine

`[`(<generic_spct>) `[`(<raw_spct>) `[`(<cps_spct>) `[`(<source_spct>) `[`(<response_spct>) `[`(<filter_spct>) `[`(<reflector_spct>) `[`(<object_spct>) `[`(<chroma_spct>) `[<-`(<generic_spct>) `$<-`(<generic_spct>)

Extract or replace parts of a spectrum

`[`(<generic_mspct>) `[<-`(<generic_mspct>) `$<-`(<generic_mspct>) `[[<-`(<generic_mspct>)

Extract or replace members of a collection of spectra

subset(<generic_spct>)

Subsetting spectra

c(<generic_mspct>)

Combine collections of spectra

rbindspct()

Row-bind spectra

merge2object_spct()

Merge into object_spct

split2mspct() split2source_mspct() split2response_mspct() split2filter_mspct() split2reflector_mspct() split2cps_mspct() split2raw_mspct() split2calibration_mspct()

Convert a 'wide' or untidy data frame into a collection of spectra

subset2mspct()

Convert 'long' or tidy spectral data into a collection of spectra

join_mspct()

Join all spectra in a collection

Apply

msmsply() msdply() mslply() msaply()

Multi-spct transform methods

convolve_each()

Convolve function for collections of spectra

Astronomy

solar_time()

Local solar time

as.solar_date()

Convert a solar_time object into solar_date object

is.solar_time() is.solar_date()

Query class

as_tod()

Convert date to time-of-day in hours, minutes or seconds

tz_time_diff()

Time difference between two time zones

day_night() day_night_fast() noon_time() sunrise_time() sunset_time() day_length() night_length()

Times for sun positions

sun_angles() sun_angles_fast() sun_elevation() sun_zenith_angle() sun_azimuth()

Solar angles

relative_AM()

Relative Air Mass (AM)

print(<solar_time>) print(<solar_date>)

Print solar time and solar date objects

format(<solar_time>)

Encode in a Common Format

Atmosphere

water_vp_sat() water_dp() water_fp() water_vp2mvc() water_mvc2vp() water_vp2RH() water_RH2vp()

Water vapour pressure

relative_AM()

Relative Air Mass (AM)

Data for radiation sources

sun.spct

Solar spectral irradiance (simulated)

sun.data

Solar spectral irradiance (simulated)

sun.daily.spct

Daily solar spectral irradiance (simulated)

sun.daily.data

Daily solar spectral irradiance (simulated)

white_led.raw_spct

White led bulb spectrum

white_led.cps_spct

White led bulb spectrum

white_led.source_spct

White led bulb spectrum

A.illuminant.spct

CIE A illuminant data

D65.illuminant.spct

CIE D65 illuminant data

D2_spectrum()

Calculate deuterium lamp output spectrum from fitted constants

D2.UV586

Data for typical calibration lamps

D2.UV653

Data for typical calibration lamps

D2.UV654

Data for typical calibration lamps

FEL_spectrum()

Incandescent "FEL" lamp emission spectrum

FEL.BN.9101.165

Data for typical calibration lamps

Data for objects including filters

yellow_gel.spct

Transmittance spectrum of yellow theatrical gel.

polyester.spct

Transmittance spectrum of clear polyester film

clear.spct

Theoretical spectrum of a clear material

opaque.spct

Theoretical spectrum of an opaque material

green_leaf.spct

Green birch leaf reflectance.

Ler_leaf.spct

Green Arabidopsis leaf reflectance and transmittance.

Ler_leaf_rflt.spct

Green Arabidopsis leaf spectral reflectance.

Ler_leaf_trns.spct

Green Arabidopsis leaf spectral transmittance.

Ler_leaf_trns_i.spct

Green Arabidopsis leaf spectral transmittance.

clear_body.spct

Theoretical clear body

white_body.spct

Theoretical white body

black_body.spct

Theoretical black body

Data for light sensors

ccd.spct

Spectral response of a back-thinned CCD image sensor.

photodiode.spct

Spectral response of a GaAsP photodiode

Data for human and animal vision

ciev10.spct

Linear energy CIE 2008 luminous efficiency function 10 deg data

ciev2.spct

Linear energy CIE 2008 luminous efficiency function 2 deg data

ciexyzCC10.spct

CIE xyz chromaticity coordinates (CC) 10 deg data

ciexyzCC2.spct

CIE xyz chromaticity coordinates 2 deg data

ciexyzCMF10.spct

Linear energy CIE xyz colour matching function (CMF) 10 deg data

ciexyzCMF2.spct

Linear energy CIE xyz colour matching function (CMF) 2 deg data

beesxyzCMF.spct

Honeybee xyz chromaticity colour matching function data

Housekeeping and helper functions

getSpctVersion()

Get the "spct.version" attribute

getMspctVersion()

Get the "mspct.version" attribute

is.old_spct()

Query if an object has old class names

check_spct()

Check validity of spectral objects

check_w.length()

Sanity check of wavelengths (internal function).

checkTimeUnit()

Check the "time.unit" attribute of an existing source_spct object

copy_attributes()

Copy attributes

merge_attributes()

Merge and copy attributes

normalize_range_arg()

Normalize a range argument into a true numeric range

upgrade_spct()

Upgrade one spectral object

upgrade_spectra()

Upgrade one or more spectral objects

formatted_range()

Compute range and format it

f_mspct() mutate_mspct() calc_filter_multipliers()

Defunct functions and methods

Low-level functions

These functions are for use by developers when maximum flexibility is needed. They are not meant for everyday use.

as_energy()

Convert spectral photon irradiance into spectral energy irradiance

as_quantum()

Convert spectral energy irradiance into spectral photon irradiance

as_quantum_mol()

Convert spectral energy irradiance into spectral photon irradiance

calc_multipliers()

Spectral weights

calc_source_output()

Scaled and/or interpolated light-source spectral output

check_spectrum()

Sanity check a spectrum

div_spectra()

Divide two spectra, even if the wavelengths values differ

e2qmol_multipliers()

Calculate energy to quantum (mol) multipliers

e2quantum_multipliers()

Calculate energy to quantum multipliers

energy_irradiance()

Calculate (energy) irradiance from spectral irradiance

energy_ratio()

Energy:energy ratio

findMultipleWl()

Find repeated w.length values

find_peaks()

Find peaks in a spectrum

find_wls()

Find wavelength values in a spectrum

get_attributes()

Get the metadata attributes

get_peaks() get_valleys()

Get peaks and valleys in a spectrum

insert_spct_hinges()

Insert new wavelength values into a spectrum

integrate_xy()

Gives irradiance from spectral irradiance.

interpolate_spectrum()

Calculate spectral values at a different set of wavelengths

irradiance()

Photon or energy irradiance from spectral energy or photon irradiance.

oper_spectra()

Binary operation on two spectra, even if the wavelengths values differ

photon_irradiance()

Photon irradiance

photon_ratio()

Photo:photon ratio

photons_energy_ratio()

Photon:energy ratio

prod_spectra()

Multiply two spectra, even if the wavelengths values differ

s_e_irrad2rgb()

Spectral irradiance to rgb color conversion

split_energy_irradiance()

Energy irradiance for split spectrum regions

split_irradiance()

Energy or photon irradiance for split spectrum regions

split_photon_irradiance()

Photon irradiance for split spectrum regions

subt_spectra()

Subtract two spectra

sum_spectra()

Add two spectra

trim_tails()

Trim (or expand) head and/or tail

trim_waveband()

Trim (or expand) head and/or tail

v_insert_hinges()

Insert spectral data values at new wavelength values.

w_length_range2rgb()

Wavelength range to rgb color conversion

w_length2rgb()

Wavelength to rgb color conversion

waveband_ratio()

Photon or energy ratio