Trying to find bug in map_reducing lightcurve function