# First set the list variable (without an @) before running this macro: # e.g. list = # Then set the BPM field to point to the swarp-derived weight images while (fscan (list, s1) != EOF) { s2 = ""; hselect (s1, "bpm", yes) | scan (s2) if (s2 == "") next printf ("%s %s\n", s1, s2) # imexpr ("b>0?a : -10000", pix, s1, s2) imexpr ("b>0?a : -10000", "tmp.fits", s1, s2) delete (s1) imrename ("tmp.fits", s1) } list = ""