IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 22, 2010, 11:45:18 AM (16 years ago)
Author:
Paul Price
Message:

Adding scaling of kernel parameters by seeing FWHMs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c

    r26475 r26671  
    176176
    177177
    178         bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");
    179         psArray *sources = NULL;
    180 
    181         if (options->convolve || options->matchZPs || redoPhot) {
    182             pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
    183             sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
    184             if (!sources) {
    185                 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
    186                 return NULL;
    187             }
    188             options->sourceLists->data[index] = psMemIncrRefCounter(sources);
    189         }
     178        bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");
     179        psArray *sources = NULL;
     180
     181        if (options->convolve || options->matchZPs || redoPhot) {
     182            pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
     183            sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
     184            if (!sources) {
     185                psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
     186                return NULL;
     187            }
     188            options->sourceLists->data[index] = psMemIncrRefCounter(sources);
     189        }
    190190
    191191        // Re-do photometry if we don't trust the source lists
     
    194194            pmFPAfileActivate(config->files, false, NULL);
    195195            ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, index);
    196             if (options->convolve) {
    197                 pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
    198             }
     196            if (options->convolve) {
     197                pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
     198            }
    199199            pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", index); // File
    200200            pmFPAview *photView = ppStackFilesIterateDown(config);
     
    225225    }
    226226    psFree(fileIter);
     227
     228    psString log = psStringCopy("Input seeing FWHMs:\n"); // Log message
     229    bool havePSFs = false;                                // Do we have any PSFs?
     230    options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32);
     231    psVectorInit(options->inputSeeing, NAN);
     232    for (int i = 0; i < num; i++) {
     233        pmPSF *psf = psfs->data[i];     // PSF for image
     234        if (!psf) {
     235            continue;
     236        }
     237        havePSFs = true;
     238        float fwhm = pmPSFtoFWHM(psf, 0.5 * numCols, 0.5 * numRows); // FWHM for image
     239        psStringAppend(&log, "Input %d: %f\n", i, fwhm);
     240        options->inputSeeing->data.F32[i] = fwhm;
     241    }
     242    if (havePSFs) {
     243        psLogMsg("ppStack", PS_LOG_INFO, "%s", log);
     244    }
     245    psFree(log);
    227246
    228247    // Generate target PSF
     
    237256        psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "PSF.TARGET", PS_DATA_UNKNOWN,
    238257                         "Target PSF for stack", options->psf);
     258        options->targetSeeing = pmPSFtoFWHM(options->psf, 0.5 * numCols, 0.5 * numRows); // FWHM for target
     259        psLogMsg("ppStack", PS_LOG_INFO, "Target seeing FWHM: %f\n", options->targetSeeing);
    239260
    240261        pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSTACK.OUTPUT"); // Output chip
Note: See TracChangeset for help on using the changeset viewer.