Package: luxR 0.1.1

John D Kirwan

luxR: Underwater Light Analysis and Visual Ecology

Tools for quantifying and modelling underwater light environments. Propagates spectral irradiance through the water column via Beer-Lambert attenuation, computes photosynthetically active radiation (PAR), and converts between energy and photon-flux units. Provides the 'lux_spectrum' S3 class for unit-safe spectral arithmetic and format readers for TriOS RAMSES and Ocean Optics instruments. The optional 'lightr' package parses further instrument formats into strict native records; explicit measurement, scale, calibration, and resampling policies govern conversion via read_spectrum(). Spectra convert to and from the generic spectral classes of the optional 'photobiology' package, which also serves as the reference implementation luxR's integration and photometry are validated against. Includes visual ecology utilities: Govardovskii (2000) visual-pigment templates, photoreceptor quantum catch, Vorobyev-Osorio colour discrimination (JND), Secchi depth, and explicitly unvalidated contrast-threshold distance scenarios.

Authors:John D Kirwan [aut, cre]

luxR_0.1.1.tar.gz
luxR_0.1.1.zip(r-4.7-any)luxR_0.1.1.zip(r-4.6-any)luxR_0.1.1.zip(r-4.5-any)
luxR_0.1.1.tgz(r-4.6-any)luxR_0.1.1.tgz(r-4.5-any)
luxR_0.1.1.tar.gz(r-4.7-any)luxR_0.1.1.tar.gz(r-4.6-any)
luxR_0.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
luxR/json (API)

# Install 'luxR' in R:
install.packages('luxR', repos = c('https://johnkirwan.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/johnkirwan/luxr/issues

Pkgdown/docs site:https://johnkirwan.github.io

Datasets:

On CRAN:

Conda:

3.60 score 1 stars 75 exports 2 dependencies

Last updated from:75ae5c201a. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK236
source / vignettesOK247
linux-releaseOK149
macos-releaseOK97
macos-oldrelOK109
windows-develOK112
windows-releaseOK129
windows-oldrelOK110
wasm-releaseOK128

Exports:absorbanceangle_of_polarizationas_colourvisionas_lux_spectrumas_reflector_spctas_rspecas_source_spctattenuate_depthattenuate_spectrumband_irradiancebeam_attenuationbroadband2spectrumcolour_jndcontrast_at_distanceconvert_unitdegree_of_polarizationdetectabilitydetection_rangefit_Kdfit_sensitivityfresnel_reflectancefrom_naplesfrom_ocean_opticsfrom_solarfrom_triosft2mgovardovskii_templateinherent_contrastirradiance2luxirradiance2radiancejerlov_Kdlight_at_depthlux_spectrumlux2irradiancem2ftmichelson_contrastn2W_spec_irradiancepar_fractionpar_irradiancephotic_depthphoton2Wplot_spectrapolarization_contrastpropagate_depthpropagate_spectrumquantum_catchradiance2irradianceread_instrument_spectrumread_ocean_opticsread_spectrumread_triosreceptor_absorptancereflectance_to_radiancerefracted_solar_angleresample_spectrumrun_appscattering_anglescotopic_luxsecchi_depthsingle_scattering_albedosnells_windowsolar_irradiancespecies_brightnessspecies_LEFspecies_sensitivity_matrixsurface_transmittancetransmittanceunderwater_polarizationunit_expressionunit_labelvisual_rangeW2mol_spec_irradianceW2photonwavelength_in_mediumweber_contrast

Dependencies:rbibutilsRdpack

From photons to perception
Units and conversions | How the spectrum changes with depth | Building a visual model | Reflectance to radiance | Colour discrimination | Validation against pavo | Interoperating with pavo | Interoperating with colourvision | Validation against colourvision

Last update: 2026-07-29
Started: 2026-07-24

Seeing through water: from sunlight to detection
1. Sunlight to depth | 2. Light to capture | 3. Capture to detection | Summary

Last update: 2026-07-29
Started: 2026-07-24

Light in the water column
Loading field data | Converting units | Validation against photobiology | PAR across depth | Fitting attenuation from measurements | Extending to depth with a Jerlov model | Band-integrated irradiance | Photic depth

Last update: 2026-07-24
Started: 2026-07-24

Polarization of the underwater light field
The model | Degree of polarization across the sky | How polarization fades with depth | The e-vector

Last update: 2026-07-24
Started: 2026-07-24

Readme and manuals

Help Manual

Help pageTopics
luxR: Underwater Light Analysis and Visual EcologyluxR-package luxR
Absorbance (optical density) from transmittance.absorbance
Angle of polarization (e-vector orientation) from Stokes parametersangle_of_polarization
Convert luxR spectra to a colourvision input data frameas_colourvision as_colourvision.list as_colourvision.lux_spectrum
Coerce an object to lux_spectrumas_lux_spectrum as_lux_spectrum.data.frame as_lux_spectrum.lux_instrument_spectrum as_lux_spectrum.lux_spectrum as_lux_spectrum.numeric as_lux_spectrum.reflector_spct as_lux_spectrum.rspec as_lux_spectrum.source_spct
Convert luxR reflectance to a photobiology reflector_spctas_reflector_spct as_reflector_spct.list as_reflector_spct.lux_spectrum
Convert luxR spectra to a pavo 'rspec' objectas_rspec as_rspec.list as_rspec.lux_spectrum
Convert luxR spectra to photobiology spectral classesas_source_spct as_source_spct.list as_source_spct.lux_spectrum
Beer-Lambert attenuation at a single wavelength.attenuate_depth
Propagate a surface spectrum through the water column.attenuate_spectrum attenuate_spectrum.lux_spectrum attenuate_spectrum.numeric
Band-integrated irradiance at one or more depthsband_irradiance band_irradiance.lux_spectrum band_irradiance.numeric
Beam attenuation coefficient from absorption and scattering.beam_attenuation
Convert a broadband scalar reading into a plausible spectrum.broadband2spectrum
CIE Scotopic Luminous Efficiency FunctionCIE_scotopic
CIE Photopic Luminous Efficiency FunctionCIE1931
Chromatic distance between two illuminants (Vorobyev-Osorio model).colour_jnd
Heuristic scalar contrast remaining after a sighting path through water.contrast_at_distance
Convert a lux_spectrum to a different unitconvert_unit
Degree of polarization from Stokes parametersdegree_of_polarization
Object-vs-background detection summary.detectability
Scenario estimate of object-background threshold-crossing distance.detection_range
Estimate the diffuse attenuation coefficient from two irradiance readings.fit_Kd fit_Kd.lux_spectrum fit_Kd.numeric
Fit a Govardovskii visual-pigment template to measured spectral sensitivity.fit_sensitivity
Fresnel reflectance at the air-water interface.fresnel_reflectance
Load a Naples depth spectrum as a lux_spectrumfrom_naples
Read a calibrated Ocean Optics spectrum as a lux_spectrumfrom_ocean_optics
Load a reference solar spectrum as a lux_spectrumfrom_solar
Read a TriOS RAMSES file as calibrated radiance spectrafrom_trios
Convert feet to metres.ft2m
Govardovskii et al. (2000) visual-pigment template.govardovskii_template
Inherent (zero-distance) contrast of an object against its background.inherent_contrast
Provide lux values for measures of spectral irradiance.irradiance2lux irradiance2lux.default irradiance2lux.lux_spectrum irradiance2lux.numeric
Convert irradiance to radiance under a geometry assumption.irradiance2radiance
Diffuse attenuation coefficient for Jerlov optical water types.jerlov_Kd
Diffuse attenuation coefficients for Jerlov optical water types.jerlov_types
In-water downwelling spectral irradiance at a single depth.light_at_depth
Create a lux_spectrum object*.lux_spectrum +.lux_spectrum -.lux_spectrum /.lux_spectrum as.data.frame.lux_spectrum lux_spectrum plot.list plot.lux_spectrum print.lux_spectrum summary.lux_spectrum [.lux_spectrum
Distribute integrated lux across a reference spectral shape.lux2irradiance
Convert metres to feet.m2ft
Michelson contrastmichelson_contrast
Convert photon-count spectral irradiance to W m^-2 nm^-1.n2W_spec_irradiance n2W_spec_irradiance.lux_spectrum n2W_spec_irradiance.numeric
Example downwelling irradiance from Mare Chiaro, Gulf of NaplesNaples
Fraction of spectral irradiance in the PAR window.par_fraction par_fraction.lux_spectrum par_fraction.numeric
PAR irradiance from a spectral irradiance measurement.par_irradiance par_irradiance.lux_spectrum par_irradiance.numeric
Depth at which a given fraction of surface light remains.photic_depth
Convert photon counts to watts at a given wavelength.photon2W
Plot a list of lux_spectrum objects as overlaid lines.plot_spectra
Polarization contrast between a target and its backgroundpolarization_contrast
Propagate a known irradiance to any other depth (bidirectional).propagate_depth
Propagate a known spectrum to any other depth(s) (bidirectional).propagate_spectrum propagate_spectrum.lux_spectrum propagate_spectrum.numeric
Sensitivity-weighted photon irradiance.quantum_catch
Convert radiance to irradiance under a geometry assumption.radiance2irradiance
Parse one instrument spectrum with lightrread_instrument_spectrum
Strictly parse an Ocean Optics / Ocean Insight spectrum fileread_ocean_optics
Read a declared, calibrated spectrum with lightrread_spectrum
Read a TriOS RAMSES spectroradiometer data fileread_trios
Photoreceptor absorptance from a normalised absorbance template (self-screening).receptor_absorptance
Convert spectral reflectance to spectral radiancereflectance_to_radiance reflectance_to_radiance.lux_spectrum reflectance_to_radiance.numeric
Refracted zenith angle of the sun beneath the surfacerefracted_solar_angle
Resample a spectrum to a new wavelength gridresample_spectrum resample_spectrum.lux_spectrum resample_spectrum.numeric
Launch the luxR Shiny explorer.run_app
Angle between a line of sight and the solar beamscattering_angle
Compute scotopic illuminance (V'(lambda) weighting).scotopic_lux scotopic_lux.default scotopic_lux.lux_spectrum scotopic_lux.numeric
Secchi depth from diffuse attenuation coefficient(s).secchi_depth
Single-scattering albedo.single_scattering_albedo
Snell's window half-angle.snells_window
Reference solar spectral irradiance under standard conditions.solar_irradiance
ASTM G173-03 reference solar spectral irradiance.solar_spectra
Per-species sensitivity-weighted photon irradiance.species_brightness
Species visual-channel support decisions.species_channel_support
Validated visual-channel memberships for selected species.species_channels
Spectral sensitivity for a named species and photoreceptor class.species_LEF
Photoreceptor spectral sensitivities for selected species.species_sensitivities
Photoreceptor sensitivity matrix for colourvisionspecies_sensitivity_matrix
Fraction of downwelling irradiance transmitted across the water surface.surface_transmittance
Beer-Lambert transmittance over a path.transmittance
Tunable Rayleigh-like approximation to underwater polarizationunderwater_polarization
Render a unit string as a plotmath expressionunit_expression
Render a unit string for displayunit_label
Heuristic horizontal visual-range estimate in water.visual_range
Convert energy spectral irradiance to molar photon flux.W2mol_spec_irradiance W2mol_spec_irradiance.lux_spectrum W2mol_spec_irradiance.numeric
Convert watts to photon counts at a given wavelength.W2photon
Wavelength of light inside an optical medium.wavelength_in_medium
Weber contrastweber_contrast