IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 3, 2010, 8:41:49 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/tap_branches
Files:
1 deleted
15 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/tap_branches

  • branches/tap_branches/magic

    • Property svn:ignore
      •  

        old new  
        11magic
        22ssa-core-cpp
        3 Makefile
        43Makefile.bak
  • branches/tap_branches/magic/remove

    • Property svn:ignore set to
      configure
      Makefile.in
      Doxyfile
      config.log
      depcomp
      config.status
      config.guess
      ltmain.sh
      config.sub
      autom4te.cache
      libtool
      missing
      Makefile
      aclocal.m4
      install-sh

  • branches/tap_branches/magic/remove/src

    • Property svn:ignore
      •  

        old new  
        44streakscompare
        55streaksrelease
        6 makefile
         6Makefile
         7Makefile.in
         8config.h
         9.deps
         10streaksVersionDefinitions.h
         11config.h.in
         12stamp-h1
  • branches/tap_branches/magic/remove/src/Makefile.simple

    r25082 r27838  
    1010
    1111REMOVE_OBJECTS=    \
    12     ${COMMON_OBJECTS} \
    1312    streaksremove.o \
    1413    streaksextern.o \
    15     warpedpixels.o \
     14    diffedpixels.o \
    1615    Line.o
    1716
    1817REPLACE_OBJECTS=      \
    19     ${COMMON_OBJECTS} \
    2018    streaksreplace.o
    2119
    2220COMPARE_OBJECTS=      \
    23     ${COMMON_OBJECTS} \
    2421    streakscompare.o
    2522
    2623RELEASE_OBJECTS=      \
    27     ${COMMON_OBJECTS} \
    2824    streaksrelease.o
    2925
    3026ISDESTREAKED_OBJECTS=      \
    31     ${COMMON_OBJECTS} \
    3227    isdestreaked.o
    3328
     
    4540HEADERS=Line.h streaksastrom.h streaksextern.h streaksio.h streaksremove.h
    4641
    47 all:    ${PROGRAMS}
     42all: ${PROGRAMS}
    4843
    49 ${REMOVE_OBJECTS}:      ${HEADERS}
    50 streaksremove:  ${REMOVE_OBJECTS}
     44# programs all depend on the common objects and the common headers
     45PROGRAM_OBJECTS = \
     46 ${REMOVE_OBJECTS} \
     47 ${REPLACE_OBJECTS} \
     48 ${COMPARE_OBJECTS} \
     49 ${RELEASE_OBJECTS} \
     50 ${ISDESTREAKED_OBJECTS}
    5151
    52 streaksreplace:  ${REPLACE_OBJECTS}
     52${COMMON_OBJECTS}: ${HEADERS}
    5353
    54 streakscompare:  ${COMPARE_OBJECTS}
     54${PROGRAM_OBJECTS}: ${HEADERS} ${COMMON_OBJECTS}
    5555
    56 streaksrelease:  ${RELEASE_OBJECTS}
     56streaksremove:  ${REMOVE_OBJECTS} ${COMMON_OBJECTS}
    5757
    58 isdestreaked:   ${ISDESTREAKED_OBJECTS}
     58streaksreplace:  ${REPLACE_OBJECTS} ${COMMON_OBJECTS}
     59
     60streakscompare:  ${COMPARE_OBJECTS} ${COMMON_OBJECTS}
     61
     62streaksrelease:  ${RELEASE_OBJECTS} ${COMMON_OBJECTS}
     63
     64isdestreaked:   ${ISDESTREAKED_OBJECTS} ${COMMON_OBJECTS}
    5965
    6066
  • branches/tap_branches/magic/remove/src/isdestreaked.c

    r25082 r27838  
    11#include "streaksremove.h"
     2
     3char *streaksProgram = "isdestreaked";
    24
    35int
  • branches/tap_branches/magic/remove/src/streaksastrom.c

    r25082 r27838  
    378378linearizeTransforms(strkAstrom *astrom)
    379379{
    380     if (!pmAstromLinearizeTransforms((pmFPA *) astrom->fpa, (pmChip *) astrom->chip)) {
    381         // streaksExit("linear fit to astrometry failed\n", PS_EXIT_UNKNOWN_ERROR);
    382         psError(PS_ERR_UNKNOWN, false, "linear fit to astrometry failed ignoring");
     380    if (!pmAstromLinearizeTransforms((pmFPA *) astrom->fpa, (pmChip *) astrom->chip, NULL, NULL, NULL, 0, 0)) {
     381        psErrorStackPrint(stderr, "linear fit to astrometry failed. ignoring\n");
    383382        return false;
    384383    }
  • branches/tap_branches/magic/remove/src/streakscompare.c

    r25082 r27838  
    11#include "streaksremove.h"
     2
     3char *streaksProgram = "streakscompare";
    24
    35static pmConfig * parseArguments(int, char **);
  • branches/tap_branches/magic/remove/src/streaksextern.c

    r25001 r27838  
    7878        }
    7979    }
    80     printf("%d streaks on this component\n", streaksOnComponent);
     80    fprintf(stderr, "%d streaks on this component\n", streaksOnComponent);
    8181    return pixels;
    8282}
  • branches/tap_branches/magic/remove/src/streaksio.c

    r25469 r27838  
    121121    sf->transparentStreaks = psMetadataLookupF64(&status, config->arguments, "TRANSPARENT_STREAKS");
    122122
     123    sf->stats = psMetadataAlloc();
     124    psString statsFileName= psMetadataLookupStr(&status, config->arguments, "STATS");
     125    if (statsFileName) {
     126        sf->statsFile = fopen(statsFileName, "w");
     127        if (!sf->statsFile) {
     128            psError(PS_ERR_IO, true, "failed to open stats file %s", statsFileName);
     129            streaksExit("", PS_EXIT_CONFIG_ERROR);
     130        }
     131    }
     132
    123133    return sf;
    124134}
     
    128138{
    129139    freeImages(sf);
    130     psFree(sf->warpedPixels);
     140    psFree(sf->diffedPixels);
    131141    psFree(sf->tiles);
    132142    psFree(sf->view);
     
    800810        return;
    801811    }
     812    streaksVersionHeaderFull(sfile->header);
     813
    802814    if (!psFitsWriteImage(sfile->fits, sfile->header, sfile->image, 0, extname)) {
    803815        psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d",
     
    817829        return;
    818830    }
     831    streaksVersionHeaderFull(sfile->header);
    819832    if (!psFitsWriteImageCube(sfile->fits, sfile->header, imagecube, extname)) {
    820833        psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d",
     
    851864    sfile->header = NULL;
    852865    psFree(sfile->image);
    853     sfile->header = NULL;
     866    sfile->image = NULL;
    854867    psFree(sfile->imagecube);
    855     sfile->header = NULL;
     868    sfile->imagecube = NULL;
    856869}
    857870
     
    859872closeImages(streakFiles *sf)
    860873{
     874    if (sf->stage == IPP_STAGE_RAW) {
     875        if (sf->view) {
     876            sf->view->readout = -1;
     877            pmFPAfileIOChecks(sf->config, sf->view, PM_FPA_AFTER);
     878            sf->view->cell = -1;
     879            pmFPAfileIOChecks(sf->config, sf->view, PM_FPA_AFTER);
     880            sf->view->chip = -1;
     881            pmFPAfileIOChecks(sf->config, sf->view, PM_FPA_AFTER);
     882        }
     883    }
    861884    closeImage(sf->inImage);
    862885    closeImage(sf->outImage);
     
    913936    bool free_user_copies = true;
    914937    if (user_copies == NULL) {
    915         user_copies = "2";
    916         free_user_copies = false;
     938        // input does not have replication requested
     939        return true;
    917940    }
    918941    if (!nebSetXattr(server, outFile->name, "user.copies", user_copies,  NEB_REPLACE)) {
     
    920943        return false;
    921944    }
    922     if (!nebReplicate(server, outFile->name, "any", NULL)) {
     945    if (!nebReplicate(server, outFile->name, NULL, NULL)) {
    923946        psError(PM_ERR_UNKNOWN, true, "nebReplicate failed for %s\n%s", outFile->name, nebErr(server));
    924947        return false;
     
    11111134
    11121135        psImage *image = sfiles->outImage->image;
     1136        int imageType = image->type.type;
     1137        double exciseValue = sfiles->inImage->exciseValue;
     1138
    11131139        psImage *mask = sfiles->inMask->image;
    11141140        psImage *weight = NULL;
     1141        int weightType = 0;
     1142        double weightExciseValue = NAN;
    11151143        if (sfiles->outWeight) {
    11161144            weight = sfiles->outWeight->image;
    1117         }
    1118         double exciseValue = sfiles->inImage->exciseValue;
     1145            weightType = weight->type.type;
     1146            weightExciseValue = sfiles->inWeight->exciseValue;
     1147        }
    11191148
    11201149        if (printCounts) {
     
    11261155                // these gets are not necessary, we could just set the pixels to nan
    11271156                // but I want to get the counts
    1128                 double imageVal  = image->data.F32[y][x];
    1129                 psU32 maskVal;
     1157                double imageVal = 0; // avoid compiler warning
     1158                if (imageType == PS_TYPE_F32) {
     1159                    imageVal  = image->data.F32[y][x];
     1160                } else if (imageType == PS_TYPE_S16) {
     1161                    imageVal = image->data.S16[y][x];
     1162                } else if (imageType == PS_TYPE_U16) {
     1163                    imageVal = image->data.U16[y][x];
     1164                } else {
     1165                    psError(PS_ERR_PROGRAMMING, true, "unexpected image type found: %d\n",
     1166                                imageType);
     1167                    streaksExit("", PS_EXIT_PROG_ERROR);
     1168                }
     1169                psU32 maskVal = 0;
    11301170                if (sfiles->stage == IPP_STAGE_RAW) {
    11311171                    unsigned int xChip, yChip;
     
    11371177                if (maskVal & maskMask) {
    11381178                    ++maskedPixels;
    1139                     if (!isExciseValue(imageVal, sfiles->inImage->exciseValue)) {
     1179                    if (!isExciseValue(imageVal, exciseValue)) {
    11401180                        ++nandPixels;
    1141                         image->data.F32[y][x] = exciseValue;
     1181                        if (imageType == PS_TYPE_F32) {
     1182                            image->data.F32[y][x] = exciseValue;
     1183                        } else if (imageType == PS_TYPE_S16) {
     1184                            image->data.S16[y][x] = exciseValue;
     1185                        } else if (imageType == PS_TYPE_U16) {
     1186                            image->data.U16[y][x] = exciseValue;
     1187                        } else {
     1188                            psError(PS_ERR_PROGRAMMING, true, "unexpected image type found: %d\n",
     1189                                imageType);
     1190                            streaksExit("", PS_EXIT_PROG_ERROR);
     1191                        }
    11421192                    }
    11431193                    if (weight) {
    1144                         double weightVal = weight ? weight->data.F32[y][x] : 0;
    1145                         if (!isnan(weightVal)) {
    1146                             ++nandWeights;
    1147                             weight->data.F32[y][x] = NAN;
     1194                        if (weightType == PS_TYPE_F32) {
     1195                            double weightVal = weight->data.F32[y][x];
     1196                            if (!isnan(weightVal)) {
     1197                                ++nandWeights;
     1198                                weight->data.F32[y][x] = NAN;
     1199                            }
     1200                        } else if(weightType == PS_TYPE_S16) {
     1201                            double weightVal = weight->data.S16[y][x];
     1202                            if (!isExciseValue(weightVal, weightExciseValue)) {
     1203                                ++nandWeights;
     1204                                image->data.S16[y][x] = weightExciseValue;
     1205                            }
     1206                        } else if (weightType == PS_TYPE_U16) {
     1207                            double weightVal = weight->data.U16[y][x];
     1208                            if (!isExciseValue(weightVal, weightExciseValue)) {
     1209                                ++nandWeights;
     1210                                image->data.U16[y][x] = weightExciseValue;
     1211                            }
     1212                        } else {
     1213                            psError(PS_ERR_PROGRAMMING, true, "unexpected image type found: %d\n",
     1214                                    weightType);
     1215                                streaksExit("", PS_EXIT_PROG_ERROR);
    11481216                        }
    11491217                    }
     
    11761244        psMetadataAddU16(in->header, PS_LIST_TAIL, "BLANK", 0, "", 65535);
    11771245        psMetadataAddU16(in->header, PS_LIST_TAIL, "ZBLANK", 0, "", 65535);
    1178     } else {
     1246    } else if (in->image->type.type == PS_TYPE_S16) {
     1247        in->exciseValue = 32767;
     1248        psMetadataAddU16(in->header, PS_LIST_TAIL, "BLANK", 0, "", 32767);
     1249        psMetadataAddU16(in->header, PS_LIST_TAIL, "ZBLANK", 0, "", 32767);
     1250    } else if (in->image->type.type == PS_TYPE_F32) {
    11791251        in->exciseValue = NAN;
    1180     }
    1181 }
    1182 
    1183 void
    1184 strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask)
    1185 {
     1252    } else {
     1253        psError(PS_ERR_PROGRAMMING, true, "unexpected image type found: %d\n", in->image->type.type);
     1254        streaksExit("", PS_EXIT_PROG_ERROR);
     1255    }
     1256}
     1257
     1258// Get the mask values that we need.
     1259// If an input mask file is provided get them from there.
     1260// Otherwise get them from the recipe MASKS
     1261void
     1262strkGetMaskValues(streakFiles *sfiles)
     1263{
     1264    if (sfiles->maskStreak) {
     1265        // already done
     1266        return;
     1267    }
    11861268    if (sfiles->inMask && sfiles->inMask->header) {
    11871269        if (!pmConfigMaskReadHeader(sfiles->config, sfiles->inMask->header)) {
     
    11961278        streaksExit("", PS_EXIT_CONFIG_ERROR);
    11971279    }
    1198     *maskStreak = psMetadataLookupU32(&status, masks, "STREAK");
     1280    sfiles->maskStreak = psMetadataLookupU32(&status, masks, "STREAK");
    11991281    if (!status) {
    12001282        psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n");
     
    12121294        }
    12131295    }
    1214     *maskMask = ~convPoor;
     1296    sfiles->maskMask = ~convPoor;
    12151297}
    12161298
  • branches/tap_branches/magic/remove/src/streaksio.h

    r24853 r27838  
    1616void copyFitsOptions(sFile *out, sFile *rec, sFile *in, psVector *tiles);
    1717void setupImageRefs(sFile *out, sFile *recoveryOut, sFile *in, int extnum, bool exciseAll);
    18 void strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask);
     18void strkGetMaskValues(streakFiles *sfiles);
    1919void copyExtraExtensions(streakFiles *sfiles);
    2020
  • branches/tap_branches/magic/remove/src/streaksrelease.c

    r25082 r27838  
    44static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
    55static void writeImages(streakFiles *sf, bool exciseImageCube);
     6
     7char *streaksProgram = "streaksrelease";
    68
    79int
     
    1618        return PS_EXIT_CONFIG_ERROR;
    1719    }
    18 
    19     // Values to set for masked pixels
    20     psU32 maskStreak = 0;           // for the image and weight (usually NAN, MAXINT for integer images)
    21     psU32 maskMask = 0;             // value looked up for MASK.STREAK
    2220
    2321    // Does true work here?
     
    5048
    5149        // now that we've read the input files, lookup the mask values that we read
    52         if (maskStreak == 0) {
    53             strkGetMaskValues(sfiles, &maskStreak, &maskMask);
    54         }
    55 
    56         setMaskedToNAN(sfiles, maskMask, true);
     50        strkGetMaskValues(sfiles);
     51
     52        if (!sfiles->inImage->imagecube) {
     53            setMaskedToNAN(sfiles, sfiles->maskMask, true);
     54        }
    5755
    5856        // write out the destreaked temporary images and the recovery images
     
    226224    if (sf->inImage->image) {
    227225        setupImageRefs(sf->outImage, sf->recImage, sf->inImage, sf->extnum, exciseAll);
    228     } else if (sf->inImage->imagecube) {
    229         // Image cubes should have been excised in the destreaking process
    230         streaksExit("unexpected imagecube found", PS_EXIT_CONFIG_ERROR);
    231226    }  else {
    232         return false;
     227        // image cubes are handled specially
    233228    }
    234229
     
    278273
    279274
     275// XXXX: why isn't this in streaksio.c ?? See also streakremove.c
    280276static void
    281277writeImages(streakFiles *sf, bool exciseImageCube)
     
    303299        }
    304300
    305         // borrow one of the images from the imagecube and set it to init value
    306         psImage *image = psArrayGet (sf->inImage->imagecube, 0);
    307         psMemIncrRefCounter(image);
    308         psImageInit(image, initValue);
    309         if (exciseImageCube) {
    310             sf->outImage->image = image;
    311             writeImage(sf->outImage, extname, sf->extnum);
    312         } else {
    313             // write zero valued image to reccovery
    314             if (sf->recImage) {
    315                 sf->recImage->image = image;
    316                 writeImage(sf->recImage, extname, sf->extnum);
    317             }
    318         }
    319301        // Assumption: there are no mask and weight images for video cells
    320302        return;
  • branches/tap_branches/magic/remove/src/streaksremove.c

    r25434 r27838  
    1212static pmConfig *parseArguments(int argc, char **argv);
    1313static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
    14 static void exciseNonWarpedPixels(streakFiles *sfiles, psImageMaskType newMaskValue);
    15 static bool warpedPixel(streakFiles *sfiles, int x, int y);
     14static long exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue);
     15static bool diffedPixel(streakFiles *sfiles, int x, int y);
    1616static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, psImageMaskType newMaskValue);
    1717static void writeImages(streakFiles *sf, bool exciseImageCube);
    1818static void updateAstrometry(streakFiles *sfiles);
    1919static void censorSources(streakFiles *sfiles, psImageMaskType maskStreak);
    20 static long censorPixels(streakFiles *sfiles, psImage * pixels, bool checkNonWarpedPixels, psU16 maskStreak);
    21 
     20static long censorPixels(streakFiles *sfiles, psImage * pixels, bool checkNonDiffedPixels, psU16 maskStreak);
     21
     22char *streaksProgram = "streaksremove";
     23
     24// Note: For clarity the flow of this program is in main().
     25// There is not a lot of error checking is done in main.
     26// Until the end, where we might be doing Nebulous operations, called functions exit when an error
     27// is encountered.
    2228int
    2329main(int argc, char *argv[])
     
    2632
    2733    psLibInit(NULL);
    28     psTimerStart("STREAKSREMOVE");
     34    psTimerStart("TOTAL_TIME");
    2935
    3036    pmConfig *config = parseArguments(argc, argv);
     
    3339        streaksExit("", PS_EXIT_CONFIG_ERROR);
    3440    }
    35 
    36     // Values to set for masked pixels
    37     psU32 maskStreak = 0;           // for the image and weight (usually NAN, MAXINT for integer images)
    38     psU32 maskMask = 0;             // value looked up for MASK.STREAK
    3941
    4042    psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS");
     
    5052    streakFiles *sfiles = openFiles(config, true, argv[0]);
    5153    setupAstrometry(sfiles);
     54    sfiles->stats = psMetadataAlloc();
    5255
    5356    // Optionally we can set pixels that are masked to NAN since they couldn't have been
     
    6164
    6265    bool exciseAll = false;
    63     // --keepnonwarped is a test and debug mode
    64     bool keepNonWarpedPixels = psMetadataLookupBool(&status, config->arguments, "KEEP_NON_WARPED");
    65 
    66     // we need to check for non warped pixels unless we've been asked not to or the stage is diff
    67     // (By definition pixels in diff images were included in a diff)
    68     bool checkNonWarpedPixels = ! (keepNonWarpedPixels || (sfiles->stage == IPP_STAGE_DIFF) );
    69 
    70     if (checkNonWarpedPixels ) {
     66    // --keepnondiffed is a test and debug mode
     67    bool keepNonDiffedPixels = psMetadataLookupBool(&status, config->arguments, "KEEP_NON_DIFFED");
     68
     69    // we need to check for non diffed pixels unless we've been asked not to or the stage is diff
     70    // (By definition pixels in diff images were included in the difference images)
     71    bool checkNonDiffedPixels = ! (keepNonDiffedPixels || (sfiles->stage == IPP_STAGE_DIFF) );
     72
     73    if (checkNonDiffedPixels ) {
    7174        // From magic ICD:
    7275        // In the raw and detrended images, the pixels which were not
     
    7679        // if no skycells are provided sfiles->exciseAll is set to true
    7780
    78         psTimerStart("COMPUTE_WARPED_PIXELS");
    79         if (! computeWarpedPixels(sfiles) ) {
     81        psTimerStart("COMPUTE_DIFFED_PIXELS");
     82        if (! computeDiffedPixels(sfiles) ) {
    8083            // we have no choice to excise all pixels
    8184            exciseAll = true;
    8285        }
    83         psF64 cwp_t = psTimerClear("COMPUTE_WARPED_PIXELS");
    84         psLogMsg("streaksremove", PS_LOG_INFO, "time to compute warped pixels: %f\n", cwp_t);
     86        psF64 cdp_t = psTimerClear("COMPUTE_DIFFED_PIXELS");
     87        psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "COMPUTE_UNDIFFED_PIXELS", PS_META_REPLACE, "time to compute non-diffedpixels", cdp_t);
     88        psLogMsg("streaksremove", PS_LOG_INFO, "time to compute diffed pixels: %f\n", cdp_t);
    8589    }
    8690
     
    100104    long totalPixels = 0;
    101105    long totalStreakPixels = 0;
    102 
     106    long nonDiffedPixels = 0;
     107
     108    // accumulators for the various timers
     109    psF64 gsp_t = 0;
     110    psF64 enw_t = 0;
     111    psF64 rms_t = 0;
     112    psF64 cs_t = 0;
     113    psF64 wi_t = 0;
     114    psF64 ua_t = 0;
    103115    // Iterate through each component of the input (except for raw images there is only one)
    104116    do {
     
    118130
    119131        // now that we've read the input files, lookup the mask values
    120         if (maskStreak == 0) {
    121             strkGetMaskValues(sfiles, &maskStreak, &maskMask);
    122         }
     132        strkGetMaskValues(sfiles);
    123133
    124134        totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols;
     
    132142            StreakPixels *pixels = streak_on_component(streaks, sfiles->astrom, sfiles->inImage->numCols,
    133143                                                        sfiles->inImage->numRows);
     144            gsp_t +=  psTimerClear("GET_STREAK_PIXELS");
     145            psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "GET_STREAK_PIXELS", PS_META_REPLACE, "", gsp_t);
    134146            psLogMsg("streaksremove", PS_LOG_INFO, "time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
    135147
     
    137149            // otherwise it contained an image cube (video cell) which is handled in the if block
    138150            if (sfiles->inImage->image) {
    139                 if (checkNonWarpedPixels) {
    140                     psTimerStart("EXCISE_NON_WARPED");
    141 
    142                     // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel
     151                if (checkNonDiffedPixels) {
     152                    psTimerStart("EXCISE_NON_DIFFED");
     153
     154                    // set non-diffed pixels and variance to NAN, mask to maskStreak (since the pixel
    143155                    // is excised as part of the destreaking process)
    144                     exciseNonWarpedPixels(sfiles, maskStreak);
    145 
    146                     psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));
     156                    nonDiffedPixels += exciseNonDiffedPixels(sfiles, sfiles->maskStreak);
     157
     158                    enw_t +=  psTimerClear("EXCISE_NON_DIFFED");
     159                    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "EXCISE_NON_DIFFED", PS_META_REPLACE, "", enw_t);
     160                    psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non diffed pixels: %f\n", enw_t);
    147161                }
    148162
    149163                psTimerStart("REMOVE_STREAKS");
    150164
    151                 totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, maskStreak);
    152 
    153                 psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
     165                totalStreakPixels += censorPixels(sfiles, pixels, checkNonDiffedPixels, sfiles->maskStreak);
     166
     167                rms_t += psTimerClear("REMOVE_STREAKS");
     168                psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "REMOVE_STREAKS", PS_META_REPLACE, "", enw_t);
     169                psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", rms_t);
    154170
    155171                if (nanForRelease) {
    156172                    // set any pixels that were masked, to NAN (unless they are already NAN)
    157                     setMaskedToNAN(sfiles, maskMask, true);
     173                    setMaskedToNAN(sfiles, sfiles->maskMask, true);
    158174                }
    159175
     
    170186            // chip processed files with the data calcuated by psastro at the camera stage
    171187            // (actually we use a linear approximation)
     188            psTimerStart("UPDATE_ASTROMETRY");
    172189            updateAstrometry(sfiles);
    173         }
    174 
    175         censorSources(sfiles, maskStreak);
     190            ua_t += psTimerClear("UPDATE_ASTROMETRY");
     191            psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "UPDATE_ASTROMETRY", PS_META_REPLACE, "", ua_t);
     192            psLogMsg("streaksremove", PS_LOG_INFO, "time to update astrometry: %f\n", ua_t);
     193        }
     194
     195        psTimerStart("CENSOR_SOURCES");
     196        censorSources(sfiles, sfiles->maskStreak);
     197        cs_t += psTimerClear("CENSOR_SOURCES");
     198        psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "CENSOR_SOURCES", PS_META_REPLACE, "", cs_t);
    176199
    177200        // write the destreaked "temporary" images and the recovery images
     201        psTimerStart("WRITE_IMAGES");
    178202        writeImages(sfiles, exciseImageCube);
    179 
     203        wi_t += psTimerClear("WRITE_IMAGES");
     204        psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "WRITE_IMAGES", PS_META_REPLACE, "", wi_t);
    180205
    181206        psLogMsg("streaksremove", PS_LOG_INFO, "time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT"));
     207
    182208    } while (streakFilesNextExtension(sfiles));
    183209
     
    185211    psFree(streaks);
    186212
    187     psLogMsg("streaksremove", PS_LOG_INFO, "pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, 100. * totalStreakPixels / totalPixels);
     213    if (exciseAll) {
     214        totalStreakPixels = totalPixels;
     215    }
     216
     217    psF64 streakFraction = (double) totalStreakPixels / totalPixels;
     218    psLogMsg("streaksremove", PS_LOG_INFO, "   total pixels:  %8ld\n", totalPixels);
     219    psLogMsg("streaksremove", PS_LOG_INFO, "  streak pixels:  %8ld %4.2f%%\n", totalStreakPixels, streakFraction * 100);
     220    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "STREAK_FRACTION", PS_META_REPLACE, "", streakFraction);
     221
     222    psF64 nonDiffedFraction = (double) nonDiffedPixels / totalPixels;
     223    psLogMsg("streaksremove", PS_LOG_INFO, "nondiffed pixels:  %8ld %4.2f%%\n", nonDiffedPixels, nonDiffedFraction * 100);
     224    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "NONDIFFED_FRACTION", PS_META_REPLACE, "", nonDiffedFraction);
    188225
    189226    // check the weight and mask files for extra extensions that might be in files
     
    194231
    195232    psTimerStart("CLOSE_IMAGES");
    196 
    197233    closeImages(sfiles);
    198 
    199     psLogMsg("streaksremove", PS_LOG_INFO, "time to close images: %f\n", psTimerClear("CLOSE_IMAGES"));
    200 
    201 
     234    psF64 ci_t = psTimerClear("CLOSE_IMAGES");
     235    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "CLOSE_IMAGES", PS_META_REPLACE, "", ci_t);
     236
     237    psLogMsg("streaksremove", PS_LOG_INFO, "time to close images: %f\n", ci_t);
     238
     239#ifdef DO_REPLICATE
     240    psTimerStart("REPLICATE_OUTPUTS");
    202241    if (!replicateOutputs(sfiles)) {
    203242        psErrorStackPrint(stderr, "failed to replicate output files");
     
    205244        exit(PS_EXIT_UNKNOWN_ERROR);
    206245    }
     246    psF64 ro_t = psTimerClear("REPLICATE_OUTPUTS");
     247    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "REPLICATE_OUTPUTS", PS_META_REPLACE, "", ro_t);
     248#endif
    207249
    208250    // NOTE: from here on we can't just quit if something goes wrong.
     
    214256        //     swap the instances for the input and output
    215257        //     Note this is a nebulous database operation. No file I/O is performed
     258        psTimerStart("SWAP_INSTANCES");
    216259        if (!swapOutputsToInputs(sfiles)) {
    217             // XXX: Now what?
    218260            // It is up to the program that reverts failed destreak runs to insure that
    219             // any input files that have been swapped are restored and that the de-streaked
    220             // versions are deleted
     261            // any original non-destreaked input files that have been swapped are restored and that the de-streaked
     262            // versions are deleted.
    221263
    222264            psErrorStackPrint(stderr, "failed to swap files");
     
    224266            // XXX: pick a specific error code for this failure
    225267            exit(PS_EXIT_UNKNOWN_ERROR);
     268        }
     269        psF64 si_t = psTimerClear("SWAP_INSTANCES");
     270        psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "SWAP_INSTANCES", PS_META_REPLACE, "", si_t);
     271    }
     272
     273    psF64 total_time = psTimerClear("TOTAL_TIME");
     274    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "TOTAL_TIME", PS_META_REPLACE, "", total_time);
     275    psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", total_time);
     276
     277    if (sfiles->statsFile) {
     278        const char *statsMDC = psMetadataConfigFormat(sfiles->stats);
     279        if (!statsMDC || strlen(statsMDC) == 0) {
     280            psError(PS_ERR_IO, false, "Unable to get statistics MDC file.\n");
     281        } else {
     282            fprintf(sfiles->statsFile, "%s", statsMDC);
     283            psFree(statsMDC);
     284            fclose(sfiles->statsFile);
     285            sfiles->statsFile = NULL;
     286            psFree(sfiles->stats);
     287            sfiles->stats = NULL;
    226288        }
    227289    }
     
    234296    streaksNebulousCleanup();
    235297    pmConfigDone();
    236     psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
    237298    psLibFinalize();
    238299
     
    243304
    244305static long
    245 censorPixels(streakFiles *sfiles, psImage *pixels, bool checkNonWarpedPixels, psU16 maskStreak)
     306censorPixels(streakFiles *sfiles, psImage *pixels, bool checkNonDiffedPixels, psU16 maskStreak)
    246307{
    247308    long streakPixels = 0;
     
    250311        for (int x = 0; x < sfiles->inImage->numCols; x++) {
    251312            if (psImageGet(pixels, x, y)) {
    252                 ++streakPixels;
    253                 if (!checkNonWarpedPixels || warpedPixel(sfiles, x, y)) {
     313                if (!checkNonDiffedPixels || diffedPixel(sfiles, x, y)) {
     314                    ++streakPixels;
    254315
    255316                    excisePixel(sfiles, x, y, true, maskStreak);
     
    257318                } else {
    258319                    // This pixel was not included in any warp and has thus already excised
    259                     // by exciseNonWarpedPixels
     320                    // by exciseNonDiffedPixels
    260321                }
    261322            }
     
    274335    fprintf(stderr, "\t-weight WEIGHT.fits: weight file to de-streak\n");
    275336    fprintf(stderr, "\t-replace: replace the input images with the output\n");
    276     fprintf(stderr, "\t-keepnonwarped: do not exise pixels that were not part of difference processing\n");
     337    fprintf(stderr, "\t-keepnondiffed: do not exise pixels that were not part of difference processing\n");
    277338    fprintf(stderr, "\t-transparent val: instead of setting excicsed pixel to NAN add val\n");
    278339    fprintf(stderr, "\t-chip_mask MASK.fits: name of mask for chip stage (camera stage mask is passed tih -mask)\n");
     
    365426    }
    366427
    367     if ((argnum = psArgumentGet(argc, argv, "-keepnonwarped"))) {
    368         psArgumentRemove(argnum, &argc, argv);
    369         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "KEEP_NON_WARPED", 0,
    370             "skip excising of non warped pixels", true);
     428    if ((argnum = psArgumentGet(argc, argv, "-keepnondiffed"))) {
     429        psArgumentRemove(argnum, &argc, argv);
     430        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "KEEP_NON_DIFFED", 0,
     431            "skip excising of non diffed pixels", true);
    371432    }
    372433
     
    378439        psArgumentRemove(argnum, &argc, argv);
    379440        double transparentStreaks = atof(argv[argnum]);
    380         psMetadataAddF64(config->arguments, PS_LIST_TAIL, "TRANSPARENT_STREAKS", 0,
     441        psMetadataAddF32(config->arguments, PS_LIST_TAIL, "TRANSPARENT_STREAKS", 0,
    381442            "value to adjust excised pixels", transparentStreaks);
    382443        psArgumentRemove(argnum, &argc, argv);
    383444    }
    384445
    385     // if skycells are not provided then we have to execise all pixels  unless -keepnonwarped
     446    // if skycells are not provided then we have to execise all pixels  unless -keepnondiffed
    386447    pmConfigFileSetsMD(config->arguments, &argc, argv, "SKYCELLS", "-skycell", "-skycelllist");
    387448
     
    449510    }
    450511
     512    if ((argnum = psArgumentGet(argc, argv, "-stats"))) {
     513        psArgumentRemove(argnum, &argc, argv);
     514        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "STATS", 0,
     515                "name of input stats file", argv[argnum]);
     516        psArgumentRemove(argnum, &argc, argv);
     517    }
     518
    451519    if ((argnum = psArgumentGet(argc, argv, "-tmproot"))) {
    452520        psArgumentRemove(argnum, &argc, argv);
     
    491559updateAstrometry(streakFiles *sf)
    492560{
    493     // XXX: why do I check this here? Shouldn't it be just around the call to linearizeTransforms?
    494561    if (sf->bilevelAstrometry) {
    495 
    496562        if (!linearizeTransforms(sf->astrom)) {
    497             // fit failed, leave the astrometry unchanged
     563            // fit failed, leave the transform in the file unchanged
    498564            return;
    499565        }
    500 
    501         if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
    502             psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
    503             streaksExit("", PS_EXIT_UNKNOWN_ERROR);
    504         }
    505         if (sf->outMask) {
    506             pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);
    507         }
    508         if (sf->outWeight) {
    509             pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);
     566    }
     567    if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
     568        psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
     569        streaksExit("", PS_EXIT_UNKNOWN_ERROR);
     570    }
     571    if (sf->outMask) {
     572        pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);
     573    }
     574    if (sf->outWeight) {
     575        pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);
     576    }
     577}
     578
     579static void
     580setStreakBits(psImage *maskImage, psU32 maskStreak)
     581{
     582    for (int y=0 ; y < maskImage->numRows; y++) {
     583        for (int x=0 ; x < maskImage->numCols; x++) {
     584            maskImage->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskStreak;
    510585        }
    511586    }
     
    516591readAndCopyToOutput(streakFiles *sf, bool exciseAll)
    517592{
    518     bool    updateAstrometry = false;
    519593    if (sf->inImage->pmfile) {
    520594        // image data from pmFPAfile (diff or warp file)
     
    534608        streaksExit("", PS_EXIT_UNKNOWN_ERROR);
    535609    }
    536     // For the chip level files, copy the WCS from the astrometry file to the header
    537     // XXX: do we want to do this for raw images as well?
    538     if (sf->stage == IPP_STAGE_CHIP) {
    539         if (!sf->bilevelAstrometry) {
    540             updateAstrometry = true;
    541             if (!pmAstromWriteWCS(sf->inImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {
    542                 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);
    543                 streaksExit("", PS_EXIT_UNKNOWN_ERROR);
    544             }
    545         }
    546     }
    547610    sf->outImage->header =  psMemIncrRefCounter(sf->inImage->header);
    548611    if (sf->recImage) {
     
    577640            }
    578641            addDestreakKeyword(sf->outMask->header);
    579             if (updateAstrometry) {
    580                 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);
    581             }
    582             setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, exciseAll);
     642            // Note: we don't excise the mask pixels even if exciseAll is true.
     643            setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false);
     644            if (exciseAll) {
     645                strkGetMaskValues(sf);
     646               
     647                // add the STREAK bit to the mask image pixels
     648                setStreakBits(sf->inMask->image, sf->maskStreak);
     649            }
    583650            if (sf->outChMask) {
    584651                sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header);
     
    605672        }
    606673        addDestreakKeyword(sf->outWeight->header);
    607         if (updateAstrometry) {
    608             pmAstromWriteWCS(sf->inWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);
    609         }
    610674        setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll);
    611675
     
    630694    } else {
    631695        // we have an image cube
    632         double initValue;
    633696        if (exciseImageCube) {
    634697            // copy the entire input image to the recovery image
    635698            writeImageCube(sf->recImage, sf->inImage->imagecube, extname, sf->extnum);
    636             initValue = NAN;
    637699        } else {
    638700            // otherwise write it to the output
    639701            writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum);
    640             initValue = 0;
    641         }
    642 
    643         // borrow one of the images from the imagecube and set it to init value
    644         psImage *image = psArrayGet (sf->inImage->imagecube, 0);
    645         psMemIncrRefCounter(image);
    646         psImageInit(image, initValue);
     702        }
     703
     704        // Now deal with the other output image
    647705        if (exciseImageCube) {
    648             sf->outImage->image = image;
    649             writeImage(sf->outImage, extname, sf->extnum);
     706            // Set the values in the imagecube images to NAN and write them to the output image
     707            for (int i = 0; i < psArrayLength(sf->inImage->imagecube); i++) {
     708                psImage *image = psArrayGet (sf->inImage->imagecube, i);
     709                // XXX: NAN isn't right. It should be the integer equivalent. Should use exciseValue
     710                // but it isn't set with this code path. Fix that.
     711                psImageInit(image, 65535);
     712            }
     713            writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum);
    650714        } else {
    651             // write zero valued image to reccovery
    652715            if (sf->recImage) {
    653                 sf->recImage->image = image;
    654                 writeImage(sf->recImage, extname, sf->extnum);
     716                // Set the values in the imagecube images to zero
     717                for (int i = 0; i < psArrayLength(sf->inImage->imagecube); i++) {
     718                    psImage *image = psArrayGet (sf->inImage->imagecube, i);
     719                    psImageInit(image, 0);
     720                }
     721                // copy the entire zeroed image to the recovery image
     722                writeImageCube(sf->recImage, sf->inImage->imagecube, extname, sf->extnum);
    655723            }
    656724        }
     
    683751    }
    684752
    685     float imageValue  = sfiles->inImage->image->data.F32[y][x];
    686     if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) {
    687         sfiles->recImage->image->data.F32[y][x] = imageValue;
    688     }
    689 
    690     if (sfiles->transparentStreaks == 0) {
    691         sfiles->outImage->image->data.F32[y][x] = exciseValue;
     753    if (sfiles->inImage->image->type.type == PS_TYPE_U16) {
     754        psU16 imageValue  = sfiles->inImage->image->data.U16[y][x];
     755        if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) {
     756            sfiles->recImage->image->data.U16[y][x] = imageValue;
     757        }
     758
     759        if (sfiles->transparentStreaks == 0) {
     760            sfiles->outImage->image->data.U16[y][x] = exciseValue;
     761        } else {
     762            if (streak) {
     763                // as a visualization aid don't mask the pixel, just change the intensity
     764                sfiles->outImage->image->data.U16[y][x] = imageValue + sfiles->transparentStreaks;
     765            } else {
     766                sfiles->outImage->image->data.U16[y][x] = exciseValue;
     767            }
     768        }
    692769    } else {
    693         if (streak) {
    694             // as a visualization aid don't mask the pixel, just change the intensity
    695             sfiles->outImage->image->data.F32[y][x] = imageValue + sfiles->transparentStreaks;
     770        float imageValue  = sfiles->inImage->image->data.F32[y][x];
     771        if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) {
     772            sfiles->recImage->image->data.F32[y][x] = imageValue;
     773        }
     774
     775        if (sfiles->transparentStreaks == 0) {
     776            sfiles->outImage->image->data.F32[y][x] = exciseValue;
    696777        } else {
    697             sfiles->outImage->image->data.F32[y][x] = exciseValue;
     778            if (streak) {
     779                // as a visualization aid don't mask the pixel, just change the intensity
     780                sfiles->outImage->image->data.F32[y][x] = imageValue + sfiles->transparentStreaks;
     781            } else {
     782                sfiles->outImage->image->data.F32[y][x] = exciseValue;
     783            }
    698784        }
    699785    }
     
    711797                sfiles->inMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x];
    712798        }
    713         sfiles->outMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x] =
    714             sfiles->inMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x] | newMaskValue;
    715     }
    716 }
    717 
    718 static void
    719 exciseNonWarpedPixels(streakFiles *sfiles, psImageMaskType newMaskValue)
     799        sfiles->outMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= newMaskValue;
     800    }
     801}
     802
     803static long
     804exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue)
    720805{
    721806    int cell_x0 = sfiles->astrom->cell_x0;
     
    725810    int numCols = sfiles->inImage->numCols; // for raw images this was calculated from the width of datasec
    726811    int numRows = sfiles->inImage->numRows; // for raw images this was calculated from the height of datasec
     812
     813    long excisedPixels = 0;
    727814
    728815//    printf("%2d x0: %4d y0: %4d xpar: %d ypar: %d\n", sfiles->extnum, cell_x0, cell_y0, xParity, yParity);
     
    739826        }
    740827
    741         psU8 *pixels = sfiles->warpedPixels->data.U8[yChip];
     828        psU8 *pixels = sfiles->diffedPixels->data.U8[yChip];
    742829
    743830        if (xParity == 1) {
     
    746833                if (! *pixels ) {
    747834                    excisePixel(sfiles, xCell, yCell, false, newMaskValue);
     835                    excisedPixels++;
    748836                }
    749837            }
     
    755843                if (!*pixels) {
    756844                    excisePixel(sfiles, xCell, yCell, false, newMaskValue);
     845                    excisedPixels++;
    757846                }
    758847            }
    759848        }
    760849    }
     850    return excisedPixels;
    761851}
    762852
    763853static bool
    764 warpedPixel(streakFiles *sfiles, int x, int y)
     854diffedPixel(streakFiles *sfiles, int x, int y)
    765855{
    766856    PixelPos chipCoord;
    767857
    768858    if (!CHIP_LEVEL_INPUT(sfiles->stage)) {
    769         // if we're here on a skycell image by definition this pixel was warped
     859        // if we're here on a skycell image by definition this pixel was diffed
    770860        return true;
    771861    }
     
    780870    cellToChipInt(&chipCoord.x, &chipCoord.y, sfiles->astrom, x, y);
    781871
    782     if (chipCoord.x < 0 || chipCoord.x >= sfiles->warpedPixels->numCols) {
     872    if (chipCoord.x < 0 || chipCoord.x >= sfiles->diffedPixels->numCols) {
    783873        return false;
    784874    }
    785     if (chipCoord.y < 0 || chipCoord.y >= sfiles->warpedPixels->numRows) {
     875    if (chipCoord.y < 0 || chipCoord.y >= sfiles->diffedPixels->numRows) {
    786876        return false;
    787877    }
    788878
    789     return psImageGet(sfiles->warpedPixels, chipCoord.x, chipCoord.y) ? true : false;
     879    return psImageGet(sfiles->diffedPixels, chipCoord.x, chipCoord.y) ? true : false;
    790880}
    791881
  • branches/tap_branches/magic/remove/src/streaksremove.h

    r25082 r27838  
    3333    int         yParity;
    3434    double      exciseValue;
     35    psString    program;
    3536} sFile;
    3637
    37 
    38 typedef enum {
    39     IPP_STAGE_NONE = 0,
    40     IPP_STAGE_RAW,
    41     IPP_STAGE_CHIP,
    42     IPP_STAGE_WARP,
    43     IPP_STAGE_DIFF
    44 } ippStage;
    45 
     38// used for error messages
     39extern char * streaksProgram;
    4640
    4741typedef struct {
     
    6458    sFile *inSources;
    6559    sFile *outSources;
     60    psMetadata *stats;
     61    FILE *statsFile;
    6662    psString class_id;
    6763    pmFPAfile  *inAstrom;
     
    7167    pmChip  *chip;  // current chip
    7268    pmCell  *cell;  // current cell
    73     psImage *warpedPixels;
     69    psImage *diffedPixels;
    7470    psVector    *tiles;
    7571    double  transparentStreaks;
    7672    psString    program_name;
     73    psU32   maskStreak;
     74    psU32   maskMask;
    7775} streakFiles;
    7876
     
    8684extern void cellToChipInt(unsigned int *xChip, unsigned int *yChip, strkAstrom *astrom, int xCell, int yCell);
    8785
    88 extern bool computeWarpedPixels(streakFiles *sf);
     86extern bool computeDiffedPixels(streakFiles *sf);
    8987extern void streaksExit(psString, int);
    9088extern ippStage parseStage(psString);
    9189extern psString pathToDirectory(char *path);
    9290extern void setStreakFiles( streakFiles *);
     91
     92extern bool streaksVersionHeaderFull(psMetadata *header);
     93extern psString streaksVersionLong(void);
    9394
    9495#define CHIP_LEVEL_INPUT(_stage) ((_stage == IPP_STAGE_RAW) || (_stage == IPP_STAGE_CHIP))
  • branches/tap_branches/magic/remove/src/streaksreplace.c

    r25082 r27838  
    55static void writeImages(streakFiles *sf, bool exciseImageCube);
    66static bool readAndCopyToOutput(streakFiles *sf, bool restoreImageCube);
     7
     8char *streaksProgram = "streaksreplace";
    79
    810int main(int argc, char *argv[])
Note: See TracChangeset for help on using the changeset viewer.