Index: /branches/eam_branches/20091201/psphot/src/psphotOutput.c
===================================================================
--- /branches/eam_branches/20091201/psphot/src/psphotOutput.c	(revision 26421)
+++ /branches/eam_branches/20091201/psphot/src/psphotOutput.c	(revision 26422)
@@ -183,83 +183,82 @@
 psMetadata *psphotDefineHeader (psMetadata *recipe) {
 
+    bool status = true;
+
     psMetadata *header = psMetadataAlloc ();
 
     // write necessary information to output header
-    psMetadataItemSupplement (header, recipe, "ZERO_PT");
-    psMetadataItemSupplement (header, recipe, "PHOTCODE");
-
-    psMetadataItemSupplement (header, recipe, "APMIFIT");
-    psMetadataItemSupplement (header, recipe, "DAPMIFIT");
-    psMetadataItemSupplement (header, recipe, "NAPMIFIT");
+    psMetadataItemSupplement (&status, header, recipe, "ZERO_PT");
+    psMetadataItemSupplement (&status, header, recipe, "PHOTCODE");
+
+    psMetadataItemSupplement (&status, header, recipe, "APMIFIT");
+    psMetadataItemSupplement (&status, header, recipe, "DAPMIFIT");
+    psMetadataItemSupplement (&status, header, recipe, "NAPMIFIT");
 
     // PSF model parameters (shape values for image center)
-    psMetadataItemSupplement (header, recipe, "NPSFSTAR");
-    psMetadataItemSupplement (header, recipe, "APLOSS");
-
-    psMetadataItemSupplement (header, recipe, "FWHM_MAJ");
-    psMetadataItemSupplement (header, recipe, "FW_MJ_SG");
-    psMetadataItemSupplement (header, recipe, "FW_MJ_LQ");
-    psMetadataItemSupplement (header, recipe, "FW_MJ_UQ");
-
-    psMetadataItemSupplement (header, recipe, "FWHM_MIN");
-    psMetadataItemSupplement (header, recipe, "FW_MN_SG");
-    psMetadataItemSupplement (header, recipe, "FW_MN_LQ");
-    psMetadataItemSupplement (header, recipe, "FW_MN_UQ");
-
-    psMetadataItemSupplement (header, recipe, "ANGLE");
+    psMetadataItemSupplement (&status, header, recipe, "NPSFSTAR");
+    psMetadataItemSupplement (&status, header, recipe, "APLOSS");
+
+    psMetadataItemSupplement (&status, header, recipe, "FWHM_MAJ");
+    psMetadataItemSupplement (&status, header, recipe, "FW_MJ_SG");
+    psMetadataItemSupplement (&status, header, recipe, "FW_MJ_LQ");
+    psMetadataItemSupplement (&status, header, recipe, "FW_MJ_UQ");
+
+    psMetadataItemSupplement (&status, header, recipe, "FWHM_MIN");
+    psMetadataItemSupplement (&status, header, recipe, "FW_MN_SG");
+    psMetadataItemSupplement (&status, header, recipe, "FW_MN_LQ");
+    psMetadataItemSupplement (&status, header, recipe, "FW_MN_UQ");
+
+    psMetadataItemSupplement (&status, header, recipe, "ANGLE");
 
     // Image Quality measurements
-    psMetadataItemSupplement (header, recipe, "IQ_NSTAR");
-
-    psMetadataItemSupplement (header, recipe, "IQ_FW1");
-    psMetadataItemSupplement (header, recipe, "IQ_FW1_E");
-    psMetadataItemSupplement (header, recipe, "IQ_FW2");
-    psMetadataItemSupplement (header, recipe, "IQ_FW2_E");
-
-    psMetadataItemSupplement (header, recipe, "IQ_M2");
-    psMetadataItemSupplement (header, recipe, "IQ_M2_ER");
-    psMetadataItemSupplement (header, recipe, "IQ_M2_LQ");
-    psMetadataItemSupplement (header, recipe, "IQ_M2_UQ");
-
-    psMetadataItemSupplement (header, recipe, "IQ_M2C");
-    psMetadataItemSupplement (header, recipe, "IQ_M2C_E");
-    psMetadataItemSupplement (header, recipe, "IQ_M2C_L");
-    psMetadataItemSupplement (header, recipe, "IQ_M2C_U");
-
-    psMetadataItemSupplement (header, recipe, "IQ_M2S");
-    psMetadataItemSupplement (header, recipe, "IQ_M2S_E");
-    psMetadataItemSupplement (header, recipe, "IQ_M2S_L");
-    psMetadataItemSupplement (header, recipe, "IQ_M2S_U");
-
-    psMetadataItemSupplement (header, recipe, "IQ_M3");
-    psMetadataItemSupplement (header, recipe, "IQ_M3_ER");
-    psMetadataItemSupplement (header, recipe, "IQ_M3_LQ");
-    psMetadataItemSupplement (header, recipe, "IQ_M3_UQ");
-
-    psMetadataItemSupplement (header, recipe, "IQ_M4");
-    psMetadataItemSupplement (header, recipe, "IQ_M4_ER");
-    psMetadataItemSupplement (header, recipe, "IQ_M4_LQ");
-    psMetadataItemSupplement (header, recipe, "IQ_M4_UQ");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_NSTAR");
+
+    psMetadataItemSupplement (&status, header, recipe, "IQ_FW1");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_FW1_E");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_FW2");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_FW2_E");
+
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2_ER");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2_LQ");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2_UQ");
+
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2C");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2C_E");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2C_L");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2C_U");
+
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2S");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2S_E");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2S_L");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M2S_U");
+
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M3");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M3_ER");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M3_LQ");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M3_UQ");
+
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M4");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M4_ER");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M4_LQ");
+    psMetadataItemSupplement (&status, header, recipe, "IQ_M4_UQ");
 
     // XXX these need to be defined from elsewhere
     psMetadataAdd (header, PS_LIST_TAIL, "FSATUR",   PS_DATA_F32 | PS_META_REPLACE, "SATURATION MAG",      0.0);
     psMetadataAdd (header, PS_LIST_TAIL, "FLIMIT",   PS_DATA_F32 | PS_META_REPLACE, "COMPLETENESS MAG",    0.0);
-    psMetadataItemSupplement (header, recipe, "NSTARS");
-
-    psMetadataItemSupplement (header, recipe, "NDET_EXT");
-    psMetadataItemSupplement (header, recipe, "NDET_CR");
+    psMetadataItemSupplement (&status, header, recipe, "NSTARS");
+
+    psMetadataItemSupplement (&status, header, recipe, "NDET_EXT");
+    psMetadataItemSupplement (&status, header, recipe, "NDET_CR");
 
     // sky background model statistics
-    psMetadataItemSupplement (header, recipe, "MSKY_MN");
-    psMetadataItemSupplement (header, recipe, "MSKY_SIG");
-    psMetadataItemSupplement (header, recipe, "MSKY_MIN");
-    psMetadataItemSupplement (header, recipe, "MSKY_MAX");
-    psMetadataItemSupplement (header, recipe, "MSKY_NX");
-    psMetadataItemSupplement (header, recipe, "MSKY_NY");
+    psMetadataItemSupplement (&status, header, recipe, "MSKY_MN");
+    psMetadataItemSupplement (&status, header, recipe, "MSKY_SIG");
+    psMetadataItemSupplement (&status, header, recipe, "MSKY_MIN");
+    psMetadataItemSupplement (&status, header, recipe, "MSKY_MAX");
+    psMetadataItemSupplement (&status, header, recipe, "MSKY_NX");
+    psMetadataItemSupplement (&status, header, recipe, "MSKY_NY");
 
     psMetadataAddF32 (header, PS_LIST_TAIL, "DT_PHOT", PS_META_REPLACE, "elapsed psphot time", psTimerMark ("psphotReadout"));
-
-    // XXX : don't require any of these about values to exist
-    psErrorClear ();
 
     return header;
