FITS image to 2D C array and vice versa