cherab/core

Bremsstrahlung trapezium rule bug

Mateasek opened this issue · 3 comments

I think that here we have a bug in the trapezium evaluation, don't we?

upper_wavelength = spectrum.min_wavelength + spectrum.delta_wavelength * i

I think that there should be (i + 1) term here, otherwise for the 1st iteration the lower_wavelength and upper_wavelength are equal, aren't they?

The line should look like:
upper_wavelength = spectrum.min_wavelength + spectrum.delta_wavelength * (i + 1)

Hi @Mateasek, yes you are right. I fixed this in #352, but we decided to refactor the atomic data repository before applying this PR. So this bug deserves a separate fix.

I suspected you fixed it somewhere @vsnever , but looked into wrong PRs.

Fixed in #385.