IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/magic/remove/src/streaksremove.c

    r21481 r24244  
    2323    }
    2424
    25     psMetadata *masks = psMetadataLookupMetadata(&status, config->recipes, "MASKS");
    26     if (!status) {
    27         psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n");
    28         streaksExit("", PS_EXIT_CONFIG_ERROR);
    29     }
    30     double maskStreak = (double) psMetadataLookupU8(&status, masks, "STREAK");
    31     if (!status) {
    32         psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n");
    33         streaksExit("", PS_EXIT_CONFIG_ERROR);
    34     }
    35 
    36     // optionally setting pixels with any mask bits execpt POOR.WARP to NAN
    37     psU8 poorWarp = (double) psMetadataLookupU8(&status, masks, "POOR.WARP");
    38     if (!status) {
    39         psError(PM_ERR_CONFIG, false, "failed to lookup mask value for POOR.WARP in recipes\n");
    40         streaksExit("", PS_EXIT_CONFIG_ERROR);
    41     }
    42     psU8 maskMask = ~poorWarp;
     25    psU32 maskStreak = 0;
     26    psU32 maskMask = 0;
    4327
    4428    psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS");
     
    5034    }
    5135
    52     streakFiles *sfiles = openFiles(config, true);
     36    streakFiles *sfiles = openFiles(config, true, argv[0]);
    5337    setupAstrometry(sfiles);
    5438
     
    8165        }
    8266        psF64 cwp_t = psTimerClear("COMPUTE_WARPED_PIXELS");
    83         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);
    8468    }
    8569   
     
    11498        }
    11599
     100        // now that we've read the input files, lookup the mask values
     101        if (maskStreak == 0) {
     102            strkGetMaskValues(sfiles, &maskStreak, &maskMask);
     103        }
     104
    116105        totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols;
    117106
     
    124113                                      sfiles->inImage->numCols, sfiles->inImage->numRows);
    125114
    126             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"));
    127116
    128117           
     
    131120                    psTimerStart("EXCISE_NON_WARPED");
    132121
     122                    // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel
     123                    // is excised as part of the destreaking process)
    133124                    exciseNonWarpedPixels(sfiles, maskStreak);
    134125
    135                     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"));
    136127                }
    137128                totalStreakPixels +=  psArrayLength(pixels);
     
    149140                    }
    150141                }
    151                 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"));
    152143
    153144                if (nanForRelease) {
     
    170161        writeImages(sfiles, exciseImageCube);
    171162
    172         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"));
    173164    } while (streakFilesNextExtension(sfiles));
    174165
    175166    psFree(streaks);
    176167
    177     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);
    178169
    179170    psTimerStart("CLOSE_IMAGES");
    180171    // close all files
    181172    closeImages(sfiles);
    182     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"));
    183174
    184175    // NOTE: from here on we can't just quit if something goes wrong.
     
    227218    streaksNebulousCleanup();
    228219    pmConfigDone();
    229     printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
     220    psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
    230221    psLibFinalize();
    231222
     
    648639            }
    649640        }
     641        // XXX: check this
    650642        // Assumption: there are no mask and weight images for video cells
    651643        return;
Note: See TracChangeset for help on using the changeset viewer.