Changeset 23580 for branches/pap/ppImage
- Timestamp:
- Mar 27, 2009, 4:46:10 PM (17 years ago)
- Location:
- branches/pap/ppImage/src
- Files:
-
- 3 edited
-
ppImage.h (modified) (3 diffs)
-
ppImageLoop.c (modified) (2 diffs)
-
ppImagePhotom.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppImage/src/ppImage.h
r23411 r23580 40 40 bool doAstromMosaic; // full-mosaic Astrometry 41 41 bool doStats; // call ppStats on the image 42 bool checkCTE; // measure pixel-based variance42 bool checkCTE; // measure pixel-based variance 43 43 44 44 // output files requested … … 88 88 float remnanceThresh; // Threshold for remnance detection 89 89 90 char *normClass; // class to use for per-class normalization90 char *normClass; // class to use for per-class normalization 91 91 } ppImageOptions; 92 92 … … 146 146 bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName); 147 147 148 bool ppImagePhotom (pmConfig *config, pmFPAview *view);149 bool ppImageAstrom (pmConfig *config);150 bool ppImageAddstar (pmConfig *config);148 bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view); 149 bool ppImageAstrom(pmConfig *config); 150 bool ppImageAddstar(pmConfig *config); 151 151 152 152 // Subtract background from the chip-mosaicked image -
branches/pap/ppImage/src/ppImageLoop.c
r23411 r23580 13 13 bool ppImageLoop(pmConfig *config, ppImageOptions *options) 14 14 { 15 psMetadata *stats = options->doStats ? psMetadataAlloc() : NULL;// Statistics to output15 psMetadata *stats = NULL; // Statistics to output 16 16 float timeDetrend = 0; // Amount of time spent in detrend 17 17 float timePhot = 0; // Amount of time spent in photometry 18 19 if (options->doStats) { 20 stats = psMetadataAlloc(); 21 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 22 } 18 23 19 24 bool status; // Status of MD lookup … … 139 144 psTimerStart(TIMER_PHOT); 140 145 if (options->doPhotom) { 141 if (!ppImagePhotom( config, view)) {146 if (!ppImagePhotom(stats, config, view)) { 142 147 ESCAPE("error running photometry."); 143 148 } -
branches/pap/ppImage/src/ppImagePhotom.c
r20410 r23580 6 6 7 7 // In this function, we perform the psphot analysis routine for the chip-mosaicked images 8 bool ppImagePhotom (pmConfig *config, pmFPAview *view) {8 bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view) { 9 9 10 10 bool status; … … 12 12 pmReadout *readout; 13 13 14 psphotInit ();14 psphotInit(); 15 15 16 16 // find or define a pmFPAfile PSPHOT.INPUT … … 37 37 // run the actual photometry analysis 38 38 if (!psphotReadout (config, view)) { 39 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 40 return false; 39 // This is likely a data quality issue 40 // XXX Split into multiple cases using error codes? 41 psErrorStackPrint("Unable to perform photometry on image"); 42 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 43 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 44 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 45 "Unable to perform photometry on image", psErrorCodeLast()); 46 } 47 psErrorClear(); 48 psphotFilesActivate(config, false); 41 49 } 42 50 43 // we want to save the MASK as modified by psphot, but not the data or weight44 // free the old mask and replace with a memory copy of the new mask45 pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src);46 pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa);47 psFree (oldReadout->mask);48 oldReadout->mask = psMemIncrRefCounter(newReadout->mask);51 // we want to save the MASK as modified by psphot, but not the data or weight 52 // free the old mask and replace with a memory copy of the new mask 53 pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src); 54 pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa); 55 psFree (oldReadout->mask); 56 oldReadout->mask = psMemIncrRefCounter(newReadout->mask); 49 57 } 50 58 }
Note:
See TracChangeset
for help on using the changeset viewer.
