IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23965


Ignore:
Timestamp:
Apr 24, 2009, 2:19:31 PM (17 years ago)
Author:
bills
Message:

various changes

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

Legend:

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

    r23946 r23965  
    1313// if remove is true the calling program is streaksremove and the recovery files are outputs
    1414// if false the recovery files are inputs
    15 streakFiles *openFiles(pmConfig *config, bool remove)
     15streakFiles *openFiles(pmConfig *config, bool remove, char *program_name)
    1616{
    1717    bool status;
     
    2121
    2222    sf->config = config;
     23    sf->program_name = basename(program_name);
    2324
    2425    // error checking is done by sFileOpen. If a file can't be opened we just exit
     
    914915deleteFile(sFile *sfile)
    915916{
    916 #if 0
    917     // XXX API for nebDelete has changed; need to fix this later
    918917    if (sfile->inNebulous) {
    919918        nebServer *server = getNebServer(NULL);
     
    930929        }
    931930    }
    932 #endif
    933931    return true;
    934932}
     
    10181016        }
    10191017        if (printCounts) {
    1020             printf("time to NAN mask pixels: %f\n", psTimerClear("NAN_MASKED"));
     1018            psLogMsg(sfiles->program_name, PS_LOG_INFO, "time to NAN mask pixels: %f\n", psTimerClear("NAN_MASKED"));
    10211019            int totalPixels = image->numRows * image->numCols;
    1022             printf("pixels:        %10ld\n", totalPixels);
    1023             printf("masked pixels: %10ld %4.2f%%\n", maskedPixels, 100. * maskedPixels / totalPixels);
    1024             printf("nand pixels:   %10ld %4.2f%%\n", nandPixels, 100. * nandPixels / totalPixels);
     1020            psLogMsg(sfiles->program_name, PS_LOG_INFO, "pixels:        %10ld\n", totalPixels);
     1021            psLogMsg(sfiles->program_name, PS_LOG_INFO, "masked pixels: %10ld %4.2f%%\n", maskedPixels, 100. * maskedPixels / totalPixels);
     1022            psLogMsg(sfiles->program_name, PS_LOG_INFO, "nand pixels:   %10ld %4.2f%%\n", nandPixels, 100. * nandPixels / totalPixels);
    10251023            if (weight) {
    1026                 printf("nand weights:  %10ld %4.2f%%\n", nandWeights, 100. * nandWeights / totalPixels);
     1024                psLogMsg(sfiles->program_name, PS_LOG_INFO, "nand weights:  %10ld %4.2f%%\n", nandWeights, 100. * nandWeights / totalPixels);
    10271025            }
    10281026        }
     
    10501048strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask)
    10511049{
    1052     if (sfiles->inMask->header) {
     1050    if (sfiles->inMask && sfiles->inMask->header) {
    10531051        if (!pmConfigMaskReadHeader(sfiles->config, sfiles->inMask->header)) {
    10541052            streaksExit("failed to read mask values from file", PS_EXIT_CONFIG_ERROR);
  • trunk/magic/remove/src/streaksrelease.c

    r23257 r23965  
    3737
    3838    // Does true work here?
    39     streakFiles *sfiles = openFiles(config, true);
     39    streakFiles *sfiles = openFiles(config, true, argv[0]);
    4040
    4141    if (sfiles->stage == IPP_STAGE_RAW) {
  • trunk/magic/remove/src/streaksremove.c

    r23936 r23965  
    3434    }
    3535
    36     streakFiles *sfiles = openFiles(config, true);
     36    streakFiles *sfiles = openFiles(config, true, argv[0]);
    3737    setupAstrometry(sfiles);
    3838
     
    6565        }
    6666        psF64 cwp_t = psTimerClear("COMPUTE_WARPED_PIXELS");
    67         printf("time to compute warped pixels: %f\n", cwp_t);
     67        psLogMsg("streaksremove", PS_LOG_INFO, "time to compute warped pixels: %f\n", cwp_t);
    6868    }
    6969   
     
    113113                                      sfiles->inImage->numCols, sfiles->inImage->numRows);
    114114
    115             printf("time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
     115            psLogMsg("streaksremove", PS_LOG_INFO, "time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
    116116
    117117           
     
    124124                    exciseNonWarpedPixels(sfiles, maskStreak);
    125125
    126                     printf("time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));
     126                    psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));
    127127                }
    128128                totalStreakPixels +=  psArrayLength(pixels);
     
    140140                    }
    141141                }
    142                 printf("time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
     142                psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
    143143
    144144                if (nanForRelease) {
     
    161161        writeImages(sfiles, exciseImageCube);
    162162
    163         printf("time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT"));
     163        psLogMsg("streaksremove", PS_LOG_INFO, "time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT"));
    164164    } while (streakFilesNextExtension(sfiles));
    165165
    166166    psFree(streaks);
    167167
    168     printf("pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, 100. * totalStreakPixels / totalPixels);
     168    psLogMsg("streaksremove", PS_LOG_INFO, "pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, 100. * totalStreakPixels / totalPixels);
    169169
    170170    psTimerStart("CLOSE_IMAGES");
    171171    // close all files
    172172    closeImages(sfiles);
    173     printf("time to close images: %f\n", psTimerClear("CLOSE_IMAGES"));
     173    psLogMsg("streaksremove", PS_LOG_INFO, "time to close images: %f\n", psTimerClear("CLOSE_IMAGES"));
    174174
    175175    // NOTE: from here on we can't just quit if something goes wrong.
     
    218218    streaksNebulousCleanup();
    219219    pmConfigDone();
    220     printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
     220    psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
    221221    psLibFinalize();
    222222
  • trunk/magic/remove/src/streaksreplace.c

    r23258 r23965  
    3333    }
    3434
    35     streakFiles *sfiles = openFiles(config, false);
     35    streakFiles *sfiles = openFiles(config, false, argv[0]);
    3636
    3737    if (sfiles->stage == IPP_STAGE_RAW) {
Note: See TracChangeset for help on using the changeset viewer.