simpa icon indicating copy to clipboard operation
simpa copied to clipboard

The Rayleigh Scattering is not correct.

Open tomelse opened this issue 11 months ago • 6 comments

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.

tomelse avatar Jan 20 '25 14:01 tomelse

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?

tomelse avatar Jan 20 '25 14:01 tomelse

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 avatar Jan 21 '25 12:01 kdreher

@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.

jgroehl avatar Nov 18 '25 08:11 jgroehl

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...!

jgroehl avatar Nov 18 '25 08:11 jgroehl

The scattering equation itself does not care if we scale the reduced scattering or the actual scattering coefficient: image 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.

jgroehl avatar Nov 18 '25 09:11 jgroehl

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!

jgroehl avatar Nov 18 '25 10:11 jgroehl

Integrated this change with a whole test suite in PR #432

jgroehl avatar Nov 18 '25 12:11 jgroehl