Codes for EMCCD and Lucky-Imaging Analysis