Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Implement modern / more generalized bandpass correction techniques #1016

Open
tjdcs opened this issue Jul 25, 2022 · 2 comments
Open
Labels

Comments

@tjdcs
Copy link
Contributor

tjdcs commented Jul 25, 2022

Description

Description

Bandpass error in spectral measurements is a very important source of error in spectral data. The library already provides some older / simpler bandpass correction methods for the case where the bandwidth of the spectrometer exactly matches the sampling interval. However, this is rarely the case. The CR-300 and CS-2000 (two common spectroradiometers) have bandwidths of 2nm, but have a sampling size of 1nm. Similarly the Photo Research family of spectrometers has much wider bandwidths than its sampling intervals. As high as 8nm bandwidth to 1nm sampling.

For LED sources which are getting increasingly narrow, for laser projectors, or for some fluorescent sources with particularly narrow emission bands the error can be quite large. Fig 1.

It would be greatly appreciated to implement one of the modern methods that can provide correction for these cases. I've found three relevant papers and attempted to implement a deconvolution method myself with scipy.signal.deconvolve but failed to make it work on the relevant simulated cases. Bandpass error can be simulated by convolving a bandpass function with a simulated spectrum, treating the convolved signal as the measurement value and applying the bandpass correction method to hopefully retrieve the input spectrum.

I am suggesting one or both of the methods below:

Papers

Spectral deconvolution applications for colorimetry
Comparison of the Richardson–Lucy method and a classical approach for spectrometer bandpass correction

A Flexible Bandpass Correction Method for Spectrometers

Figure 1

Simulated bandpass error of 2nm triangular bandwidth on 1nm sampling spectrometer (CR-300, CS-2000A). True spectrum is shown in blue, while the measurement is shown in orange.
output

@tjdcs tjdcs added the Feature label Jul 25, 2022
@KelSolaar
Copy link
Member

This relates to #54 that was never implemented.

@KelSolaar
Copy link
Member

KelSolaar commented Jul 31, 2022

Out of curiosity @tjdcs, did you try the scikit-image implementation? It should work for 1D arrays: https://github.com/scikit-image/scikit-image/blob/main/skimage/restoration/deconvolution.py#L371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants