IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 8, 2008, 3:27:32 PM (17 years ago)
Author:
bills
Message:

add some timers

File:
1 edited

Legend:

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

    r20844 r20943  
    1616
    1717    psLibInit(NULL);
     18    psTimerStart("STREAKSREMOVE");
    1819
    1920    pmConfig *config = parseArguments(argc, argv);
     
    6162        // if no skycells are provided sfiles->exciseAll is set to true
    6263
     64        psTimerStart("COMPUTE_WARPED_PIXELS");
    6365        if (! computeWarpedPixels(sfiles) ) {
    6466            // we have no choice to excise all pixels
    6567            exciseAll = true;
    6668        }
     69        psF64 cwp_t = psTimerClear("COMPUTE_WARPED_PIXELS");
     70        printf("time to compute warped pixels: %f\n", cwp_t);
    6771    }
    6872   
     
    8185    do {
    8286        bool exciseImageCube = false;
     87
     88        psTimerStart("PROCESS_COMPONENT");
    8389
    8490        // read the images and copy the data from the inputs to the outputs
     
    95101            // Identify pixels to mask because of streaks
    96102
     103            psTimerStart("GET_STREAK_PIXELS");
     104
    97105            StreakPixels *pixels = getStreakPixels(sfiles, streaks);
    98106
    99             // XXX:
    100             //
    101             // PFS: Need to get mask weight for PM_MASK_DETECTOR.  Is this stored
    102             // in a config somewhere?  Not sure how to properly set the maskValue.
    103 
     107            printf("time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
    104108
    105109            if (checkNonWarpedPixels) {
     110                psTimerStart("EXCISE_NON_WARPED");
     111
    106112                exciseNonWarpedPixels(sfiles, maskStreak);
     113
     114                printf("time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));
    107115            }
    108116           
    109117            if (sfiles->inImage->image) {
     118                psTimerStart("REMOVE_STREAKS");
    110119                for (int i = 0; i < psArrayLength (pixels); ++i) {
    111120                    PixelPos *pixelPos = psArrayGet (pixels, i);
     
    120129                    }
    121130                }
     131                printf("time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
    122132            } else {
    123133                // this component contains an image cube, excise it completely
     
    130140        writeImages(sfiles, exciseImageCube);
    131141
     142        printf("time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT"));
    132143    } while (streakFilesNextExtension(sfiles));
    133144
     145
     146    psTimerStart("CLOSE_IMAGES");
    134147    // close all files
    135148    closeImages(sfiles);
     149    printf("time to close images: %f\n", psTimerClear("CLOSE_IMAGES"));
    136150
    137151    // NOTE: from here on we can't just quit if something goes wrong.
     
    175189    }
    176190#endif  // REPLACE, REMOVE
     191    printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
     192
    177193    // nebServerFree(ourNebServer);
    178194    psFree(config);
     
    183199    //  PAU
    184200    fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "streaksremove");
     201
    185202
    186203    return 0;
Note: See TracChangeset for help on using the changeset viewer.