IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15608


Ignore:
Timestamp:
Nov 13, 2007, 12:02:34 PM (18 years ago)
Author:
Paul Price
Message:

Adding code to calculate fraction of good pixels. Set a boolean in the output stats indicating whether the result should be accepted.

Location:
trunk/pswarp/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/Makefile.am

    r15412 r15608  
    1414        pswarpMatchRange.c              \
    1515        pswarpParseCamera.c             \
     16        pswarpPixelFraction.c           \
    1617        pswarpTransformReadout_Opt.c    \
    1718        pswarpVersion.c           
    18 #       pswarpTransformReadout.c
    1919
    2020noinst_HEADERS = \
  • trunk/pswarp/src/pswarp.h

    r14874 r15608  
    5555bool pswarpMapSetLocalModel (pswarpMap *map, pmReadout *dest, pmReadout *src, int ix, int iy);
    5656
    57 bool pswarpDefineSkycell (pmFPAfile **outFile, pmConfig **outConfig, pmConfig *config, const char *filename, const char *argname);
     57bool pswarpDefineSkycell (pmFPAfile **outFile, pmConfig **outConfig, pmConfig *config,
     58                          const char *filename, const char *argname);
     59
     60/// Check to see if the readout has a minimum fraction of "lit" pixels
     61bool pswarpPixelFraction(const pmReadout *readout, ///< Readout to inspect
     62                         psMetadata *stats, ///< Statistics to update with the result
     63                         const pmConfig *config ///< Configuration
     64    );
     65
  • trunk/pswarp/src/pswarpLoop.c

    r14901 r15608  
    215215    pmCell *outCell = output->parent;   // Output cell
    216216    pmChip *outChip = outCell->parent;  // Output chip
    217     pmFPA *outFPA = outChip->parent;    // Output FPA
     217    pmFPA *outFPA = outChip->parent;    // Output FP
     218
     219    if (!pswarpPixelFraction(output, stats, config)) {
     220        // Don't write output images, and don't bother about anything else
     221        output->data_exists = outCell->data_exists = outChip->data_exists = false;
     222        psFree(cells);
     223        psFree(view);
     224        goto COMPLETED;
     225    }
    218226
    219227    if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) {
    220228        psError(PS_ERR_UNKNOWN, false, "Unable to average cell concepts.");
    221229        psFree(stats);
     230        psFree(cells);
    222231        psFree(view);
    223232        return false;
     
    266275        view->chip = view->cell = view->readout = 0;
    267276        if (!psphotReadout(config, view)) {
    268             psError(psErrorCodeLast(), false, "Unable to determine PSF for warped image.\n");
    269             psFree(view);
    270             return false;
     277            // Can't do anything about it; let it continue
     278            psErrorStackPrint(stderr, "Unable to determine PSF for warped image.\n");
     279            psErrorClear();
    271280        }
    272281        psFree(view);
     
    319328    // Now done with the skycell side of things
    320329
     330    COMPLETED:
    321331    // Write out summary statistics
    322332    if (stats) {
Note: See TracChangeset for help on using the changeset viewer.