- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ppStack/src (modified) (1 prop)
-
ppStack/src/ppStackPhotometry.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ppStack/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppStackVersionDefinitions.h 12 ppStackErrorCodes.c 13 ppStackErrorCodes.h
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/ppStack/src/ppStackPhotometry.c
r24216 r27840 19 19 psAssert(recipe, "We've thrown an error on this before."); 20 20 21 bool mdok; // Status of MD lookup 22 if (!psMetadataLookupBool(&mdok, recipe, "PHOTOMETRY")) { 21 if (!options->photometry) { 23 22 // Nothing to do 24 23 return true; … … 27 26 psTimerStart("PPSTACK_PHOT"); 28 27 29 p pStackFileActivation(config, PPSTACK_FILES_COMBINE, false);28 pmFPAfileActivate(config->files, false, NULL); 30 29 ppStackFileActivation(config, PPSTACK_FILES_PHOT, true); 31 30 pmFPAview *photView = ppStackFilesIterateDown(config); // View to readout 32 ppStackFileActivation(config, PPSTACK_FILES_ COMBINE, true);31 ppStackFileActivation(config, PPSTACK_FILES_STACK, true); 33 32 34 33 pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT"); // File for photometry … … 60 59 "Bits to use for mark", markValue); 61 60 62 pmCell *sourcesCell = pmFPAfileThisCell(config->files, photView, "PPSTACK.OUTPUT"); 63 psArray *inSources = psMetadataLookupPtr(NULL, sourcesCell->analysis, "PSPHOT.SOURCES"); 61 psArray *inSources = options->sources; 64 62 if (!inSources) { 65 psError(P S_ERR_UNKNOWN, false, "Unable to find input sources");63 psError(PPSTACK_ERR_PROG, false, "Unable to find input sources"); 66 64 psFree(photView); 67 65 return false; 68 66 } 69 67 68 pmModelClassSetLimits(PM_MODEL_LIMITS_LAX); 70 69 if (!psphotReadoutKnownSources(config, photView, inSources)) { 71 70 // This is likely a data quality issue … … 73 72 psErrorStackPrint(stderr, "Unable to perform photometry on image"); 74 73 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 75 if (options->stats && psMetadataLookupS32(NULL, options->stats, "QUALITY") == 0) { 76 psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 77 "Unable to perform photometry on image", psErrorCodeLast()); 74 if (options->quality == 0) { 75 options->quality = psErrorCodeLast(); 78 76 } 79 77 psErrorClear(); … … 84 82 !pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV") || 85 83 !pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND")) { 86 psError(P S_ERR_UNKNOWN, false, "Unable to drop PSPHOT internal files.");84 psError(PPSTACK_ERR_PROG, false, "Unable to drop PSPHOT internal files."); 87 85 return false; 88 86 } … … 92 90 if (options->stats) { 93 91 pmReadout *photRO = pmFPAviewThisReadout(photView, photFile->fpa); // Readout with the sources 94 psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources 95 psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, 96 "Number of sources detected", sources ? sources->n : 0); 97 psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0, 98 "Time to do photometry", psTimerMark("PPSTACK_PHOT")); 92 pmDetections *detections = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.DETECTIONS"); // detections 93 if (detections && detections->allSources) { 94 psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", detections->allSources->n); 95 } else { 96 psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", 0); 97 } 98 psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0, "Time to do photometry", psTimerMark("PPSTACK_PHOT")); 99 99 } 100 100 101 psFree(photView); 101 102
Note:
See TracChangeset
for help on using the changeset viewer.
