IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38531


Ignore:
Timestamp:
Jun 24, 2015, 9:21:09 AM (11 years ago)
Author:
bills
Message:

The update code assumes that all extended models are psf convolved models. Check the recipe
to assert that this is true.
If we drop the modelPSF also drop modelEXT if set. Saw this once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotStackUpdateReadout.c

    r38515 r38531  
    300300    maskVal |= markVal;
    301301
     302    // This code currently assumes that all extended source models are PCM.
     303    // Examine the recipe and make sure that this is true.
     304    psMetadata *allModels = psMetadataLookupMetadata (&status, recipe, "EXTENDED_SOURCE_MODELS");
     305    if (!status) {
     306        psAssert (allModels, "failed to find list of extended source models\n");
     307    }
     308    psMetadataIterator *iter = psMetadataIteratorAlloc (allModels, PS_LIST_HEAD, NULL);
     309    psMetadataItem *item = NULL;
     310    while ((item = psMetadataGetAndIncrement (iter)) != NULL) {
     311        if (item->type != PS_DATA_METADATA) {
     312            psAbort ("Invalid type for EXTENDED_SOURCE_MODEL entry %s, not a metadata folder", item->name);
     313        }
     314        psMetadata *model = (psMetadata *) item->data.md;
     315        // char *modelName = psMetadataLookupStr (&status, model, "MODEL");
     316
     317        char *convolvedWord = psMetadataLookupStr (&status, model, "PSF_CONVOLVED");
     318        if (!status || (strcasecmp (convolvedWord, "true") && strcasecmp (convolvedWord, "false"))) {
     319            psAbort ("PSF_CONVOLVED entry invalid or missing for EXTENDED_SOURCE_MODEL entry %s", item->name);
     320        }
     321        bool convolved = !strcasecmp (convolvedWord, "true");
     322        psAssert (convolved, "EXTENDED SOURCE model %s is not convolved. This code is not ready for that\n", item->name);
     323    }
     324    psFree (iter);
     325
    302326    // setup the PSF fit radius details
    303327    psphotInitRadiusPSF (recipe, readout);
     
    343367            psFree(source->modelPSF) ;
    344368            modelPSF = NULL;
     369            // At least once I saw a source with an extended model but no psf model
     370            psFree(source->modelEXT);
     371            source->modelEXT = NULL;
    345372        }
    346373
Note: See TracChangeset for help on using the changeset viewer.