IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21256


Ignore:
Timestamp:
Feb 1, 2009, 11:53:14 AM (17 years ago)
Author:
eugene
Message:

remove old test versions using psphotReadout; use modification of psphotReadoutFindPSF API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r21183 r21256  
    322322    fileActivation(config, independentFiles, false);
    323323
    324     // We need a new PSF model for the warped frame
    325     // It would be good to generate this analytically, but that's going to be tricky.
    326     // We have a list of sources, so we could use those to redetermine the PSF model.
    327     // Until Gene makes the necessary adaptations to psphot, we will simply redetermine the PSF model from
    328     // scratch.
     324    // 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.
     325    // We have a list of sources, so we use those to redetermine the PSF model.
     326
    329327    if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) {
    330328        fileActivation(config, photFiles, true);
    331329        ioChecksBefore(config);
    332330
    333         // Tweak recipe
    334         psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes,
    335                                                        PSPHOT_RECIPE); // Recipe for psphot
    336         if (!psphotRecipe) {
    337             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE);
    338             return false;
    339         }
    340 
    341         psMetadataAddStr(psphotRecipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE,
    342                          "Break point for psphot operations", "PSFMODEL");
    343         psMetadataAddBool(psphotRecipe, PS_LIST_TAIL, PSPHOT_RECIPE_PSF_FAKE_ALLOW, PS_META_REPLACE,
    344                           "Don't allow psphot to fit a fake PSF!", false);
    345 
    346 #if !PSPHOT_FIND_PSF
    347         // Get rid of the transformed sources so that we can measure the PSF
    348         psMetadataRemoveKey(output->analysis, "PSPHOT.SOURCES");
    349 #endif
    350 
     331        // supply the readout and fpa of interest to psphot
    351332        pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
    352333        pmFPACopy(photFile->fpa, outFPA);
     
    355336        view->chip = view->cell = view->readout = 0;
    356337
    357 #if PSPHOT_FIND_PSF
    358338        // Need to adjust the weight --- the main operation in psphotReadoutFindPSF is not determining the
    359339        // signficance of sources, but looking at the significance of individual pixels.
     
    363343        psBinaryOp(photRO->weight, photRO->weight, "*", psScalarAlloc(vf, PS_TYPE_F32));
    364344
    365         if (!psphotReadoutFindPSF(config, view)) {
     345        // grab the sources of interest from the storage location (pmFPAfile PSPHOT.INPUT.CMF)
     346        psArray *sources = psphotLoadPSFSources (config, view);
     347        if (!sources) {
     348            psError(PS_ERR_UNKNOWN, false, "No sources supplied to measure PSF");
     349            return false;
     350        }
     351
     352        // measure the PSF using these sources
     353        if (!psphotReadoutFindPSF(config, view, sources)) {
    366354            psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
    367355            return false;
    368356        }
    369 #else
    370         if (!psphotReadout(config, view)) {
    371             psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
    372             return false;
    373         }
    374 #endif
    375 
     357
     358// XXX EAM : put this in a visualization function
    376359#if (TESTING)
    377360        {
Note: See TracChangeset for help on using the changeset viewer.