Index: trunk/psastro/src/psastroConvert.c
===================================================================
--- trunk/psastro/src/psastroConvert.c	(revision 9574)
+++ trunk/psastro/src/psastroConvert.c	(revision 9732)
@@ -8,20 +8,20 @@
     pmReadout *readout;
     pmFPAview *view = pmFPAviewAlloc (0);
- 
+
     while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) {
         psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
         if (!chip->process || !chip->file_exists) { continue; }
 
-	while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
+        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
             psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
             if (!cell->process || !cell->file_exists) { continue; }
 
-	    // process each of the readouts
-	    while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
-		if (! readout->data_exists) { continue; }
+            // process each of the readouts
+            while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
+                if (! readout->data_exists) { continue; }
 
-		psastroConvertReadout (readout, recipe);
-	    }
-	}
+                psastroConvertReadout (readout, recipe);
+            }
+        }
     }
     psFree (view);
@@ -40,5 +40,5 @@
     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS", PS_DATA_ARRAY, "astrometry objects", rawstars);
     psFree (rawstars);
- 
+
     return true;
 }
@@ -47,31 +47,31 @@
 psArray *pmSourceToAstromObj (psArray *sources) {
 
-    psArray *objects = psArrayAlloc (sources->n);
-    
+    psArray *objects = psArrayAllocEmpty (sources->n);
+
     for (int i = 0; i < sources->n; i++) {
-	pmSource *source = sources->data[i];
-	
-	// only accept the PSF sources?
-	if (source->type != PM_SOURCE_TYPE_STAR) continue;
+        pmSource *source = sources->data[i];
 
-	pmModel *model = source->modelPSF;
-	if (model == NULL) continue;
+        // only accept the PSF sources?
+        if (source->type != PM_SOURCE_TYPE_STAR) continue;
 
-	psF32 *PAR = model->params->data.F32;
+        pmModel *model = source->modelPSF;
+        if (model == NULL) continue;
 
-	pmAstromObj *obj = pmAstromObjAlloc ();
+        psF32 *PAR = model->params->data.F32;
 
-	// is the source magnitude calibrated in any sense?
-	obj->pix->x = PAR[2];
-	obj->pix->y = PAR[3];
-	obj->Mag = source->psfMag;
+        pmAstromObj *obj = pmAstromObjAlloc ();
 
-	// XXX do we have the information giving the readout and cell offset?
-	// for the moment, assume chip == cell == readout
-	*obj->cell = *obj->pix;
-	*obj->chip = *obj->cell;
+        // is the source magnitude calibrated in any sense?
+        obj->pix->x = PAR[2];
+        obj->pix->y = PAR[3];
+        obj->Mag = source->psfMag;
 
-	psArrayAdd (objects, 100, obj);
-	psFree (obj);
+        // XXX do we have the information giving the readout and cell offset?
+        // for the moment, assume chip == cell == readout
+        *obj->cell = *obj->pix;
+        *obj->chip = *obj->cell;
+
+        psArrayAdd (objects, 100, obj);
+        psFree (obj);
     }
     return objects;
