IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14326


Ignore:
Timestamp:
Jul 19, 2007, 2:51:49 PM (19 years ago)
Author:
eugene
Message:

update to handle current recipe functions

File:
1 edited

Legend:

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

    r13900 r14326  
    2525    // what fitting mode to use?
    2626    char *fitModeWord = psMetadataLookupStr (&status, recipe, "TEST_FIT_MODE");
    27     if (!status) {
     27    if (!status || !strcasecmp (fitModeWord, "DEFAULT")) {
    2828        fitModeWord = DEFAULT_MODE;
    2929    }
     
    3333    // in fitMode, psf sets the model type
    3434    if (fitMode == PM_SOURCE_FIT_PSF) {
     35        // XXX load psf using psphotLoadPSF
    3536        char *psfFile = psMetadataLookupStr (&status, recipe, "PSF_INPUT_FILE");
    3637        if (!status) psAbort("PSF_INPUT_FILE not supplied");
     
    4142        // find the model: supplied by user or first in the PSF_MODEL list
    4243        char *modelName  = psMetadataLookupStr (&status, recipe, "TEST_FIT_MODEL");
    43         if (modelName == NULL) {
     44        if (!status || !strcasecmp (modelName, "DEFAULT")) {
    4445            // get the list pointers for the PSF_MODEL entries
    4546
     
    6566    // find the fitting parameters (try test values first)
    6667    float INNER = psMetadataLookupF32 (&status, recipe, "TEST_FIT_INNER_RADIUS");
    67     if (!status) {
     68    if (!status || !isfinite(INNER)) {
    6869        INNER = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS");
    6970    }
    7071
    7172    float OUTER = psMetadataLookupF32 (&status, recipe, "TEST_FIT_OUTER_RADIUS");
    72     if (!status) {
     73    if (!status || !isfinite(OUTER)) {
    7374        OUTER = psMetadataLookupF32 (&status, recipe, "SKY_OUTER_RADIUS");
    7475    }
    7576
    7677    float RADIUS = psMetadataLookupF32 (&status, recipe, "TEST_FIT_RADIUS");
    77     if (!status) {
     78    if (!status || !isfinite(RADIUS)) {
    7879        RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_FIT_RADIUS");
    7980    }
    8081
    8182    float mRADIUS = psMetadataLookupF32 (&status, recipe, "TEST_MOMENTS_RADIUS");
    82     if (!status) {
     83    if (!status || !isfinite(mRADIUS)) {
    8384        mRADIUS = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS");
    8485    }
     
    103104
    104105    fprintf (stderr, "sum: %f @ (%f, %f)\n", source->moments->Sum, source->moments->x, source->moments->y);
     106    fprintf (stderr, "moments: %f, %f - %f\n", source->moments->Sx, source->moments->Sy, source->moments->Sxy);
    105107
    106108    psEllipseMoments moments;
     
    128130        sprintf (name, "TEST_FIT_PAR%d", i);
    129131        value = psMetadataLookupF32 (&status, recipe, name);
    130         if (status) {
     132        if (status && isfinite (value)) {
    131133            params[i] = value;
    132134        }
     
    172174    pmSourcePhotometryModel (&fitMag, model);
    173175    pmSourcePhotometryAper  (&obsMag, model, source->pixels, source->maskObj, maskVal);
    174     fprintf (stderr, "ap: %f, fit: %f, apmifit: %f\n", obsMag, fitMag, obsMag - fitMag);
     176    fprintf (stderr, "ap: %f, fit: %f, apmifit: %f, nIter: %d\n", obsMag, fitMag, obsMag - fitMag, model->nIter);
    175177
    176178    // write out positive object
Note: See TracChangeset for help on using the changeset viewer.