Index: trunk/ppSim/src/ppSimInsertGalaxies.c
===================================================================
--- trunk/ppSim/src/ppSimInsertGalaxies.c	(revision 34083)
+++ trunk/ppSim/src/ppSimInsertGalaxies.c	(revision 34261)
@@ -76,5 +76,5 @@
     if (type == -1) {
 	psError (PS_ERR_UNKNOWN, false, "invalid model name");
-        return false;
+	return false;
     }
 
@@ -136,10 +136,16 @@
 	PAR[PM_PAR_YPOS] = yChip;
 
-	psEllipseAxes axes;
-        axes.major       = galaxy->Rmaj;
-        axes.minor       = galaxy->Rmin;
-        axes.theta       = galaxy->theta;
-	pmPSF_AxesToModel (PAR, axes, type);
-	psF64 Area = 2.0 * M_PI * axes.major * axes.minor;
+	if (type == pmModelClassGetType ("PS_MODEL_TRAIL")) {
+	    PAR[PM_PAR_LENGTH] = galaxy->Rmaj;
+	    PAR[PM_PAR_SIGMA]  = galaxy->Rmin;
+	    PAR[PM_PAR_THETA]  = galaxy->theta;
+	} else {
+	    psEllipseAxes axes;
+	    axes.major       = galaxy->Rmaj;
+	    axes.minor       = galaxy->Rmin;
+	    axes.theta       = galaxy->theta;
+	    pmPSF_AxesToModel (PAR, axes, type);
+	}
+	psF64 Area = 2.0 * M_PI * galaxy->Rmaj * galaxy->Rmin;
 
 	if (nParam == 8) {
@@ -147,10 +153,8 @@
 	}
 
-	// set the normalization to get the desired flux
-	// XXX for now, use peak: pmModelSetFlux (model, galaxy->flux);
-
 	// XXX let the flux limit be a user-defined number of sky sigmas (not just 1.0)
 	float radius = model->modelRadius (model->params, 0.1*roughNoise);
 	radius = PS_MAX (radius, 1.0);
+
 	// XXX the exp(-r^0.25) models can go way out if allowed...
 	radius = PS_MIN (radius, 300.0); 
@@ -176,5 +180,5 @@
 
 	float par8 = (model->params->n == 8) ? model->params->data.F32[7] : 0.0;
-	fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f\n", galaxy->x, galaxy->y, flux, 1, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8);
+	fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f\n", galaxy->x, galaxy->y, flux, 1, source->psfMag, source->psfMagErr, galaxy->Rmaj, galaxy->Rmin, galaxy->theta, par8);
 
 	psArrayAdd (sources, 100,source);
