IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23688 for trunk/ppImage


Ignore:
Timestamp:
Apr 2, 2009, 2:51:37 PM (17 years ago)
Author:
Paul Price
Message:

Merging in branches/pap/ from r23685. Some conflicts, most notably in ippTools, but these resolved fairly simply. Only question mark is on regtool reversion, but I think I got it right. Everything builds fine.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ppImage

  • trunk/ppImage/src/ppImage.h

    r23411 r23688  
    4040    bool doAstromMosaic;                // full-mosaic Astrometry
    4141    bool doStats;                       // call ppStats on the image
    42     bool checkCTE;                      // measure pixel-based variance
     42    bool checkCTE;                      // measure pixel-based variance
    4343
    4444    // output files requested
     
    8888    float remnanceThresh;               // Threshold for remnance detection
    8989
    90     char *normClass;                    // class to use for per-class normalization
     90    char *normClass;                    // class to use for per-class normalization
    9191} ppImageOptions;
    9292
     
    146146bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName);
    147147
    148 bool ppImagePhotom (pmConfig *config, pmFPAview *view);
    149 bool ppImageAstrom (pmConfig *config);
    150 bool ppImageAddstar (pmConfig *config);
     148bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view);
     149bool ppImageAstrom(pmConfig *config, psMetadata *stats);
     150bool ppImageAddstar(pmConfig *config);
    151151
    152152// Subtract background from the chip-mosaicked image
  • trunk/ppImage/src/ppImageAstrom.c

    r16084 r23688  
    77// this function is mostly equivalent to the top-level of psastro, with some
    88// modifications since the data has already been loaded.
    9 bool ppImageAstrom (pmConfig *config) {
     9bool ppImageAstrom (pmConfig *config, psMetadata *stats) {
    1010
    1111    bool status;
     
    2727    }
    2828
    29     if (!psastroAnalysis (config)) {
     29    if (!psastroAnalysis(config, stats)) {
    3030        psError (PSASTRO_ERR_UNKNOWN, false, "failure in psastro analysis\n");
    3131        return false;
  • trunk/ppImage/src/ppImageLoop.c

    r23411 r23688  
    1313bool ppImageLoop(pmConfig *config, ppImageOptions *options)
    1414{
    15     psMetadata *stats = options->doStats ? psMetadataAlloc() : NULL; // Statistics to output
     15    psMetadata *stats = NULL;          // Statistics to output
    1616    float timeDetrend = 0;              // Amount of time spent in detrend
    1717    float timePhot = 0;                 // Amount of time spent in photometry
     18
     19    if (options->doStats) {
     20        stats = psMetadataAlloc();
     21        psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);
     22    }
    1823
    1924    bool status;                        // Status of MD lookup
     
    139144        psTimerStart(TIMER_PHOT);
    140145        if (options->doPhotom) {
    141             if (!ppImagePhotom(config, view)) {
     146            if (!ppImagePhotom(stats, config, view)) {
    142147                ESCAPE("error running photometry.");
    143148            }
     
    200205    // this also performs the psastro file IO
    201206    if (options->doAstromChip || options->doAstromMosaic) {
    202         if (!ppImageAstrom(config)) {
     207        if (!ppImageAstrom(config, stats)) {
    203208            ESCAPE("error running astrometry.");
    204209        }
  • trunk/ppImage/src/ppImagePhotom.c

    r20410 r23688  
    66
    77// In this function, we perform the psphot analysis routine for the chip-mosaicked images
    8 bool ppImagePhotom (pmConfig *config, pmFPAview *view) {
     8bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view) {
    99
    1010    bool status;
     
    1212    pmReadout *readout;
    1313
    14     psphotInit ();
     14    psphotInit();
    1515
    1616    // find or define a pmFPAfile PSPHOT.INPUT
     
    3737            // run the actual photometry analysis
    3838            if (!psphotReadout (config, view)) {
    39                 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    40                 return false;
     39                // This is likely a data quality issue
     40                // XXX Split into multiple cases using error codes?
     41                psErrorStackPrint(stderr, "Unable to perform photometry on image");
     42                psWarning("Unable to perform photometry on image --- suspect bad data quality.");
     43                if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) {
     44                    psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
     45                                     "Unable to perform photometry on image", psErrorCodeLast());
     46                }
     47                psErrorClear();
     48                psphotFilesActivate(config, false);
    4149            }
    4250
    43             // we want to save the MASK as modified by psphot, but not the data or weight
    44             // free the old mask and replace with a memory copy of the new mask
    45             pmReadout *oldReadout = pmFPAviewThisReadout (view, input->src);
    46             pmReadout *newReadout = pmFPAviewThisReadout (view, input->fpa);
    47             psFree (oldReadout->mask);
    48             oldReadout->mask = psMemIncrRefCounter (newReadout->mask);
     51            // we want to save the MASK as modified by psphot, but not the data or weight
     52            // free the old mask and replace with a memory copy of the new mask
     53            pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src);
     54            pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa);
     55            psFree (oldReadout->mask);
     56            oldReadout->mask = psMemIncrRefCounter(newReadout->mask);
    4957        }
    5058    }
Note: See TracChangeset for help on using the changeset viewer.