Add pyfits and memory file handling