Index: trunk/magic/remove/src/streaksio.c
===================================================================
--- trunk/magic/remove/src/streaksio.c	(revision 21441)
+++ trunk/magic/remove/src/streaksio.c	(revision 21481)
@@ -813,5 +813,5 @@
 // and replicate the files
 
-static bool
+bool
 replicateOutputs(streakFiles *sfiles)
 {
Index: trunk/magic/remove/src/streaksio.h
===================================================================
--- trunk/magic/remove/src/streaksio.h	(revision 21441)
+++ trunk/magic/remove/src/streaksio.h	(revision 21481)
@@ -27,4 +27,5 @@
 void setMaskedToNAN(streakFiles *sfiles, psU8 maskMask, bool printCounts);
 
+bool replicateOutputs(streakFiles *sf);
 bool swapOutputsToInputs(streakFiles *sf);
 bool deleteTemps(streakFiles *sf);
Index: trunk/magic/remove/src/streaksremove.c
===================================================================
--- trunk/magic/remove/src/streaksremove.c	(revision 21441)
+++ trunk/magic/remove/src/streaksremove.c	(revision 21481)
@@ -1,14 +1,10 @@
 #include "streaksremove.h"
-
-#include "nebclient.h"
 
 static pmConfig *parseArguments(int argc, char **argv);
 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
-static StreakPixels * getStreakPixels(streakFiles *sfiles, Streaks *streaks);
 static void exciseNonWarpedPixels(streakFiles *sfiles, double newMaskValue);
 static bool warpedPixel(streakFiles *sfiles, PixelPos *cellCoord);
 static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue);
 static void writeImages(streakFiles *sf, bool exciseImageCube);
-static bool replicateOutputs(streakFiles *sfiles);
 static void updateAstrometry(streakFiles *sfiles);
 
@@ -125,6 +121,6 @@
             psTimerStart("GET_STREAK_PIXELS");
 
-            StreakPixels *pixels = getStreakPixels(sfiles, streaks);
-
+            StreakPixels *pixels = streak_on_component (streaks, sfiles->astrom,
+                                      sfiles->inImage->numCols, sfiles->inImage->numRows);
 
             printf("time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
@@ -225,6 +221,4 @@
     }
 
-    printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
-
     psFree(sfiles);
     psFree(config);
@@ -233,4 +227,5 @@
     streaksNebulousCleanup(); 
     pmConfigDone();
+    printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
     psLibFinalize();
 
@@ -466,6 +461,7 @@
 {
     if (sf->bilevelAstrometry) {
+
         linearizeTransforms(sf->astrom);
-        // XXX: pmAstrometry.c should set the correct CTYPE values
+
         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);
@@ -669,50 +665,4 @@
 }
 
-// for any of the outputs that are stored in Nebulous set their extended attributes
-// and replicate the files
-
-static bool
-replicateOutputs(streakFiles *sfiles)
-{
-    bool status = false;
-
-    // XXX: TODO: need a nebGetXatrr function, but there isn't one
-    // another option would be to take the number of copies to be
-    // created as an option. That way the system could decide
-    // whether to replicate anything other than raw Image files
-    void *xattr = NULL;
-
-    if (!replicate(sfiles->outImage, xattr)) {
-        psError(PM_ERR_SYS, false, "failed to replicate outImage.");
-        return false;
-    }
-
-#ifdef notyet
-    // XXX: don't replicate mask and weight images until we can look up
-    // the input's xattr. There may be a perl program that can getXattr
-    if (sfiles->outMask) {
-        // get xattr from input to see if we need to replicate
-        if (!replicate(sfiles->outMask, xattr)) {
-            psError(PM_ERR_SYS, false, "failed to replicate outImage.");
-            return false;
-        }
-    }
-    if (sfiles->outWeight) {
-        // get xattr from input to see if we need to replicate
-        if (!replicate(sfiles->outWeight, xattr)) {
-            psError(PM_ERR_SYS, false, "failed to replicate outImage.");
-            return false;
-        }
-    }
-#endif
-
-//      replicate the recovery images (if in nebulous)
-//      perhaps whether we do that or not should be configurable.
-//      Sounds like we need a recipe
-
-    return true;
-}
-
-
 static void
 excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue)
@@ -832,78 +782,2 @@
 }
 
-static bool
-streakEndOnComponent(streak *streak, double r_min, double r_max, double d_min, double d_max)
-{
-    if ((streak->ra1  >= r_min) && (streak->ra1  <= r_max) &&
-        (streak->dec1 >= d_min) && (streak->dec1 <= d_max)) {
-        return true;
-    }
-    if ((streak->ra2  >= r_min) && (streak->ra2  <= r_max) &&
-        (streak->dec2 >= d_min) && (streak->dec2 <= d_max)) {
-        return true;
-    }
-    return false;
-}
-
-
-static Streaks *
-restrictStreaksToComponent(streakFiles *sfiles, Streaks *streaks)
-{
-    Streaks *out = psAlloc(sizeof(Streaks));
-
-    strkPt ll, ur;
-    cellToSky(&ll, sfiles->astrom, 0, 0);
-    cellToSky(&ur, sfiles->astrom, sfiles->inImage->numCols-1, sfiles->inImage->numRows-1);
-
-    double r_min, r_max, d_min, d_max;
-    if (ll.x < ur.x) {
-        r_min = ll.x; r_max = ur.x;
-    } else {
-        r_min = ur.x; r_max = ll.x;
-    }
-    if (ll.y < ur.y) {
-        d_min = ll.y; d_max = ur.y;
-    } else {
-        d_min = ur.y; d_max = ll.y;
-    }
-
-    out->list = psAlloc(streaks->size * sizeof(streak));
-    int j=0;
-    for (int i=0 ; i<streaks->size; i++) {
-        if (streakEndOnComponent(&streaks->list[i], r_min, r_max, d_min, d_max)) {
-            out->list[j++] = streaks->list[i];
-        }
-            
-    }
-    out->size = j;
-    return out;
-}
-
-static StreakPixels * 
-getStreakPixels(streakFiles *sfiles, Streaks *streaks)
-{
-    StreakPixels *pixels;
-#ifdef notyet
-    Streaks *componentStreaks = NULL;
-    Streaks *streaksToProcess;
-
-    bool only_component_streaks = false; // XXX flesh this out and make it an option
-    if (only_component_streaks) {
-        componentStreaks = restrictStreaksToComponent(sfiles, streaks);
-        streaksToProcess = componentStreaks;
-    } else { 
-        streaksToProcess = streaks;
-    }
-
-    pixels = streak_on_component (streaksToProcess, sfiles->astrom,
-                                  sfiles->inImage->numCols, sfiles->inImage->numRows);
-    if (componentStreaks) {
-        psFree(componentStreaks);
-    }
-#else
-        pixels = streak_on_component (streaks, sfiles->astrom,
-                                      sfiles->inImage->numCols, sfiles->inImage->numRows);
-#endif
-    return pixels;
-}
-
