Changeset 24203
- Timestamp:
- May 15, 2009, 1:54:47 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotReadoutCleanup.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotReadoutCleanup.c
r20769 r24203 9 9 if (psErrorCodeLast() == PSPHOT_ERR_DATA) { 10 10 psErrorStackPrint(stderr, "Error in the psphot readout analysis"); 11 psErrorClear();12 } 13 if (psErrorCodeLast() != PS_ERR_NONE) { 14 psFree (psf);15 psFree (sources);16 psFree (detections);17 return false;11 psErrorClear(); 12 } 13 if (psErrorCodeLast() != PS_ERR_NONE) { 14 psFree (psf); 15 psFree (sources); 16 psFree (detections); 17 return false; 18 18 } 19 19 … … 22 22 if (!psphotPSFstats (readout, recipe, psf)) { 23 23 psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters"); 24 psFree (psf);25 psFree (sources);26 psFree (detections);24 psFree (psf); 25 psFree (sources); 26 psFree (detections); 27 27 return false; 28 28 } … … 32 32 if (!psphotMomentsStats (readout, recipe, sources)) { 33 33 psError(PSPHOT_ERR_PROG, false, "Failed to measure Moment shape parameters"); 34 psFree (psf);35 psFree (sources);36 psFree (detections);34 psFree (psf); 35 psFree (sources); 36 psFree (detections); 37 37 return false; 38 38 } 39 39 } 40 41 // Check to see if the image quality was measured 42 if (!psf) { 43 bool mdok; // Status of MD lookup 44 int nIQ = psMetadataLookupS32(&mdok, recipe, "IQ_NSTAR"); // Number of stars for IQ measurement 45 if (!mdok || nIQ <= 0) { 46 psError(PSPHOT_ERR_DATA, false, "Unable to measure image quality"); 47 psFree (psf); 48 psFree (sources); 49 psFree (detections); 50 return false; 51 } 52 } 53 40 54 41 55 // write NSTARS to the image header … … 48 62 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER", PS_DATA_METADATA, "header stats", header); 49 63 if (sources) { 50 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources);64 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources); 51 65 } 52 66 if (psf) { 53 // save the psf for possible output. if there was already an entry, it was loaded from external sources54 // the new one may have been updated or modified, so replace the existing entry. We55 // are required to save it on the chip, but this will cause problems if we ever want to56 // run psphot on an unmosaiced image57 pmCell *cell = readout->parent;58 pmChip *chip = cell->parent;59 psMetadataAdd (chip->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN | PS_META_REPLACE, "psphot psf", psf);67 // save the psf for possible output. if there was already an entry, it was loaded from external sources 68 // the new one may have been updated or modified, so replace the existing entry. We 69 // are required to save it on the chip, but this will cause problems if we ever want to 70 // run psphot on an unmosaiced image 71 pmCell *cell = readout->parent; 72 pmChip *chip = cell->parent; 73 psMetadataAdd (chip->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN | PS_META_REPLACE, "psphot psf", psf); 60 74 } 61 75 62 76 if (psErrorCodeLast() != PS_ERR_NONE) { 63 77 psErrorStackPrint(stderr, "unexpected remaining errors"); 64 abort();78 abort(); 65 79 } 66 80
Note:
See TracChangeset
for help on using the changeset viewer.
