Index: trunk/psphot/src/psphotImageQuality.c
===================================================================
--- trunk/psphot/src/psphotImageQuality.c	(revision 28013)
+++ trunk/psphot/src/psphotImageQuality.c	(revision 29936)
@@ -13,6 +13,5 @@
     psAssert (recipe, "missing recipe?");
 
-    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
-    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
+    int num = psphotFileruleCount(config, filerule);
 
     // skip the chisq image (optionally?)
@@ -99,9 +98,9 @@
         // r^2 sin(2t) = r^2 2 cos t sin t = 2 x y
 
-        // r^2 cos(3t) = r^2 cos^3 t - r^2 3 cos t sin^2 t = (x^3 - 3 x y^2) / r
-        // r^2 sin(3t) = r^2 3 cos^2 t sin t - sin^3 t = (3 x^2 y - y^3) / r
-
-        // r^2 cos(4t) = r^2 cos^4 t - r^2 6 cos^2 t sin^2 t + r^2 sin^4 t = (x^4 - 6 x^2 y^2 + y^4) / r^2
-        // r^2 sin(4t) = r^2 4 cos^3 t sin t - 4 sin^3 t cos t = (4 x^3 y - 4 y^3 x) / r^2
+        // r^3 cos(3t) = r^3 cos^3 t - r^2 3 cos t sin^2 t = (x^3 - 3 x y^2)
+        // r^3 sin(3t) = r^3 3 cos^2 t sin t - sin^3 t = (3 x^2 y - y^3)
+
+        // r^4 cos(4t) = r^4 cos^4 t - r^2 6 cos^2 t sin^2 t + r^2 sin^4 t = (x^4 - 6 x^2 y^2 + y^4)
+        // r^4 sin(4t) = r^4 4 cos^3 t sin t - 4 sin^3 t cos t = (4 x^3 y - 4 y^3 x)
 
         num++;
