don't use the trace and sky subtraction routines in cosmics.py--they cause trouble
select flat images in one pass to avoid a bug when there are large numbers of images to process.