Imported pyfits inside function namespace in accord with astropy conventions