The polynomial fit to the top edge of the slit is not restricted anywhere to be on the detector, so under some conditions it leads to the top pixel being off the detector causing an indexing error. I've added a simple min function to try to prevent that.
Possible fix for #111
The polynomial fit to the top edge of the slit is not restricted anywhere to be on the detector, so under some conditions it leads to the top pixel being off the detector causing an indexing error. I've added a simple
min
function to try to prevent that.