library(data.table)
library(ggplot2)

Define some plot limits

wavelength.min <- 300
wavelength.max <- 850

Read photopic/scotopic vision data from file

photopic.csv <- read.csv("vljve.csv")
scotopic.csv <- read.csv("scvle.csv")

Interpolate photopic/scotopic vision

photopic <- as.data.frame(approx(photopic.csv$wavelength, 
                                 photopic.csv$efficiency, 
                                 seq(wavelength.min, wavelength.max), 
                                 yleft = 0, 
                                 yright = 0))
scotopic <- as.data.frame(approx(scotopic.csv$wavelength, 
                                 scotopic.csv$efficiency, 
                                 seq(wavelength.min, wavelength.max), 
                                 yleft = 0, 
                                 yright = 0))

Read filter data from file

U <- read.csv("Baader U Filter.csv")

Plot of filter transmission

ggplot() +
    geom_rect(data=scotopic, aes(xmin=x-0.5, xmax=x+0.5, ymin= 5, ymax= 7, fill=y)) +
    annotate("text", x=498, y= 9, label="Scotopic", hjust=0.5, vjust=0, size=3) +
    geom_rect(data=photopic, aes(xmin=x-0.5, xmax=x+0.5, ymin=20, ymax=22, fill=y)) +
    annotate("text", x=555, y=24, label="Photopic", hjust=0.5, vjust=0, size=3) +
    scale_fill_gradientn(guide=F, colours = gray(c(255:0)/255)) +
    geom_line(data=U, aes(x=wavelength, y=transmission)) +
    labs(title="Baader U Filter", x="Wavelength [nm]", y="Transmission [%]") + 
    coord_cartesian(xlim=c(300, 850), ylim=c(0.0,100.0)) +
    theme_bw()

Maximum of filter transmission

maximum <- U[which.max(U$transmission),]
print(data.table(maximum))
##    wavelength transmission
## 1:      345.9     76.75121

Search FWHM within wavelength of maximum transmission +/- a constant value

range <- 200

Wavelength of half maximum on the blue side of peak transmission

lo <- subset(U, wavelength > maximum$wavelength - range & wavelength < maximum$wavelength &
                 transmission < maximum$transmission / 2)
hi <- subset(U, wavelength > maximum$wavelength - range & wavelength < maximum$wavelength & 
                 transmission > maximum$transmission / 2)
x0 <- (lo[which.max(lo$wavelength),1] + hi[which.min(hi$wavelength),1]) / 2

Wavelength of half maximum on the red side of maximum transmission

lo <- subset(U, wavelength < maximum$wavelength + range & wavelength > maximum$wavelength & 
                 transmission < maximum$transmission / 2)
hi <- subset(U, wavelength < maximum$wavelength + range & wavelength > maximum$wavelength & 
                 transmission > maximum$transmission / 2)
x1 <- (lo[which.min(lo$wavelength),1] + hi[which.max(hi$wavelength),1]) / 2

Filter parameters

center <- (x1 + x0)/2
fwhm <- x1 - x0
peak <- approx(U$wavelength, U$transmission, c(center))$y
filter.parameters <- data.frame(center=center, fwhm=fwhm, peak=peak)
print(data.table(filter.parameters))
##    center     fwhm     peak
## 1: 350.85 63.59999 74.70089