IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21481


Ignore:
Timestamp:
Feb 13, 2009, 5:34:19 PM (17 years ago)
Author:
bills
Message:

removed some unused code

Location:
trunk/magic/remove/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksio.c

    r21440 r21481  
    813813// and replicate the files
    814814
    815 static bool
     815bool
    816816replicateOutputs(streakFiles *sfiles)
    817817{
  • trunk/magic/remove/src/streaksio.h

    r21440 r21481  
    2727void setMaskedToNAN(streakFiles *sfiles, psU8 maskMask, bool printCounts);
    2828
     29bool replicateOutputs(streakFiles *sf);
    2930bool swapOutputsToInputs(streakFiles *sf);
    3031bool deleteTemps(streakFiles *sf);
  • trunk/magic/remove/src/streaksremove.c

    r21441 r21481  
    11#include "streaksremove.h"
    2 
    3 #include "nebclient.h"
    42
    53static pmConfig *parseArguments(int argc, char **argv);
    64static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
    7 static StreakPixels * getStreakPixels(streakFiles *sfiles, Streaks *streaks);
    85static void exciseNonWarpedPixels(streakFiles *sfiles, double newMaskValue);
    96static bool warpedPixel(streakFiles *sfiles, PixelPos *cellCoord);
    107static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue);
    118static void writeImages(streakFiles *sf, bool exciseImageCube);
    12 static bool replicateOutputs(streakFiles *sfiles);
    139static void updateAstrometry(streakFiles *sfiles);
    1410
     
    125121            psTimerStart("GET_STREAK_PIXELS");
    126122
    127             StreakPixels *pixels = getStreakPixels(sfiles, streaks);
    128 
     123            StreakPixels *pixels = streak_on_component (streaks, sfiles->astrom,
     124                                      sfiles->inImage->numCols, sfiles->inImage->numRows);
    129125
    130126            printf("time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
     
    225221    }
    226222
    227     printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
    228 
    229223    psFree(sfiles);
    230224    psFree(config);
     
    233227    streaksNebulousCleanup();
    234228    pmConfigDone();
     229    printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
    235230    psLibFinalize();
    236231
     
    466461{
    467462    if (sf->bilevelAstrometry) {
     463
    468464        linearizeTransforms(sf->astrom);
    469         // XXX: pmAstrometry.c should set the correct CTYPE values
     465
    470466        if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
    471467            psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
     
    669665}
    670666
    671 // for any of the outputs that are stored in Nebulous set their extended attributes
    672 // and replicate the files
    673 
    674 static bool
    675 replicateOutputs(streakFiles *sfiles)
    676 {
    677     bool status = false;
    678 
    679     // XXX: TODO: need a nebGetXatrr function, but there isn't one
    680     // another option would be to take the number of copies to be
    681     // created as an option. That way the system could decide
    682     // whether to replicate anything other than raw Image files
    683     void *xattr = NULL;
    684 
    685     if (!replicate(sfiles->outImage, xattr)) {
    686         psError(PM_ERR_SYS, false, "failed to replicate outImage.");
    687         return false;
    688     }
    689 
    690 #ifdef notyet
    691     // XXX: don't replicate mask and weight images until we can look up
    692     // the input's xattr. There may be a perl program that can getXattr
    693     if (sfiles->outMask) {
    694         // get xattr from input to see if we need to replicate
    695         if (!replicate(sfiles->outMask, xattr)) {
    696             psError(PM_ERR_SYS, false, "failed to replicate outImage.");
    697             return false;
    698         }
    699     }
    700     if (sfiles->outWeight) {
    701         // get xattr from input to see if we need to replicate
    702         if (!replicate(sfiles->outWeight, xattr)) {
    703             psError(PM_ERR_SYS, false, "failed to replicate outImage.");
    704             return false;
    705         }
    706     }
    707 #endif
    708 
    709 //      replicate the recovery images (if in nebulous)
    710 //      perhaps whether we do that or not should be configurable.
    711 //      Sounds like we need a recipe
    712 
    713     return true;
    714 }
    715 
    716 
    717667static void
    718668excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue)
     
    832782}
    833783
    834 static bool
    835 streakEndOnComponent(streak *streak, double r_min, double r_max, double d_min, double d_max)
    836 {
    837     if ((streak->ra1  >= r_min) && (streak->ra1  <= r_max) &&
    838         (streak->dec1 >= d_min) && (streak->dec1 <= d_max)) {
    839         return true;
    840     }
    841     if ((streak->ra2  >= r_min) && (streak->ra2  <= r_max) &&
    842         (streak->dec2 >= d_min) && (streak->dec2 <= d_max)) {
    843         return true;
    844     }
    845     return false;
    846 }
    847 
    848 
    849 static Streaks *
    850 restrictStreaksToComponent(streakFiles *sfiles, Streaks *streaks)
    851 {
    852     Streaks *out = psAlloc(sizeof(Streaks));
    853 
    854     strkPt ll, ur;
    855     cellToSky(&ll, sfiles->astrom, 0, 0);
    856     cellToSky(&ur, sfiles->astrom, sfiles->inImage->numCols-1, sfiles->inImage->numRows-1);
    857 
    858     double r_min, r_max, d_min, d_max;
    859     if (ll.x < ur.x) {
    860         r_min = ll.x; r_max = ur.x;
    861     } else {
    862         r_min = ur.x; r_max = ll.x;
    863     }
    864     if (ll.y < ur.y) {
    865         d_min = ll.y; d_max = ur.y;
    866     } else {
    867         d_min = ur.y; d_max = ll.y;
    868     }
    869 
    870     out->list = psAlloc(streaks->size * sizeof(streak));
    871     int j=0;
    872     for (int i=0 ; i<streaks->size; i++) {
    873         if (streakEndOnComponent(&streaks->list[i], r_min, r_max, d_min, d_max)) {
    874             out->list[j++] = streaks->list[i];
    875         }
    876            
    877     }
    878     out->size = j;
    879     return out;
    880 }
    881 
    882 static StreakPixels *
    883 getStreakPixels(streakFiles *sfiles, Streaks *streaks)
    884 {
    885     StreakPixels *pixels;
    886 #ifdef notyet
    887     Streaks *componentStreaks = NULL;
    888     Streaks *streaksToProcess;
    889 
    890     bool only_component_streaks = false; // XXX flesh this out and make it an option
    891     if (only_component_streaks) {
    892         componentStreaks = restrictStreaksToComponent(sfiles, streaks);
    893         streaksToProcess = componentStreaks;
    894     } else {
    895         streaksToProcess = streaks;
    896     }
    897 
    898     pixels = streak_on_component (streaksToProcess, sfiles->astrom,
    899                                   sfiles->inImage->numCols, sfiles->inImage->numRows);
    900     if (componentStreaks) {
    901         psFree(componentStreaks);
    902     }
    903 #else
    904         pixels = streak_on_component (streaks, sfiles->astrom,
    905                                       sfiles->inImage->numCols, sfiles->inImage->numRows);
    906 #endif
    907     return pixels;
    908 }
    909 
Note: See TracChangeset for help on using the changeset viewer.