Index: branches/pap/psModules/src/objects/pmSourceUtils.c
===================================================================
--- branches/pap/psModules/src/objects/pmSourceUtils.c	(revision 23948)
+++ branches/pap/psModules/src/objects/pmSourceUtils.c	(revision 25027)
@@ -94,24 +94,35 @@
     source->peak = pmPeakAlloc (xChip, yChip, Io, PM_PEAK_LONE);
 
-    int x0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0");
-    int y0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0");
-    int xParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.XPARITY");
-    int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY");
+    float xReadout, yReadout;
 
-    // XXX fix the binning : currently not selected from concepts
-    // int xBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.XBIN"); // Binning in x and y
-    // int yBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.YBIN"); // Binning in x and y
-    int xBin = 1;
-    int yBin = 1;
+    // if we have information about the chip & cell, adjust the coordinates chip->cell->readout
+    // otherwise, assume 0,0 offset and 1,1 parity
+    if (cell) {
+      int x0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0");
+      int y0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0");
+      int xParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.XPARITY");
+      int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY");
 
-    // Position on the cell 
-    float xCell = PM_CHIP_TO_CELL(xChip, x0Cell, xParityCell, xBin);
-    float yCell = PM_CHIP_TO_CELL(yChip, y0Cell, yParityCell, yBin);
+      // XXX fix the binning : currently not selected from concepts
+      // int xBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.XBIN"); // Binning in x and y
+      // int yBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.YBIN"); // Binning in x and y
+      int xBin = 1;
+      int yBin = 1;
 
-    // Position on the readout
-    // float xReadout = CELL_TO_READOUT(xCell, x0Readout);
-    // float yReadout = CELL_TO_READOUT(yCell, y0Readout);
+      // Position on the cell 
+      float xCell = PM_CHIP_TO_CELL(xChip, x0Cell, xParityCell, xBin);
+      float yCell = PM_CHIP_TO_CELL(yChip, y0Cell, yParityCell, yBin);
+
+      // Position on the readout
+      // float xReadout = CELL_TO_READOUT(xCell, x0Readout);
+      // float yReadout = CELL_TO_READOUT(yCell, y0Readout);
+      xReadout = xCell;
+      yReadout = yCell;
+    } else {
+      xReadout = xChip;
+      yReadout = yChip;
+    }
     
-    pmSourceDefinePixels (source, readout, xCell, yCell, radius);
+    pmSourceDefinePixels (source, readout, xReadout, yReadout, radius);
 
     return (source);
