Then this may be problem with cfitsio library because that is used to write FITS files.

Read More...