The Rayleigh Scattering is not correct.
Your formula for Rayleigh scattering used to be ~ (lambda) ^ (1e-4), but should be ~ (lambda)^-4
I put the pull request in by just editing the GitHub text file, so haven't rerun the tests, but I can't see why this should break anything. If you have any optical tests that validate light fluence values etc, then these will need remaking I suspect.
P.s. I think I raised this issue a few years ago, but it didn't get fixed, so it might be worth propagating this correction to all other branches to make sure that it doesn't somehow get overwritten in future?
Yes, you're absolutely right. Not only this but also, everywhere we use this function, we use it as scattering coefficient instead of the reduced scattering.
We're directly testing certain scattering coefficients, so the tests shouldn't break. It seems like some builds don't run at the moment, which is a different problem, though :sweat_smile:
@kdreher The tests are indeed failing because of mismatches in the created versus tested scattering. If you are correct in stating that we use reduced scattering and scattering interchangeably and wrong within the simulations, we should look into this.
At the very least, a test should be added that tests for the correct implementation of this, such that it fails in the future when it accidentally gets reverted. Also: the windows tests should not succeed...!
The scattering equation itself does not care if we scale the reduced scattering or the actual scattering coefficient:
It all depends on if the input
a represents reduced or normal scattering.
The SIMPA function does not mention "reduced scattering" in its documentation, but refers to "scattering". If we use it to determine wavelength-dependent scattering, I think that is completely fine - we only run into problems if we expect the output to be in reduced scattering units even though we define a in scattering or vice versa.
I have double-checked, and we are defining a as "scattering at 500nm" and have converted literature values accordingly throughout the literature library and the use is consistent and correct in "normal scattering" throughout SIMPA!
Integrated this change with a whole test suite in PR #432