IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23688 for trunk/pswarp


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:
1 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/pswarp/src/Makefile.am

    r23170 r23688  
    2424        pswarpMatchRange.c              \
    2525        pswarpParseCamera.c             \
    26         pswarpPixelFraction.c           \
     26        pswarpPixelsLit.c               \
    2727        pswarpSetMaskBits.c             \
    2828        pswarpSetThreads.c              \
  • trunk/pswarp/src/pswarp.h

    r23487 r23688  
    102102                          const char *filename, const char *argname);
    103103
    104 /// Check to see if the readout has a minimum fraction of "lit" pixels
    105 bool pswarpPixelFraction(const pmReadout *readout, ///< Readout to inspect
    106                          psMetadata *stats, ///< Statistics to update with the result
    107                          const pmConfig *config ///< Configuration
     104/// Get the range of lit pixels
     105bool pswarpPixelsLit(const pmReadout *readout, ///< Readout to inspect
     106                     psMetadata *stats, ///< Statistics to update with the result
     107                     const pmConfig *config ///< Configuration
    108108    );
    109109
  • trunk/pswarp/src/pswarpArguments.c

    r23314 r23688  
    163163    }
    164164
    165     float acceptFrac = psMetadataLookupF32(&status, recipe, "ACCEPT.FRAC"); ///< Min fraction of good pixels
    166     if (!status) {
    167         acceptFrac = 0.0;
    168         psWarning("ACCEPT.FRAC is not set in the %s recipe --- defaulting to %f.", PSWARP_RECIPE, poorFrac);
    169     }
    170 
    171165    // Set recipe values in the recipe (since we've possibly altered some)
    172166    psMetadataAddS32(recipe, PS_LIST_TAIL, "GRID.NX", PS_META_REPLACE,
     
    180174    psMetadataAddF32(recipe, PS_LIST_TAIL, "POOR.FRAC", PS_META_REPLACE,
    181175                     "Fraction of bad flux for a pixel to be marked as poor", poorFrac);
    182     psMetadataAddF32(recipe, PS_LIST_TAIL, "ACCEPT.FRAC", PS_META_REPLACE,
    183                      "Minimum fraction of good pixels for result to be accepted", acceptFrac);
    184176
    185177    // Set recipe values in the arguments
     
    194186    psMetadataAddF32(config->arguments, PS_LIST_TAIL, "POOR.FRAC", 0,
    195187                     "Fraction of bad flux for a pixel to be marked as poor", poorFrac);
    196     psMetadataAddF32(config->arguments, PS_LIST_TAIL, "ACCEPT.FRAC", 0,
    197                      "Minimum fraction of good pixels for result to be accepted", acceptFrac);
    198188
    199189    psTrace("pswarp", 1, "Done with pswarpArguments...\n");
  • trunk/pswarp/src/pswarpErrorCodes.dat

    r11268 r23688  
    99IO                      Problem in FITS I/O
    1010DATA                    Problem in data values
     11NO_OVERLAP              No overlap between input and skycell
  • trunk/pswarp/src/pswarpLoop.c

    r23629 r23688  
    142142        psFree(resolved);
    143143        stats = psMetadataAlloc();
     144        psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);
    144145    }
    145146
     
    273274    }
    274275
     276    if (!output->data_exists) {
     277        psWarning("No overlap between input and skycell.");
     278        if (stats) {
     279            psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
     280                             "No overlap between input and skycell", PSWARP_ERR_NO_OVERLAP);
     281        }
     282        psphotFilesActivate(config, false);
     283        psFree(cells);
     284        psFree(view);
     285        return true;
     286    }
     287
    275288    pmCell *outCell = output->parent;   ///< Output cell
    276289    pmChip *outChip = outCell->parent;  ///< Output chip
    277290    pmFPA *outFPA = outChip->parent;    ///< Output FP
    278291
    279     if (!pswarpPixelFraction(output, stats, config)) {
    280         // Don't write output images, and don't bother about anything else
    281         output->data_exists = outCell->data_exists = outChip->data_exists = false;
     292    if (!pswarpPixelsLit(output, stats, config)) {
     293        psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions.");
    282294        psFree(cells);
    283295        psFree(view);
    284         goto COMPLETED;
     296        return false;
    285297    }
    286298
     
    363375    fileActivation(config, independentFiles, false);
    364376
    365     // We need a new PSF model for the warped frame.  It would be good to generate this analytically, but that's going to be tricky.
    366     // We have a list of sources, so we use those to redetermine the PSF model.
     377    // We need a new PSF model for the warped frame.  It would be good to generate this analytically, but
     378    // that's going to be tricky.  We have a list of sources, so we use those to redetermine the PSF model.
    367379
    368380    if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) {
     
    393405        // measure the PSF using these sources
    394406        if (!psphotReadoutFindPSF(config, view, sources)) {
    395             psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
    396             return false;
     407            // This is likely a data quality issue
     408            // XXX Split into multiple cases using error codes?
     409            psErrorStackPrint(stderr, "Unable to determine PSF");
     410            psWarning("Unable to determine PSF --- suspect bad data quality.");
     411            if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) {
     412                psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
     413                                 "Unable to determine PSF", psErrorCodeLast());
     414            }
     415            psErrorClear();
     416            psphotFilesActivate(config, false);
    397417        }
    398418
     
    447467    // Now done with the skycell side of things
    448468
    449     COMPLETED:
    450469    // Write out summary statistics
    451470    if (stats) {
Note: See TracChangeset for help on using the changeset viewer.