Update writemoment2.c

Replaced pyfits with astropy