Index: trunk/magic/remove/src/isdestreaked.c
===================================================================
--- trunk/magic/remove/src/isdestreaked.c	(revision 26457)
+++ trunk/magic/remove/src/isdestreaked.c	(revision 26477)
@@ -1,3 +1,5 @@
 #include "streaksremove.h"
+
+char *streaksProgram = "isdestreaked";
 
 int
Index: trunk/magic/remove/src/streaksVersion.c
===================================================================
--- trunk/magic/remove/src/streaksVersion.c	(revision 26457)
+++ trunk/magic/remove/src/streaksVersion.c	(revision 26477)
@@ -38,5 +38,5 @@
     psString source = streaksSource();    // Source
 
-    psStringPrepend(&version, "streaks ");
+    psStringPrepend(&version, "%s ", streaksProgram);
     psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
     psFree(source);
@@ -58,6 +58,6 @@
     psString source = streaksSource();   // Software source
 
-    psStringPrepend(&version, "streaks version: ");
-    psStringPrepend(&source, "streaks source: ");
+    psStringPrepend(&version, "%s version: ", streaksProgram);
+    psStringPrepend(&source, "%s source: ", streaksProgram);
 
     psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version);
@@ -78,5 +78,5 @@
     psFree(time);
     psString history = NULL;               // History string
-    psStringAppend(&history, "streaks at %s", timeString);
+    psStringAppend(&history, "%s at %s", streaksProgram, timeString);
     psFree(timeString);
     psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history);
@@ -95,5 +95,5 @@
     psString timeString = psTimeToISO(time); // The time in an ISO string
     psFree(time);
-    psLogMsg("streaks", PS_LOG_INFO, "streaks at %s", timeString);
+    psLogMsg("streaks", PS_LOG_INFO, "%s at %s", streaksProgram, timeString);
     psFree(timeString);
 
Index: trunk/magic/remove/src/streaksastrom.c
===================================================================
--- trunk/magic/remove/src/streaksastrom.c	(revision 26457)
+++ trunk/magic/remove/src/streaksastrom.c	(revision 26477)
@@ -379,6 +379,5 @@
 {
     if (!pmAstromLinearizeTransforms((pmFPA *) astrom->fpa, (pmChip *) astrom->chip)) {
-        // streaksExit("linear fit to astrometry failed\n", PS_EXIT_UNKNOWN_ERROR);
-        psError(PS_ERR_UNKNOWN, false, "linear fit to astrometry failed ignoring");
+        psErrorStackPrint(stderr, "linear fit to astrometry failed. ignoring\n");
         return false;
     }
Index: trunk/magic/remove/src/streakscompare.c
===================================================================
--- trunk/magic/remove/src/streakscompare.c	(revision 26457)
+++ trunk/magic/remove/src/streakscompare.c	(revision 26477)
@@ -1,3 +1,5 @@
 #include "streaksremove.h"
+
+char *streaksProgram = "streakscompare";
 
 static pmConfig * parseArguments(int, char **);
Index: trunk/magic/remove/src/streaksio.c
===================================================================
--- trunk/magic/remove/src/streaksio.c	(revision 26457)
+++ trunk/magic/remove/src/streaksio.c	(revision 26477)
@@ -404,4 +404,5 @@
 addDestreakKeyword(psMetadata *header)
 {
+    streaksVersionHeaderFull(header);
     psMetadataAddBool(header, PS_LIST_TAIL, "PSDESTRK", PS_META_REPLACE,
         "Have streaks been removed from image?", true);
@@ -411,4 +412,5 @@
 addRecoveryKeyword(psMetadata *header)
 {
+    streaksVersionHeaderFull(header);
     psMetadataAddBool(header, PS_LIST_TAIL, "PSRECOVR", PS_META_REPLACE,
         "Does this image contain excised streak pixels?", true);
Index: trunk/magic/remove/src/streaksrelease.c
===================================================================
--- trunk/magic/remove/src/streaksrelease.c	(revision 26457)
+++ trunk/magic/remove/src/streaksrelease.c	(revision 26477)
@@ -4,4 +4,6 @@
 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
 static void writeImages(streakFiles *sf, bool exciseImageCube);
+
+char *streaksProgram = "streaksrelease";
 
 int
Index: trunk/magic/remove/src/streaksremove.c
===================================================================
--- trunk/magic/remove/src/streaksremove.c	(revision 26457)
+++ trunk/magic/remove/src/streaksremove.c	(revision 26477)
@@ -20,4 +20,6 @@
 static long censorPixels(streakFiles *sfiles, psImage * pixels, bool checkNonDiffedPixels, psU16 maskStreak);
 
+char *streaksProgram = "streaksremove";
+
 // Note: For clarity the flow of this program is in main().
 // There is not a lot of error checking is done in main.
@@ -109,4 +111,5 @@
     psF64 cs_t = 0;
     psF64 wi_t = 0;
+    psF64 ua_t = 0;
     // Iterate through each component of the input (except for raw images there is only one)
     do {
@@ -182,5 +185,9 @@
             // chip processed files with the data calcuated by psastro at the camera stage
             // (actually we use a linear approximation)
+            psTimerStart("UPDATE_ASTROMETRY");
             updateAstrometry(sfiles);
+            ua_t += psTimerClear("UPDATE_ASTROMETRY");
+            psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "UPDATE_ASTROMETRY", PS_META_REPLACE, "", ua_t);
+            psLogMsg("streaksremove", PS_LOG_INFO, "time to update astrometry: %f\n", ua_t);
         }
 
@@ -544,22 +551,19 @@
 updateAstrometry(streakFiles *sf)
 {
-    // XXX: why do I check this here? Shouldn't it be just around the call to linearizeTransforms?
     if (sf->bilevelAstrometry) {
-
         if (!linearizeTransforms(sf->astrom)) {
-            // fit failed, leave the astrometry unchanged
+            // fit failed, leave the transform in the file unchanged
             return;
         }
-
-        if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
-            psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
-            streaksExit("", PS_EXIT_UNKNOWN_ERROR);
-        }
-        if (sf->outMask) {
-            pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);
-        }
-        if (sf->outWeight) {
-            pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);
-        }
+    }
+    if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
+        streaksExit("", PS_EXIT_UNKNOWN_ERROR);
+    }
+    if (sf->outMask) {
+        pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);
+    }
+    if (sf->outWeight) {
+        pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);
     }
 }
@@ -579,5 +583,4 @@
 readAndCopyToOutput(streakFiles *sf, bool exciseAll)
 {
-    bool    updateAstrometry = false;
     if (sf->inImage->pmfile) {
         // image data from pmFPAfile (diff or warp file)
@@ -597,15 +600,4 @@
         streaksExit("", PS_EXIT_UNKNOWN_ERROR);
     }
-    // For the chip level files, copy the WCS from the astrometry file to the header
-    // XXX: do we want to do this for raw images as well?
-    if (sf->stage == IPP_STAGE_CHIP) {
-        if (!sf->bilevelAstrometry) {
-            updateAstrometry = true;
-            if (!pmAstromWriteWCS(sf->inImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
-                psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
-                streaksExit("", PS_EXIT_UNKNOWN_ERROR);
-            }
-        }
-    }
     sf->outImage->header =  psMemIncrRefCounter(sf->inImage->header);
     if (sf->recImage) {
@@ -640,7 +632,4 @@
             }
             addDestreakKeyword(sf->outMask->header);
-            if (updateAstrometry) {
-                pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);
-            }
             // Note: we don't excise the mask pixels even if exciseAll is true.
             setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false);
@@ -675,7 +664,4 @@
         }
         addDestreakKeyword(sf->outWeight->header);
-        if (updateAstrometry) {
-            pmAstromWriteWCS(sf->inWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);
-        }
         setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll);
 
Index: trunk/magic/remove/src/streaksremove.h
===================================================================
--- trunk/magic/remove/src/streaksremove.h	(revision 26457)
+++ trunk/magic/remove/src/streaksremove.h	(revision 26477)
@@ -33,6 +33,9 @@
     int         yParity;
     double      exciseValue;
+    psString    program;
 } sFile;
 
+// used for error messages
+extern char * streaksProgram;
 
 typedef enum {
@@ -96,4 +99,7 @@
 extern void setStreakFiles( streakFiles *);
 
+extern bool streaksVersionHeaderFull(psMetadata *header);
+extern psString streaksVersionLong(void);
+
 #define CHIP_LEVEL_INPUT(_stage) ((_stage == IPP_STAGE_RAW) || (_stage == IPP_STAGE_CHIP))
 #define USE_SUPPLIED_ASTROM(_stage) CHIP_LEVEL_INPUT(_stage)
Index: trunk/magic/remove/src/streaksreplace.c
===================================================================
--- trunk/magic/remove/src/streaksreplace.c	(revision 26457)
+++ trunk/magic/remove/src/streaksreplace.c	(revision 26477)
@@ -5,4 +5,6 @@
 static void writeImages(streakFiles *sf, bool exciseImageCube);
 static bool readAndCopyToOutput(streakFiles *sf, bool restoreImageCube);
+
+char *streaksProgram = "streaksreplace";
 
 int main(int argc, char *argv[])
