;+ ; NAME: fixnanfits ; PURPOSE: ; given the name of a fits file, open that file, fix all the NaN pixels ; in it by interpolating from the nearest neighbors, then re-save the file ; ; INPUTS: ; fitsname a filename of a FITS image ; KEYWORDS: ; OUTPUTS: ; ; HISTORY: ; Began 2003-03-10 11:04:26 by Marshall Perrin ;- pro fixnanfits,fitsname image = readfits(fitsname,header) fixpix,image,0,outimage,/NaN sxaddhist, "FIXNANFITS: interpolated values for NaN pixels",header writefits,fitsname,outimage,header print,"Wrote "+fitsname+" with no remaining NaN pixels" end