- Timestamp:
- Jan 20, 2010, 12:59:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.stack.20100120/src/psphotChoosePSF.c
r26262 r26643 2 2 3 3 // try PSF models and select best option 4 pmPSF *psphotChoosePSF (pmReadout *readout, psArray *sources, psMetadata *recipe) {4 bool psphotChoosePSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) { 5 5 6 6 bool status; 7 7 8 8 psTimerStart ("psphot.choose.psf"); 9 10 // find the currently selected readout 11 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 12 psAssert (readout, "missing file?"); 13 14 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 15 psAssert (readout, "missing readout?"); 16 17 psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 18 psAssert (sources, "missing sources?"); 19 20 // select the appropriate recipe information 21 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 22 psAssert (recipe, "missing recipe?"); 9 23 10 24 // bit-masks to test for good/bad pixels 11 25 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 12 assert (maskVal);26 psAssert (maskVal, "missing mask value?"); 13 27 14 28 // bit-mask to mark pixels not used in analysis 15 29 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 16 assert (markVal);30 psAssert (markVal, "missing mark value?"); 17 31 18 32 // maskVal is used to test for rejected pixels, and must include markVal … … 302 316 303 317 psFree (options); 304 return (psf); 318 319 // save PSF on readout->analysis 320 if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_PTR, "psphot psf model", psf)) { 321 psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout"); 322 return false; 323 } 324 325 return true; 305 326 } 306 327 … … 445 466 return true; 446 467 } 468 469 // for now, let's store the detections on the readout->analysis for each readout 470 bool psphotChoosePSF (pmConfig *config, const pmFPAview *view) 471 { 472 bool status = true; 473 474 int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 475 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 476 477 // loop over the available readouts 478 for (int i = 0; i < num; i++) { 479 if (!psphotChoosePSFReadout (config, view, "PSPHOT.INPUT", i, havePSF)) { 480 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 481 return false; 482 } 483 } 484 return true; 485 }
Note:
See TracChangeset
for help on using the changeset viewer.
