Index: trunk/psphot/src/psphotTest.c
===================================================================
--- trunk/psphot/src/psphotTest.c	(revision 5672)
+++ trunk/psphot/src/psphotTest.c	(revision 5837)
@@ -3,32 +3,34 @@
 int main (int argc, char **argv) {
 
-    bool status;
+    char line[80];
+    psImage *image;
 
-    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];
+    image = psImageAlloc (512, 512, PS_DATA_F32);
+    for (int j = 0; j < 512; j++) {
+	for (int i = 0; i < 512; i++) {
+	    image->data.F32[j][i] = i;
+	}
     }
 
-    psArray *contour = pmSourceContour_EAM (imdata->image, x, y, threshold);
-    if (contour == NULL) {
-	fprintf (stderr, "error: invalid contour\n");
-	exit (1);
+    psMetadata *row = NULL;
+
+    psArray *table = psArrayAlloc (100);
+    table->n = 0;
+    
+    for (int i = 0; i < 100; i++) {
+	row = psMetadataAlloc ();
+	sprintf (line, "line %03d", i);
+	psMetadataAdd (row, PS_LIST_HEAD, "FLOAT_DATA", PS_DATA_F32,    "", 0.2*i);
+	psMetadataAdd (row, PS_LIST_HEAD, "INT_DATA",   PS_DATA_S32,    "", i);
+	psMetadataAdd (row, PS_LIST_HEAD, "CHAR_DATA",  PS_DATA_STRING, "", line);
+	psArrayAdd (table, 100, row);
+	// psFree (row);
     }
 
-    psVector *xV = contour->data[0];
-    psVector *yV = contour->data[1];
+    psFits *fits = psFitsOpen ("test.fits", "w");
+    psFitsWriteImage (fits, NULL, image, 0);
+    psFitsWriteTable (fits, NULL, table);
+    psFitsClose (fits);
 
-    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);
 }
