Event Pileup in Charge-coupled Devices