Index: /trunk/psastro/src/psastroMaskUpdates.c
===================================================================
--- /trunk/psastro/src/psastroMaskUpdates.c	(revision 23664)
+++ /trunk/psastro/src/psastroMaskUpdates.c	(revision 23665)
@@ -58,4 +58,5 @@
 
     bool REFSTAR_MASK_REGIONS              = psMetadataLookupBool (&status, recipe, "REFSTAR_MASK_REGIONS");
+    bool REFSTAR_MASK_BLEED                = psMetadataLookupBool (&status, recipe, "REFSTAR_MASK_BLEED");
 
     double REFSTAR_MASK_MAX_MAG            = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_MAX_MAG");
@@ -191,11 +192,12 @@
                 // 2) diffraction spikes in direction ROT - ROTo
                 // 3) bleed trail in the direction of the readout
-
-                // XXX for the moment, let's just generate mana region-file objects in chip pixel space
+		//    update: with 'burntool' applied to the data, the bleed trail mask is not needed.
+
                 for (int i = 0; i < refstars->n; i++) {
                     pmAstromObj *ref = refstars->data[i];
                     if (ref->Mag > REFSTAR_MASK_MAX_MAG) continue;
 
-                    // XXX convert ref->Mag to instrumental mags
+		    // the reference magnitudes have been converted from the instrumental
+		    // values supplied in the recipe to apparent mags (above)
 
                     // CIRCLE around the stars (scaled by magnitude)
@@ -213,5 +215,5 @@
                     // LINE for boundaries of the saturation spikes (scaled by magnitude)
                     float spikeLength = REFSTAR_MASK_SATSPIKE_MAG_SLOPE * (REFSTAR_MASK_SATSPIKE_MAG_MAX - ref->Mag);
-                    float spikeWidth = REFSTAR_MASK_SATSPIKE_WIDTH;
+                    float spikeWidth = 0.5*REFSTAR_MASK_SATSPIKE_WIDTH;
 
                     for (float theta = 0.0; theta < 2*M_PI; theta += M_PI / 2.0) {
@@ -246,27 +248,30 @@
                     }
 
-                    // convert x,y chip coordinates to cells in maskChip
-                    pmCell *refCell = pmCellInChip (refChip, ref->chip->x, ref->chip->y);
-
-                    // LINE for boundaries of the bleed lines
-                    if (REFSTAR_MASK_REGIONS) {
-                      fprintf (f, "LINE %f %f  %f %f\n", ref->chip->x, ref->chip->y, 0.0, -100.0);
-                    }
-
-                    if (readoutMask && refCell) {
-                        float xCell = 0.0;
-                        float yCell = 0.0;
-                        float xEnd = 0.0;
-                        float yEnd = 0.0;
-                        // find coordinate of star on cell
-                        pmCellCoordsForChip (&xCell, &yCell, refCell, ref->chip->x, ref->chip->y);
-                        // find coordinate of end-point on chip
-
-                        int ySize = psMetadataLookupS32(NULL, refCell->concepts, "CELL.YSIZE");
-                        pmChipCoordsForCell (&xEnd, &yEnd, refCell, xCell, ySize);
-
-                        float width = REFSTAR_MASK_BLEED_MAG_SLOPE*(REFSTAR_MASK_BLEED_MAG_MAX - ref->Mag);
-                        psastroMaskRectangle (readoutMask->mask, maskValue, (int) ref->chip->x-0.5*width, (int) ref->chip->y, (int) ref->chip->x+0.5*width+1, yEnd);
-                    }
+		    if (REFSTAR_MASK_BLEED) {
+
+			// convert x,y chip coordinates to cells in maskChip
+			pmCell *refCell = pmCellInChip (refChip, ref->chip->x, ref->chip->y);
+
+			// LINE for boundaries of the bleed lines
+			if (REFSTAR_MASK_REGIONS) {
+			    fprintf (f, "LINE %f %f  %f %f\n", ref->chip->x, ref->chip->y, 0.0, -100.0);
+			}
+
+			if (readoutMask && refCell) {
+			    float xCell = 0.0;
+			    float yCell = 0.0;
+			    float xEnd = 0.0;
+			    float yEnd = 0.0;
+			    // find coordinate of star on cell
+			    pmCellCoordsForChip (&xCell, &yCell, refCell, ref->chip->x, ref->chip->y);
+			    // find coordinate of end-point on chip
+
+			    int ySize = psMetadataLookupS32(NULL, refCell->concepts, "CELL.YSIZE");
+			    pmChipCoordsForCell (&xEnd, &yEnd, refCell, xCell, ySize);
+
+			    float width = REFSTAR_MASK_BLEED_MAG_SLOPE*(REFSTAR_MASK_BLEED_MAG_MAX - ref->Mag);
+			    psastroMaskRectangle (readoutMask->mask, maskValue, (int) ref->chip->x-0.5*width, (int) ref->chip->y, (int) ref->chip->x+0.5*width+1, yEnd);
+			}
+		    }
                 }
             }
