This repository contains files relevant to the manuscript "Light Pollution Forces a Change in Dung Beetle Orientation Behaviour" by James J. Foster, Claudia Tocco, Jochen Smolka, Lana Khaldy, Emily Baird, Marcus J. Byrne, Dan-Eric Nilsson and Marie Dacke (2021).
The source code is statistical analysis, written in R
, and image analysis, written in MATLAB
, based on the Environmental Light Field (ELF) system developed by Smolka & Nilsson (D.-E. Nilsson, J. Smolka, 2021 Quantifying biologically essential aspects of environmental light. J. R. Soc. Interface 18: 20210184). Image data (.mat
files) are available from Figshare.
Scripts for organisation, plotting and analysis of exit headings recorded during behavioural experiments. Raw data can be found in LP Headings all 20200505.txt
and in a neater format in LPdataOrganised20200505.txt
. Mean vector lengths for each individual can be found in LPallRho20200528.txt
and mean bearings in LPallMu20200528.txt
. LPHeadings-OrganiseData.R
is a script to label data according to relevant experimental conditions. Plotting functions can be found in LP_PlotFunctions.R
and rely functions from the circular package. MMRayleigh.test.R
is an implementation of Moore's modified Rayleigh test (Moore, 1980), for which p-values are estimated numerically rather than using lookup tables.
RuralUrban-Tests.R
and DirectIndirect-Tests.R
contain the hypothesis tests for the comparisons of light-polluted and dark skies, and direct and indirect light pollution, respectively.
All scripts written by JJ Foster. Data collected by JJ Foster, C Tocco, L Khaldy, E Baird, MJ Byrne and M Dacke. All analysis performed by JJ Foster.
Scripts for processing, plotting and analysis of scenes recorded during behavioural experiments. Based the night
and polar
modules of ELF developed by Jochen Smolka (https://github.com/sciencedjinn/elf). Polarization images rely on polarELF.1.7.1 171108
, originally written for Foster et al. 2019. Heatmaps of scene radiance rely on export_fig by Yair Altman. RuralUrban-hmax-Tests.R
and DirectIndirect-hmax-Tests.R
are R
scripts used to calculate the snapshot index from minimum-width at half maximum for rotational image-difference curves.
ELF was developed by J Smolka and D-E Nilsson. All ELF scripts written by J Smolka with conceptual input from D-E Nilsson. skypipe.m
, rotimdiffsky.m
, hmax.m
and colourmapsky.m
written by JJ Foster. Data collected by JJ Foster, C Tocco, MJ Byrne and M Dacke. All analysis performed by JJ Foster.
Requires only a standard computer with enough RAM to support the in-memory operations.
All analysis was performed on macOS: High Sierra (10.13.1) – Catalina (10.15.5)
circular
CircStats
muStat
beeswarm
Curve Fitting Toolbox
Image Processing Toolbox
Statistics and Machine Learning Toolbox
git clone https://github.com/JJFosterLab/light-pollution