added ability to write the magnification map to a fits file