Changeset 14326
- Timestamp:
- Jul 19, 2007, 2:51:49 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotModelTest.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotModelTest.c
r13900 r14326 25 25 // what fitting mode to use? 26 26 char *fitModeWord = psMetadataLookupStr (&status, recipe, "TEST_FIT_MODE"); 27 if (!status ) {27 if (!status || !strcasecmp (fitModeWord, "DEFAULT")) { 28 28 fitModeWord = DEFAULT_MODE; 29 29 } … … 33 33 // in fitMode, psf sets the model type 34 34 if (fitMode == PM_SOURCE_FIT_PSF) { 35 // XXX load psf using psphotLoadPSF 35 36 char *psfFile = psMetadataLookupStr (&status, recipe, "PSF_INPUT_FILE"); 36 37 if (!status) psAbort("PSF_INPUT_FILE not supplied"); … … 41 42 // find the model: supplied by user or first in the PSF_MODEL list 42 43 char *modelName = psMetadataLookupStr (&status, recipe, "TEST_FIT_MODEL"); 43 if ( modelName == NULL) {44 if (!status || !strcasecmp (modelName, "DEFAULT")) { 44 45 // get the list pointers for the PSF_MODEL entries 45 46 … … 65 66 // find the fitting parameters (try test values first) 66 67 float INNER = psMetadataLookupF32 (&status, recipe, "TEST_FIT_INNER_RADIUS"); 67 if (!status ) {68 if (!status || !isfinite(INNER)) { 68 69 INNER = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS"); 69 70 } 70 71 71 72 float OUTER = psMetadataLookupF32 (&status, recipe, "TEST_FIT_OUTER_RADIUS"); 72 if (!status ) {73 if (!status || !isfinite(OUTER)) { 73 74 OUTER = psMetadataLookupF32 (&status, recipe, "SKY_OUTER_RADIUS"); 74 75 } 75 76 76 77 float RADIUS = psMetadataLookupF32 (&status, recipe, "TEST_FIT_RADIUS"); 77 if (!status ) {78 if (!status || !isfinite(RADIUS)) { 78 79 RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_FIT_RADIUS"); 79 80 } 80 81 81 82 float mRADIUS = psMetadataLookupF32 (&status, recipe, "TEST_MOMENTS_RADIUS"); 82 if (!status ) {83 if (!status || !isfinite(mRADIUS)) { 83 84 mRADIUS = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS"); 84 85 } … … 103 104 104 105 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); 105 107 106 108 psEllipseMoments moments; … … 128 130 sprintf (name, "TEST_FIT_PAR%d", i); 129 131 value = psMetadataLookupF32 (&status, recipe, name); 130 if (status ) {132 if (status && isfinite (value)) { 131 133 params[i] = value; 132 134 } … … 172 174 pmSourcePhotometryModel (&fitMag, model); 173 175 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); 175 177 176 178 // write out positive object
Note:
See TracChangeset
for help on using the changeset viewer.
