Select from a list of instrument descriptors which one to use based on date of measurement.

  date = lubridate::now(tzone = "UTC"),
  descriptors = ooacquire::MAYP11278_descriptors,
  verbose = getOption("photobiology.verbose", TRUE),
  strict.calib = getOption("photobiology.strict.calib", FALSE),
  entrance.optics = NULL,



Any object that anytime::anydate() will decode as a date or convert to a date. Used to select a descriptor containing calibration data valid for a given day.


A named list of descriptors of the characteristics of the spectrometer including calibration data.


Logical indicating the level of warnings wanted.


Logical indicating the level of validity checks.


character The name or geometry of the diffuser or entrance optics to select. Only required when there are calibration with multiple entrance optics for the same spectrometer.


Currently ignored.


Calibrations for instruments stored in a list and passed as argument to descriptors, also store the dates between which they are valid. This function walks the list searching for a calibration valid for date. If no valid calibration is found and strict.calib = FALSE, the calibration valid closest in time is returned with a warning while if no valid calibration is found and strict.calib = TRUE an error is triggered.

If a character string is passed as argument to date, it must be in a format suitable for anytime::anydate(). One needs to be careful with months and days of the month when supplying them as numbers, so using months names or their abbreviations can be safer.


The default argument for verbose is for this function TRUE as conversion of other objects to a date may fail.