Index: trunk/psphot/src/psphotTest.c
===================================================================
--- trunk/psphot/src/psphotTest.c	(revision 5654)
+++ trunk/psphot/src/psphotTest.c	(revision 5672)
@@ -3,5 +3,32 @@
 int main (int argc, char **argv) {
 
-  psSparseMatrixTest ();
+    bool status;
 
+    psMetadata *config = psphotTestArguments (&argc, argv);
+    eamReadout *imdata = psphotSetup (config);
+
+    int x = psMetadataLookupF32 (&status, config, "TEST_FIT_X");
+    int y = psMetadataLookupF32 (&status, config, "TEST_FIT_Y");
+    float fraction = psMetadataLookupF32 (&status, config, "TEST_FRACTION");
+    float threshold = psMetadataLookupF32 (&status, config, "TEST_THRESHOLD");
+
+    if (threshold == -1) {
+	threshold = fraction * imdata->image->data.F32[y][x];
+    }
+
+    psArray *contour = pmSourceContour_EAM (imdata->image, x, y, threshold);
+    if (contour == NULL) {
+	fprintf (stderr, "error: invalid contour\n");
+	exit (1);
+    }
+
+    psVector *xV = contour->data[0];
+    psVector *yV = contour->data[1];
+
+    for (int i = 0; i < xV->n; i++) {
+	fprintf (stdout, "%d %f %f\n", i, xV->data.F32[i], yV->data.F32[i]);
+    }
+
+    // psSparseMatrixTest ();
+    exit (0);
 }
