Learn R Programming

⚠️There's a newer version (0.14.0) of this package.Take me there.

photobiology

Package 'photobiology' defines a system of classes for storing spectral data and accompanying metadata. For each of these classes specialised summary methods, maths operators and functions are provided. In addition, classes for storing collections of objects of the classes for individual spectra are defined as well as 'apply' functions. Extraction and replacement operators are also implemented. Functions for calculation of the position of the sun, times of sunrise and sunset, day length and night length are also provided.

The package supports storage and manipulation of data for radiation quantities and for optical properties of objects.

This package is the core of a suite of R packages for photobiological calculations described at the r4photobiology web site.

Copy Link

Version

Install

install.packages('photobiology')

Monthly Downloads

1,133

Version

0.9.19

License

GPL (>= 2)

Maintainer

Pedro Aphalo

Last Published

March 5th, 2018

Functions in photobiology (0.9.19)

D65.illuminant.spct

CIE D65 illuminant data
FEL.BN.9101.165

Data for typical calibration lamps
Ler_leaf_trns_i.spct

Green Arabidopsis leaf spectral transmittance.
D2.UV586

Data for typical calibration lamps
D2.UV653

Data for typical calibration lamps
T2A

Convert transmittance into absorbance.
absorptance

Absorptance
T2Afr

Convert transmittance into absorptance.
MathFun

Miscellaneous Mathematical Functions
absorptance_spct

Calculate absorptance from spectral absorptance.
auto_hinges

Guess whether insertion of hinges is needed or not
average_spct

Average spectral data.
FEL_spectrum

Incandescent "FEL" lamp emission spectrum
as_quantum_mol

Convert spectral energy irradiance into spectral photon irradiance
check_spectrum

Sanity check a spectrum
T2T

Convert transmittance type.
check_w.length

Sanity check of wavelengths (internal function).
clear_body.spct

Theoretical clear body
as_tod

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

Green Arabidopsis leaf reflectance and transmittance.
Trig

Trigonometric Functions
div_spectra

Divide two spectra, even if the wavelengths values differ
clear_photobio.cache

Clear the spectral weights cache
A.illuminant.spct

CIE A illuminant data
e2q

Convert energy-based quantities into photon-based quantities.
energy_ratio

Energy:energy ratio
A2T

Convert absorbance into transmittance
calc_source_output

Scaled and/or interpolated light-source spectral output
eq_ratio

Energy:photon ratio
checkTimeUnit

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

Convert spectral photon irradiance into spectral energy irradiance
ccd.spct

Spectral response of a back-thinned CCD image sensor.
as_quantum

Convert spectral energy irradiance into spectral photon irradiance
check_spct

Check validity of spectral objects
clean_spct

Clean a spectrum
find_peaks

Find peaks in a spectrum
clear.spct

Theoretical spectrum of a clear material
fluence

Fluence
getInstrSettings

Get the "instr.settings" attribute
absorbance

Absorbance
getMspctVersion

Get the "mspct.version" attribute
e2qmol_multipliers

Calculate energy to quantum (mol) multipliers
getSpctVersion

Get the "spct.version" attribute
beesxyzCMF.spct

Honeybee xyz chromaticity colour matching function data
e2quantum_multipliers

Calculate energy to quantum multipliers
e_fluence

Energy fluence
getTfrType

Get the "Tfr.type" attribute
black_body.spct

Theoretical black body
e_irrad

Energy irradiance
add_attr2tb

Copy attributes from members of a generic_mspct
integrate_spct

Integrate spectral data.
as.generic_mspct

Collection-of-spectra copy-constructor
Ler_leaf_rflt.spct

Green Arabidopsis leaf spectral reflectance.
absorbance_spct

Calculate absorbance from spectral absorbance.
fscale

Rescale a spectrum using a summary function
integrate_xy

Gives irradiance from spectral irradiance.
ciexyzCMF10.spct

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

Query class
c.generic_mspct

Combine collections of spectra
calc_multipliers

Spectral weights
Ler_leaf_trns.spct

Green Arabidopsis leaf spectral transmittance.
fscale_spct

fscale a spectrum
generic_mspct

Collection-of-spectra constructor
getAfrType

Get the "Afr.type" attribute
ciexyzCMF2.spct

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

Green birch leaf reflectance.
clip_wl

Clip head and/or tail of a spectrum
ciev10.spct

Linear energy CIE 2008 luminous efficiency function 10 deg data
color_of

Color of an object
is.summary_generic_spct

Query class of spectrum summary objects
ciev2.spct

Linear energy CIE 2008 luminous efficiency function 2 deg data
day_night

Times for sun positions
is_tagged

Query if it is an spectrum is tagged
as.generic_spct

Spectral-object copy constructor
convertTimeUnit

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

Convolve function for collections of spectra
copy_attributes

Copy attributes from one R object to another
head_tail

Return the First and Last Part of an Object
join_mspct

Join all spectra in a collection
normalize

Normalize spectral data
cps2irrad

Conversion from counts per second to physical quantities
as.solar_date

Convert a solar_time object into solar_date object
interpolate_spct

Map a spectrum to new wavelength values.
interpolate_spectrum

Calculate spectral values at a different set of wavelengths
normalize_range_arg

Normalize a range argument into a true numeric range
Extract

Extract or replace parts of a spectrum
checkMspctVersion

Check that the "mspct.version" attribute is set
^.generic_spct

Arithmetic Operators
checkSpctVersion

Check that the "spct.version" attribute is set
is_effective

Is an R object "effective"
is_normalized

Query whether a generic spectrum has been normalized.
ciexyzCC2.spct

CIE xyz chromaticity coordinates 2 deg data
ciexyzCC10.spct

CIE xyz chromaticity coordinates (CC) 10 deg data
photobiology-package

photobiology: Photobiological Calculations
class_spct

Query which is the class of an spectrum
clean

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

Find labels from "waveband" object
qe_ratio

Photon:energy ratio
Extract_mspct

Extract or replace members of a collection of spectra
defunct

Defunct functions and methods
dim.generic_mspct

Dimensions of an Object
setMultipleWl

Set the "multiple.wl" attribute
format.solar_time

Encode in a Common Format
log

Logarithms and Exponentials
formatted_range

Compute range and format it
getBSWFUsed

Get the "bswf.used" attribute
getInstrDesc

Get the "instr.desc" attribute
energy_as_default

Set spectral-data options
photodiode.spct

Spectral response of a GaAsP photodiode
msmsply

Multi-spct transform methods
energy_irradiance

Calculate (energy) irradiance from spectral irradiance
div-.generic_spct

Arithmetic Operators
fshift

Shift the scale of a spectrum using a summary function
oper_spectra

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

Energy:energy ratio
mspct_classes

Names of multi-spectra classes
fshift_spct

fshift a spectrum
e_response

Energy-based photo-response
getTimeUnit

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

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

Math function dispatcher for spectra
getWhatMeasured

Get the "what.measured" attribute
polyester.spct

Transmittance spectrum of clear polyester film
filter_cps.mspct

Counts per second from a measurement of a plastic film
setWhatMeasured

Set the "what.measured" attribute
white_led.raw_spct

White led bulb spectrum
white_led.cps_spct

White led bulb spectrum
irradiance

Photon or energy irradiance from spectral energy or photon irradiance.
getRfrType

Get the "Rfr.type" attribute
getMultipleWl

Get the "multiple.wl" attribute
range

Wavelength range
getScaled

Get the "scaled" attribute
getNormalized

Get the "normalized" attribute
getWhenMeasured

Get the "when.measured" attribute
setScaled

Set the "scaled" attribute
is.generic_mspct

Query class of spectrum objects
get_attributes

Get the metadata attributes
peaks

Peaks or local maxima
setGenericSpct

Convert an R object into a spectrum object.
setInstrDesc

Set the "instr.desc" attribute
getWhereMeasured

Get the "where.measured" attribute
get_peaks

Get peaks and valleys in a spectrum
interpolate_wl

Map spectra to new wavelength values.
insert_hinges

Insert wavelength values into spectral data.
is_absorbance_based

Query if a spectrum contains absorbance or transmittance data
insert_spct_hinges

Insert new wavelength values into a spectrum
isValidInstrSettings

Check the "instr.settings" attribute
setTimeUnit

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

Irradiance
is.waveband

Query if it is a waveband
isValidInstrDesc

Check the "instr.desc" attribute
q2e

Convert photon-based quantities into energy-based quantities
is.generic_spct

Query class of spectrum objects
min

Wavelength minimum
is.old_spct

Query if an object has old class names
max

Wavelength maximum
prod_spectra

Multiply two spectra, even if the wavelengths values differ
response

Integrated response
merge2object_spct

Merge into object_spct
na.omit.source_spct

Handle Missing Values in Objects
rgb_spct

RGB color values
normalized_diff_ind

Calculate a normalized index.
trimInstrSettings

Trim the "instr.settings" attribute
is_photon_based

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

Energy irradiance for split spectrum regions
minus-.generic_spct

Arithmetic Operators
split_bands

List-of-wavebands constructor
is_scaled

Query whether a generic spectrum has been scaled
normalization

Normalization of an R object
julian_day

Solar astronomy using Meeus' algorithm
stepsize

Stepsize
setInstrSettings

Set the "instr.settings" attribute
mod-.generic_spct

Arithmetic Operators
summary

Summary of a spectral object
print.waveband

Print a "waveband" object
opaque.spct

Theoretical spectrum of an opaque material
sum_spectra

Add two spectra
setBSWFUsed

Set the "bswf.used" attribute
l_insert_hinges

Insert wavelength values into spectral data.
round

Rounding of Numbers
q_irrad

Photon irradiance
print.summary_generic_spct

Print spectral summary
spct_classes

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

Central wavelength value
sun.daily.data

Daily solar spectral irradiance (simulated)
photons_energy_ratio

Photon:energy ratio
resp_spct

Calculate response from spectral response
q_response

Photon-based photo-response
plus-.generic_spct

Arithmetic Operators
split_irradiance

Energy or photon irradiance for split spectrum regions
reflectance_spct

Calculate reflectance from spectral reflectance
photon_irradiance

Photon irradiance
setTfrType

Set the "Tfr.type" attribute
setWhenMeasured

Set the "when.measured" attribute
print

Print a spectral object
setWhereMeasured

Set the "where.measured" attribute
setAfrType

Set the "Afr.type" attribute
q_fluence

Photon fluence
split2mspct

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

Trim (or expand) head and/or tail
valleys

Valleys or local minima
spread

Length of object in wavelength units
w_length_range2rgb

Wavelength range to rgb color conversion
q_ratio

Photon:photon ratio
source_spct

Spectral-object constructor
transmittance_spct

Calculate transmittance from spectral transmittance.
solar_time

Local solar time
v_insert_hinges

Insert wavelength values into spectral data.
print.solar_time

Print solar time and solar date objects
summary_spct_classes

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

Daily solar spectral irradiance (simulated)
sun_angles

Solar angles
upgrade_spectra

Upgrade one or more spectral objects
setRfrType

Set the "Rfr.type" attribute
trimInstrDesc

Trim the "instr.desc" attribute
tz_time_diff

Time difference between two time zones
photon_ratio

Photo:photon ratio
waveband

Waveband constructor method
s_e_irrad2rgb

Spectral irradiance to rgb color conversion
using_Tfr

Use photobiology options
untag

Remove tags
split_photon_irradiance

Photon irradiance for split spectrum regions
setNormalized

Set the "normalized" attribute
sun.data

Solar spectral irradiance (simulated)
wb2rect_spct

Create tagged spectrum from wavebands
w_length2rgb

Wavelength to rgb color conversion
verbose_as_default

Set error reporting options
sun.spct

Solar spectral irradiance (simulated)
twilight2angle

twilight argument check and conversion
waveband_ratio

Photon or energy ratio
rmDerivedSpct

Remove "generic_spct" and derived class attributes.
transmittance

Transmittance
upgrade_spct

Upgrade one spectral object
wb2spct

Create spectrum from wavebands
wb2tagged_spct

Create tagged spectrum from wavebands
shared_member_class

Classes common to all collection members.
rbindspct

Row-bind spectra
rmDerivedMspct

Remove "generic_mspct" and derived class attributes.
reflectance

Reflectance
tag

Tag a spectrum
sign

Sign
smooth_spct

Smooth a spectrum
slash-.generic_spct

Arithmetic Operators
trim_waveband

Trim (or expand) head and/or tail
trim_wl

Trim head and/or tail of a spectrum
subset2mspct

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

Subtract two spectra
times-.generic_spct

Arithmetic Operators
wb_trim_as_default

Set computation options
white_body.spct

Theoretical white body
yellow_gel.spct

Transmittance spectrum of yellow theatrical gel.
white_led.source_spct

White led bulb spectrum
D2_spectrum

Calculate deuterium lamp output spectrum from fitted constants
D2.UV654

Data for typical calibration lamps