Index: /branches/eam_branches/20091113/ippconfig/gpc1/psastro.config
===================================================================
--- /branches/eam_branches/20091113/ippconfig/gpc1/psastro.config	(revision 26252)
+++ /branches/eam_branches/20091113/ippconfig/gpc1/psastro.config	(revision 26253)
@@ -117,6 +117,6 @@
 ZERO.POINT.USE.MEAN	      	BOOL     FALSE
 ZERO.POINT.EDGE.FRACTION      	F32      0.9
-ZERO.POINT.EDGE.SAMPLE        	S32      15
-ZERO.POINT.EDGE.SAMPLE.FRACTION F32      0.5
+ZERO.POINT.EDGE.SAMPLE        	S32      25
+ZERO.POINT.EDGE.SAMPLE.FRACTION F32      0.1
 
 PHOTCODE.DATA MULTI
Index: /branches/eam_branches/20091113/ippconfig/recipes/psastro.config
===================================================================
--- /branches/eam_branches/20091113/ippconfig/recipes/psastro.config	(revision 26252)
+++ /branches/eam_branches/20091113/ippconfig/recipes/psastro.config	(revision 26253)
@@ -173,6 +173,6 @@
 ZERO.POINT.USE.MEAN	      	BOOL     TRUE
 ZERO.POINT.EDGE.FRACTION      	F32      0.9
-ZERO.POINT.EDGE.SAMPLE        	S32      15
-ZERO.POINT.EDGE.SAMPLE.FRACTION F32      0.5
+ZERO.POINT.EDGE.SAMPLE        	S32      10
+ZERO.POINT.EDGE.SAMPLE.FRACTION F32      0.1
 
 ZPTEST METADATA
Index: /branches/eam_branches/20091113/psastro/src/psastroZeroPoint.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroZeroPoint.c	(revision 26252)
+++ /branches/eam_branches/20091113/psastro/src/psastroZeroPoint.c	(revision 26253)
@@ -94,4 +94,9 @@
     if (byExposure) {
 	psMetadata *header = psMetadataLookupMetadata (&status, fpa->analysis, "PSASTRO.HEADER");
+	if (!header) {
+	  header = psMetadataAlloc ();
+	  psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", header);
+	  psFree (header);
+	}
 	psastroZeroPointAnalysis (header, dMag, zeropt, recipe);
 	psFree (dMag);
@@ -184,5 +189,5 @@
 }
 
-#define MAG_RESOLUTION 0.001
+#define MAG_RESOLUTION 0.0002
 
 // set the bin closest to the corresponding value.  if USE_END is +/- 1,
@@ -304,5 +309,5 @@
     psTrace("psastro", 6, "subset stats: Sum: %f, S2: %f, Npts: %d\n", Sum, S2, edgeSample);
 
-    stats->clippedStdev = sqrt(S2 / edgeSample - PS_SQR(Sum/edgeSample));
+    stats->clippedStdev = PS_MAX (sqrt(S2 / edgeSample - PS_SQR(Sum/edgeSample)), MAG_RESOLUTION);
     psTrace("psastro", 5, "percentile stats %f +/- %f\n", stats->clippedMean, stats->clippedStdev);
 
