Changeset 23580
- Timestamp:
- Mar 27, 2009, 4:46:10 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 11 edited
-
ippconfig/recipes/ppStatsFromMetadata.config (modified) (5 diffs)
-
ppImage/src/ppImage.h (modified) (3 diffs)
-
ppImage/src/ppImageLoop.c (modified) (2 diffs)
-
ppImage/src/ppImagePhotom.c (modified) (3 diffs)
-
ppStack/src/ppStackPhotometry.c (modified) (1 diff)
-
ppStack/src/ppStackSetup.c (modified) (1 diff)
-
ppSub/src/ppSubMakePSF.c (modified) (2 diffs)
-
ppSub/src/ppSubReadoutPhotometry.c (modified) (2 diffs)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotDefineFiles.c (modified) (2 diffs)
-
pswarp/src/pswarpLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ippconfig/recipes/ppStatsFromMetadata.config
r20302 r23580 50 50 ENTRY VAL ROBUST_MEDIAN F32 ROBUST_STDEV -bg_mean_stdev 51 51 ENTRY VAL ROBUST_STDEV F32 RMS -bg_stdev 52 ENTRY VAL QUALITY BOOL CONSTANT -quality 52 53 END 53 54 … … 168 169 ENTRY VAL IQ_M2S_L F32 SAMPLE_MEAN -iq_m2s_lq 169 170 ENTRY VAL IQ_M2S_U F32 SAMPLE_MEAN -iq_m2s_uq 171 ENTRY VAL QUALITY BOOL CONSTANT -quality 170 172 END 171 173 … … 253 255 ENTRY VAL RANGE.YMAX S32 CONSTANT -ymax 254 256 ENTRY VAL ACCEPT BOOL CONSTANT -accept 257 ENTRY VAL QUALITY BOOL CONSTANT -quality 255 258 END 256 259 … … 279 282 ENTRY VAL NUM_SOURCES S32 SUM -sources 280 283 ENTRY VAL GOOD_PIXEL_FRAC F32 MEAN -good_frac 284 ENTRY VAL QUALITY BOOL CONSTANT -quality 281 285 END 282 286 … … 301 305 ENTRY VAL NUM_SOURCES S32 SUM -sources 302 306 ENTRY VAL GOOD_PIXEL_FRAC F32 MEAN -good_frac 307 ENTRY VAL QUALITY BOOL CONSTANT -quality 303 308 END 304 309 -
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 } -
branches/pap/ppStack/src/ppStackPhotometry.c
r23462 r23580 69 69 70 70 if (!psphotReadoutKnownSources(config, photView, inSources)) { 71 // Clear the error, so that the output files are written. 72 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on stacked image."); 73 psFree(photView); 74 return false; 71 // This is likely a data quality issue 72 // XXX Split into multiple cases using error codes? 73 psErrorStackPrint("Unable to perform photometry on image"); 74 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 75 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 76 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 77 "Unable to perform photometry on image", psErrorCodeLast()); 78 } 79 psErrorClear(); 80 psphotFilesActivate(config, false); 75 81 } 76 82 -
branches/pap/ppStack/src/ppStackSetup.c
r23341 r23580 34 34 psFree(resolved); 35 35 options->stats = psMetadataAlloc(); 36 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 36 37 } 37 38 -
branches/pap/ppSub/src/ppSubMakePSF.c
r23235 r23580 83 83 psArray *sources = psMetadataLookupPtr(&mdok, minuend->analysis, "PSPHOT.SOURCES"); 84 84 if (!psphotReadoutFindPSF(config, view, sources)) { 85 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on subtracted image."); 86 return false; 85 // This is likely a data quality issue 86 // XXX Split into multiple cases using error codes? 87 psErrorStackPrint("Unable to determine PSF"); 88 psWarning("Unable to determine PSF --- suspect bad data quality."); 89 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 90 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 91 "Unable to determine PSF", psErrorCodeLast()); 92 } 93 psErrorClear(); 94 psphotFilesActivate(config, false); 87 95 } 88 96 … … 98 106 return true; 99 107 } 100 101 // XXX we used to need this, is it still needed?102 103 // pmCell *photCell = pmFPAfileThisCell(config->files, view, "PSPHOT.INPUT");104 // pmCellFreeReadouts(photCell);105 106 // if (!pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL") ||107 // !pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV") ||108 // !pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND")) {109 // psError(PS_ERR_UNKNOWN, false, "Unable to drop PSPHOT internal files.");110 // return false;111 // }112 113 // Blow away the sources psphot found --- they're irrelevant for the subtraction114 // XXX is this still needed? These are now probably not being set115 // pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); // Readout with sources116 // psMetadataRemoveKey(photRO->analysis, "PSPHOT.SOURCES");117 // psMetadataRemoveKey(photRO->analysis, "PSPHOT.HEADER");118 -
branches/pap/ppSub/src/ppSubReadoutPhotometry.c
r21524 r23580 45 45 pmPSF *psf = psMetadataLookupPtr(NULL, psfInputChip->analysis, "PSPHOT.PSF"); // PSF for photometry 46 46 if (!psf) { 47 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSF from psphot"); 48 return false; 47 psWarning("No PSF available --- suspect bad data quality."); 48 if (stats && psMetadataLookupBool(NULL, stats, "QUALITY")) { 49 psError(PS_ERR_UNEXPECTED_NULL, false, "Bad or unset QUALITY flag"); 50 return false; 51 } 52 psErrorClear(); 53 psphotFilesActivate(config, false); 49 54 } 50 55 psMetadataAddPtr(psfLoadChip->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN | PS_META_REPLACE, … … 86 91 87 92 if (!psphotReadoutMinimal(config, view)) { 88 psWarning("Unable to perform photometry on subtracted image."); 89 psErrorStackPrint(stderr, "Error stack from photometry:"); 93 // This is likely a data quality issue 94 // XXX Split into multiple cases using error codes? 95 psErrorStackPrint("Unable to perform photometry on image"); 96 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 97 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 98 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 99 "Unable to perform photometry on image", psErrorCodeLast()); 100 } 90 101 psErrorClear(); 102 psphotFilesActivate(config, false); 91 103 } 92 104 #if 1 -
branches/pap/psphot/src/psphot.h
r23492 r23580 31 31 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources); 32 32 bool psphotDefineFiles (pmConfig *config, pmFPAfile *input); 33 void psphotFilesActivate(pmConfig *config, bool state); 34 33 35 bool psphotSetMaskBits (pmConfig *config); 34 36 bool psphotSetMaskRecipe (pmConfig *config, psImageMaskType maskValue, psImageMaskType markValue); -
branches/pap/psphot/src/psphotDefineFiles.c
r14892 r23580 1 1 # include "psphotInternal.h" 2 3 // List of output files 4 static const char *outputFiles = { "PSPHOT.OUTPUT", "PSPHOT.RESID", "PSPHOT.BACKMDL", "PSPHOT.BACKMDL.STDEV", 5 "PSPHOT.BACKGND", "PSPHOT.BACKSUB", "PSPHOT.PSF.SAVE", 6 "SOURCE.PLOT.MOMENTS", "SOURCE.PLOT.PSFMODEL", "SOURCE.PLOT.APRESID", 7 NULL }; 2 8 3 9 // XXX we need to be able to distinguish several cases: … … 133 139 return true; 134 140 } 141 142 void psphotFilesActivate(pmConfig *config, bool state) 143 { 144 for (int i = 0; outputFiles[i]; i++) { 145 if (!pmFPAfileActivate(config->files, state, outputFiles[i])) { 146 psErrorClear(); 147 } 148 } 149 150 return; 151 } -
branches/pap/pswarp/src/pswarpLoop.c
r23314 r23580 142 142 psFree(resolved); 143 143 stats = psMetadataAlloc(); 144 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 144 145 } 145 146 … … 364 365 fileActivation(config, independentFiles, false); 365 366 366 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but that's going to be tricky.367 // We have a list of sources, so we use those to redetermine the PSF model.367 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but 368 // that's going to be tricky. We have a list of sources, so we use those to redetermine the PSF model. 368 369 369 370 if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) { … … 394 395 // measure the PSF using these sources 395 396 if (!psphotReadoutFindPSF(config, view, sources)) { 396 psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image."); 397 return false; 397 // This is likely a data quality issue 398 // XXX Split into multiple cases using error codes? 399 psErrorStackPrint("Unable to determine PSF"); 400 psWarning("Unable to determine PSF --- suspect bad data quality."); 401 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 402 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 403 "Unable to determine PSF", psErrorCodeLast()); 404 } 405 psErrorClear(); 406 psphotFilesActivate(config, false); 398 407 } 399 408
Note:
See TracChangeset
for help on using the changeset viewer.
