changed to calculate only the flux of detected object instead of summing flux from all sources