Fixes to Alex's code for the Sun at sensor edges