added nan/inf check in fitsstat.py