Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimArguments.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimArguments.c	(revision 43067)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimArguments.c	(revision 43068)
@@ -48,4 +48,5 @@
     psMetadataAddF32(arguments,  PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
     psMetadataAddF32(arguments,  PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-mjd-obs", 0, "MJD of observation", NAN);
     psMetadataAddF32(arguments,  PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
     psMetadataAddF32(arguments,  PS_LIST_TAIL, "-seeing-max", 0, "Seeing FWHM (arcsec) at end of ramp", NAN);
@@ -203,4 +204,7 @@
     ppSimArgToRecipeS32(&status,  options, "BINNING",       arguments, "-bin");
 
+    // add MJD of observation if defined
+    ppSimArgToRecipeF32(&status,  options, "MJD.OBS",       arguments, "-mjd-obs"); // time/date of observation
+
     ppSimArgToRecipeS32(&status,  config->arguments, "NX.CELL", arguments, "-nx");
     ppSimArgToRecipeS32(&status,  config->arguments, "NY.CELL", arguments, "-ny");
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimInsertStars.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimInsertStars.c	(revision 43067)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimInsertStars.c	(revision 43068)
@@ -31,4 +31,7 @@
     float nSigmaLim = psMetadataLookupF32(NULL, recipe, "STARS.SIGMA.LIM"); // significance of faintest stars
 
+    char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // 
+    char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // 
+
     float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e
     if (isnan(readnoise)) {
@@ -62,6 +65,8 @@
     assert (psf);
 
+    // EAM : I think this dX,dY double-counts the offset applied to xChip,yChip in pmSourceFromModel
     int dX = PM_CELL_TO_CHIP (0.0, x0Cell, xParityCell, binning);
     int dY = PM_CELL_TO_CHIP (0.0, y0Cell, yParityCell, binning);
+    dX = 0; dY = 0;
 
     psArray *sources = psArrayAllocEmpty (stars->n);
@@ -70,5 +75,5 @@
     char outname[1024];
     char *outroot = psMetadataLookupStr(&mdok, config->arguments, "OUTPUT");
-    sprintf (outname, "%s.dat", outroot);
+    sprintf (outname, "%s.%s.%s.dat", outroot, chipName, cellName);
 
     FILE *outfile = fopen (outname, "w");
@@ -81,6 +86,4 @@
     for (long i = 0; i < stars->n; i++) {
         ppSimStar *star = stars->data[i];
-        psTrace("ppSim", 10, "Inserting star at %.1f,%.1f --> %.2f\n", star->x, star->y, star->flux);
-
         // star->x,y are in fpa coordinates
 
@@ -92,4 +95,6 @@
         float xCell = PM_CHIP_TO_CELL(xChip, x0Cell, xParityCell, binning);
         float yCell = PM_CHIP_TO_CELL(yChip, y0Cell, yParityCell, binning);
+
+        psTrace("ppSim", 10, "Inserting star at %.1f %.1f --> %.2f : %.1f %.1f : %.1f %.1f\n", star->x, star->y, star->flux, xChip, yChip, xCell, yCell);
 
         // XXX Note, the below does not put the edges of stars on the readout if they fall slightly off
@@ -105,4 +110,5 @@
 
 	// instantiate a model for the PSF at this location, set desired flux
+	// EAM : we use xChip,yChip here, corrected to xCell,yCell in pmSourceFromModel
 	pmModel *model = pmModelFromPSFforXY (psf, xChip, yChip, 1.0);
 	pmModelSetFlux (model, flux);
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimLoadStars.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimLoadStars.c	(revision 43067)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimLoadStars.c	(revision 43068)
@@ -37,8 +37,6 @@
     psFree(bounds);
 
-    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "RA_MIN",  PS_DATA_F32 | PS_META_REPLACE, "",
-                  ra0 - radius / cos(dec0));
-    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "RA_MAX",  PS_DATA_F32 | PS_META_REPLACE, "",
-                  ra0 + radius / cos(dec0));
+    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "RA_MIN",  PS_DATA_F32 | PS_META_REPLACE, "", ra0 - radius / cos(dec0));
+    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "RA_MAX",  PS_DATA_F32 | PS_META_REPLACE, "", ra0 + radius / cos(dec0));
     psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MIN", PS_DATA_F32 | PS_META_REPLACE, "", dec0 - radius);
     psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MAX", PS_DATA_F32 | PS_META_REPLACE, "", dec0 + radius);
@@ -83,5 +81,5 @@
         stars->data[oldSize + i] = star;
 
-        psTrace("ppSim", 10, "Adding catalogue star: %.1f,%.1f --> %.2f\n", star->x, star->y, star->flux);
+        psTrace("ppSim", 10, "Adding catalogue star: %10.6f %10.6f : %.1f %.1f --> %.2f\n", star->ra, star->dec, star->x, star->y, star->flux);
     }
     stars->n = oldSize + refStars->n;
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimMakeBias.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimMakeBias.c	(revision 43067)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimMakeBias.c	(revision 43068)
@@ -16,5 +16,5 @@
     float biasLevel = psMetadataLookupF32(NULL, recipe, "BIAS.LEVEL"); // Bias level
     float biasRange = psMetadataLookupF32(NULL, recipe, "BIAS.RANGE"); // Bias range
-    int biasOrder   = psMetadataLookupS32(NULL, recipe, "BIAS.ORDER"); // Bias order
+    int   biasOrder = psMetadataLookupS32(NULL, recipe, "BIAS.ORDER"); // Bias order
 
     float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e
@@ -40,12 +40,19 @@
         biasPoly->coeff[j] = biasRange * psRandomGaussian(rng);
     }
+    // polynomial is evaluated for the range 0 - numRows
+    biasPoly->scale[0] = +2.0 / numRows;
+    biasPoly->zero[0]  = -1.0;
+    // 0 -> -1, numRows -> 1.0
 
     psVector *biasRows = psVectorAlloc(numRows, PS_TYPE_F32); // Bias value, per row
-    int biasOffset = 0.5 * numRows * psRandomUniform(rng); // Offset to prevent common pattern
+
+    // ??? int biasOffset = 0.5 * numRows * psRandomUniform(rng); // Offset to prevent common pattern
 
     for (int y = 0; y < numRows; y++) {
         // Adjust bias level for this row
-        biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) /
-                                                  (float)numRows - 0.5) + biasLevel;
+	biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, y) + biasLevel;
+
+	// old version:
+	// biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) / (float)numRows - 0.5) + biasLevel;
 
         for (int x = 0; x < numCols; x++) {
@@ -62,2 +69,11 @@
 }
 
+/* This function introduces a polynomial variation in the bias signal as 
+   a function of the row number.  
+
+   BIAS.LEVEL : pedestal value for the bias
+   BIAS.RANGE : max amplitude of the bias variation
+   BIAS.ORDER : order of the Chebyshev polynomial in the y-dir
+
+*/
+
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceObject.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceObject.c	(revision 43067)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceObject.c	(revision 43068)
@@ -23,4 +23,7 @@
     float IQmin = psMetadataLookupF32 (&status, sequence, "IQ_MIN");
     float IQmax = psMetadataLookupF32 (&status, sequence, "IQ_MAX");
+
+    float MJDmin = psMetadataLookupF32 (&status, sequence, "MJD_MIN");
+    float MJDmax = psMetadataLookupF32 (&status, sequence, "MJD_MAX");
 
     if (filters->n != exptimes->n) {
@@ -101,6 +104,9 @@
 			    double frnd = psRandomUniform(rng);
 			    float seeing = IQmin + (IQmax - IQmin)*frnd;
-	                  
 			    psStringAppend (&command, " -seeing %f", seeing);
+
+			    double dtime = (MJDmax - MJDmin)*psRandomUniform(rng);
+			    float MJDobs = MJDmin + dtime;
+			    psStringAppend (&command, " -mjd-obs %f", MJDobs);
 
 			    psStringAppend (&command, " %s", filename);
Index: /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimUtils.c
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimUtils.c	(revision 43067)
+++ /branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimUtils.c	(revision 43068)
@@ -134,4 +134,6 @@
     float zeropoint = psMetadataLookupF32(NULL, recipe, "ZEROPOINT"); // Detector Temperature
 
+    float MJDobs    = psMetadataLookupF32(NULL, recipe, "MJD.OBS"); // observation MJD
+
     const char *filter = psMetadataLookupStr(NULL, recipe, "FILTER"); // Filter name
     if (!filter) {
@@ -156,6 +158,6 @@
     psMetadataAddF32(fpa->concepts, PS_LIST_TAIL, "FPA.ZP",        PS_META_REPLACE, "Zero Point", zeropoint);
 
-    // test time 
-    psTime *obstime = psTimeFromMJD (55440.0);
+    // set time of the observation
+    psTime *obstime = isfinite(MJDobs) ? psTimeFromMJD (MJDobs) : psTimeFromMJD (60000.0);
     psMetadataAddTime(fpa->concepts, PS_LIST_TAIL, "FPA.TIME", PS_META_REPLACE, "sample time", obstime);
 
