- Timestamp:
- May 10, 2010, 5:24:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.20100506/src/psphotMergeSources.c
r27657 r27909 6 6 7 7 // for now, let's store the detections on the readout->analysis for each readout 8 bool psphotMergeSources (pmConfig *config, const pmFPAview *view )8 bool psphotMergeSources (pmConfig *config, const pmFPAview *view, const char *filerule) 9 9 { 10 10 bool status = true; … … 15 15 // loop over the available readouts 16 16 for (int i = 0; i < num; i++) { 17 if (!psphotMergeSourcesReadout (config, view, "PSPHOT.INPUT", i)) {18 psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for PSPHOT.INPUT entry %d", i);17 if (!psphotMergeSourcesReadout (config, view, filerule, i)) { 18 psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for %s entry %d", filerule, i); 19 19 return false; 20 20 } … … 24 24 25 25 // add newly selected sources to the existing list of sources 26 bool psphotMergeSourcesReadout (pmConfig *config, const pmFPAview *view, const char *file name, int index) {26 bool psphotMergeSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index) { 27 27 28 28 bool status; 29 29 30 30 // find the currently selected readout 31 pmFPAfile *file = pmFPAfileSelectSingle(config->files, file name, index); // File of interest31 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest 32 32 psAssert (file, "missing file?"); 33 33 … … 71 71 // only expect a single entry for PSPHOT.INPUT.CMF and PSPHOT.SOURCES.TEXT, so we can only 72 72 // associate input sources with a single entry for PSPHOT.INPUT 73 bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view ) {73 bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view, const char *filerule) { 74 74 75 75 bool status; … … 79 79 80 80 // find the currently selected readout 81 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", index); // File of interest81 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest 82 82 psAssert (file, "missing file?"); 83 83 … … 130 130 // load data from input TXT file: 131 131 { 132 pmChip *chipTXT = pmFPAfileThisChip (config->files, view, "PSPHOT.INPUT");132 pmChip *chipTXT = pmFPAfileThisChip (config->files, view, filerule); 133 133 if (!chipTXT) goto finish; 134 134 … … 167 167 168 168 // extract the input sources corresponding to this readout 169 // XXX this function needs to be updated to work with the new context of ps hot inputs169 // XXX this function needs to be updated to work with the new context of psphot inputs 170 170 psArray *psphotLoadPSFSources (pmConfig *config, const pmFPAview *view) { 171 171 … … 197 197 // psphotDetectionsFromSources to psphotSourceStats and are now stored on 198 198 // detections->newSources. 199 bool psphotRepairLoadedSources (pmConfig *config, const pmFPAview *view ) {200 201 // find the currently selected readout 202 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // File of interest199 bool psphotRepairLoadedSources (pmConfig *config, const pmFPAview *view, const char *filerule) { 200 201 // find the currently selected readout 202 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest 203 203 psAssert (file, "missing file?"); 204 204 … … 227 227 // generate the detection structure for the supplied array of sources 228 228 // XXX this currently assumes there is a single input file 229 bool psphotDetectionsFromSources (pmConfig *config, const pmFPAview *view, psArray *sources) {230 231 // find the currently selected readout 232 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // File of interest229 bool psphotDetectionsFromSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *sources) { 230 231 // find the currently selected readout 232 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest 233 233 psAssert (file, "missing file?"); 234 234 … … 335 335 } 336 336 337 bool psphotCheckExtSources (pmConfig *config, const pmFPAview *view ) {337 bool psphotCheckExtSources (pmConfig *config, const pmFPAview *view, const char *filerule) { 338 338 339 339 bool status; … … 343 343 344 344 // find the currently selected readout 345 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // File of interest345 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest 346 346 psAssert (file, "missing file?"); 347 347 … … 373 373 374 374 // find the detections (by peak and/or footprint) in the image. 375 if (!psphotFindDetections (config, view, true)) {375 if (!psphotFindDetections (config, view, filerule, true)) { 376 376 psError(PSPHOT_ERR_CONFIG, false, "unable to find detections in this image"); 377 return psphotReadoutCleanup (config, view );377 return psphotReadoutCleanup (config, view, filerule); 378 378 } 379 379 380 380 // construct sources and measure basic stats 381 psphotSourceStats (config, view, true);381 psphotSourceStats (config, view, filerule, true); 382 382 383 383 // find blended neighbors of very saturated stars 384 psphotDeblendSatstars (config, view );384 psphotDeblendSatstars (config, view, filerule); 385 385 386 386 // mark blended peaks PS_SOURCE_BLEND 387 if (!psphotBasicDeblend (config, view )) {387 if (!psphotBasicDeblend (config, view, filerule)) { 388 388 psLogMsg ("psphot", 3, "failed on deblend analysis"); 389 return psphotReadoutCleanup (config, view );389 return psphotReadoutCleanup (config, view, filerule); 390 390 } 391 391 392 392 // classify sources based on moments, brightness 393 if (!psphotRoughClass (config, view )) {393 if (!psphotRoughClass (config, view, filerule)) { 394 394 psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image"); 395 return psphotReadoutCleanup (config, view );396 } 397 } 398 399 return true; 400 } 395 return psphotReadoutCleanup (config, view, filerule); 396 } 397 } 398 399 return true; 400 }
Note:
See TracChangeset
for help on using the changeset viewer.
