IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 10, 2011, 4:12:14 PM (15 years ago)
Author:
bills
Message:

if no less than 2 images have sources fail with bad quality. This happens when the inputs are destreaked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackPrepare.c

    r31158 r31513  
    144144    int numCols = 0, numRows = 0;   // Size of image
    145145    options->sumExposure = 0.0;
     146    int numWithSources = 0;
    146147    for (int i = 0; i < num; i++) {
    147148        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest
     
    188189            pmReadout *ro = pmFPAviewThisReadout(view, file->fpa); // Readout with sources
    189190            detections = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.DETECTIONS"); // Sources
    190             if (!detections || !detections->allSources) {
     191            if (!detections || !detections->allSources || !detections->allSources->n) {
    191192                psWarning("No detections found for image %d --- rejecting.", i);
    192193                options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_CAL;
     
    196197
    197198            options->sourceLists->data[i] = psMemIncrRefCounter(detections->allSources);
     199            numWithSources++;
    198200        }
    199201
     
    230232            ppStackFileActivation(config, PPSTACK_FILES_PREPARE, true);
    231233        }
     234    }
     235    if (numWithSources < 2) {
     236        // This can happen if the inputs have been destreaked
     237        psErrorStackPrint(stderr, "Not enough inputs have sources");
     238        psWarning("No inputs have sources --- suspect bad data quality.");
     239        if (options->quality == 0) {
     240            options->quality = PPSTACK_ERR_DATA;
     241        }
     242        psErrorClear();
     243        psFree(view);
     244        return false;
    232245    }
    233246
     
    308321        psFree(psfs);
    309322        if (!options->psf) {
     323#if 1
    310324            psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
     325#else
     326            // This will repair the problem reproted in ticket 1427 but we aren't yet sure
     327            // why ppStackPSF is failing so we are going to continue to fault for now
     328            int errorCode = psErrorCodeLast();
     329            if (errorCode == PPSTACK_ERR_PSF) {
     330                psErrorStackPrint(stderr, "Unable to determine output PSF.");
     331                psWarning("Unable to determine output PSF --- suspect bad data quality.");
     332                if (options->quality == 0) {
     333                    options->quality = errorCode;
     334                }
     335                psErrorClear();
     336            } else {
     337                psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
     338            }
     339#endif // notyet
    311340            psFree(view);
    312341            return false;
Note: See TracChangeset for help on using the changeset viewer.