First convert the .fits file into array see
After that try to use numpy.ma module see
This a suggestion to start with