This is a little tricky isn't it... I mean the fact that we have created this file here called `tmp` that doesn't get removed.  If the files are big (which might really happen) then duplicating them all and not cleaning up afterwards seems wrong.  On the other hand, you can't remove `tmp` because PyFITS still needs the file to be there to read from it.

The only way around this I can see, and it seems like a bit of an overhead, is to have *all* these functions return not just `hdu_list, tmp` or `hdulist, fin` but `hdulist, fin, cleanup_needed` so that if the user can check if `cleanup_needed == True` and then call `os.remove(tmp.name)` later on...

Or am I missing some reason why it doesn't matter that `tmp` is created here and not deleted?