Index: /branches/eam_branch_20081214/psphot/src/psphot.h
===================================================================
--- /branches/eam_branch_20081214/psphot/src/psphot.h	(revision 20978)
+++ /branches/eam_branch_20081214/psphot/src/psphot.h	(revision 20979)
@@ -169,4 +169,6 @@
 bool psphotVisualPlotApResid (psArray *sources);
 bool psphotVisualPlotSourceSize (psArray *sources);
+bool psphotVisualShowCRMask (psVector *xf, psVector *yf);
+bool psphotVisualShowSNLimit (pmReadout *readout, float limit);
 
 bool psphotImageQuality (psMetadata *recipe, psArray *sources);
Index: /branches/eam_branch_20081214/psphot/src/psphotVisual.c
===================================================================
--- /branches/eam_branch_20081214/psphot/src/psphotVisual.c	(revision 20978)
+++ /branches/eam_branch_20081214/psphot/src/psphotVisual.c	(revision 20979)
@@ -1382,4 +1382,67 @@
 }
 
+bool psphotVisualShowCRMask (psVector *xf, psVector *yf) {
+
+    int Noverlay;
+    KiiOverlay *overlay;
+  
+    if (!isVisual) return true;
+
+    if (kapa == -1) {
+	fprintf (stderr, "kapa not opened, skipping\n");
+	return false;
+    }
+
+    // note: this uses the Ohana allocation tools:
+    // ALLOCATE (overlay, KiiOverlay, 3*peaks->n + 1);
+    ALLOCATE (overlay, KiiOverlay, xf->n);
+
+    Noverlay = 0;
+    for (int i = 0; i < xf->n; i++) {
+	overlay[Noverlay].type = KII_OVERLAY_CIRCLE;
+	overlay[Noverlay].x = xf->data.F32[i];
+	overlay[Noverlay].y = yf->data.F32[i];
+	overlay[Noverlay].dx = 0.5;
+	overlay[Noverlay].dy = 0.5;
+	overlay[Noverlay].angle = 0.0;
+	overlay[Noverlay].text = NULL;
+	Noverlay ++;
+    }
+
+    KiiLoadOverlay (kapa, overlay, Noverlay, "red");
+    FREE (overlay);
+
+    KiiCenter (kapa, xf->data.F32[0], yf->data.F32[0], 0.0);
+
+    // pause and wait for user input:
+    // continue, save (provide name), ??
+    char key[10];
+    fprintf (stdout, "[c]ontinue? ");
+    if (!fgets(key, 8, stdin)) {
+	psWarning("Unable to read option");
+    }
+    return true;
+}
+
+bool psphotVisualShowSNLimit (pmReadout *readout, float limit) {
+
+    if (!isVisual) return true;
+
+    if (kapa == -1) {
+	fprintf (stderr, "kapa not opened, skipping\n");
+	return false;
+    }
+
+    psImage *snlimit = psImageAlloc (readout->image->numCols, readout->image->numRows, PS_TYPE_F32);
+    for (int iy = 0; iy < snlimit->numRows; iy++) {
+      for (int ix = 0; ix < snlimit->numCols; ix++) {
+	snlimit->data.F32[iy][ix] = readout->image->data.F32[iy][ix] / sqrt(readout->weight->data.F32[iy][ix]);
+      }
+    }
+    psphotVisualRangeImage (kapa, snlimit, "snlimit", 1, limit, limit + 0.1);
+    psFree (snlimit);
+    return true;
+}
+
 bool psphotVisualShowSourceSize (pmReadout *readout, psArray *sources) {
 
