AstroHuntsman / gunagala

4 stars 9 forks source link

Quick fix for FWHM bug #31

Closed AnthonyHorton closed 5 years ago

AnthonyHorton commented 5 years ago

This is a quick fix for a bug that can sometimes causes a tabulated data optical filter to fail to calculate its FWHM.

The cause of the problem was that the peak transmission value calculated by maximising the linearly interpolated transmission was slightly lower than the maximum transmission value in the tabulated data. For tabulated data filters the latter was being used to find wavelengths that bracketed the half maximum points, but then the peak value was being recalculated using the former method, which sometimes resulted in the half maximum points being outside the brackets. This quick fix avoids the problem by not recalculating the peak transmission value for tabulated data filters, and simply uses the maximum value from the tabulated data instead.

A better fix would also stop using solvers to find the half maximum points for the tabulated filters too, as a simple linear interpolation would be more robust and efficient in their case.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 90.506% when pulling 56e3f2f3e36728a9e70e1884f378cd262f4848c3 on AnthonyHorton:fix_fwhm_bug into 6e776061020309e0ba394371b6a3ea02bbd53341 on AstroHuntsman:develop.