Changeset 19928 for trunk/ppImage/src/ppImageMetadataStats.c
- Timestamp:
- Oct 6, 2008, 12:24:10 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageMetadataStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageMetadataStats.c
r18556 r19928 6 6 7 7 // calculate stats from headers and concepts 8 bool ppImageMetadataStats (pmConfig *config, const ppImageOptions *options) { 8 bool ppImageMetadataStats(pmConfig *config, psMetadata *stats, const ppImageOptions *options) 9 { 10 bool mdok; // Status of MD lookup 9 11 10 bool mdok; // Status of MD lookup11 12 12 if (!options->doStats) { 13 return true;13 return true; 14 14 } 15 15 … … 20 20 21 21 if (!outImage && !outPhotom && !outAstrom) { 22 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find any output file (PPIMAGE.OUTPUT, PSPHOT.OUTPUT, PSASTRO.OUTPUT)."); 23 return false; 22 psError(PS_ERR_UNEXPECTED_NULL, true, 23 "Unable to find any output file (PPIMAGE.OUTPUT, PSPHOT.OUTPUT, PSASTRO.OUTPUT)."); 24 return false; 24 25 } 25 26 … … 27 28 pmFPAfile *output = outAstrom; 28 29 if (!output) { 29 output = outPhotom;30 output = outPhotom; 30 31 } 31 32 if (!output) { 32 output = outImage;33 output = outImage; 33 34 } 34 35 35 // select or create the fpa-level analysis stats metadata for PPIMAGE.OUTPUT: 36 psMetadata *stats = psMetadataLookupPtr (&mdok, outImage->fpa->analysis, "PPIMAGE.STATS"); 37 psMemIncrRefCounter (stats); 38 if (!stats) { 39 stats = psMetadataAlloc (); 40 if (!psMetadataAdd (outImage->fpa->analysis, PS_LIST_TAIL, "PPIMAGE.STATS", PS_DATA_METADATA, "stats container", stats)) { 41 psError(PS_ERR_UNKNOWN, false, "Unable to push stats on fpa.analysis."); 42 psFree (stats); 43 return false; 44 } 45 } 46 47 // extract stats for the complete fpa 36 // extract stats for the complete fpa 48 37 pmFPAview *view = pmFPAviewAlloc(0); 49 50 38 if (!ppStatsMetadata(stats, output->fpa, view, options->maskValue, config)) { 51 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to generate stats for image."); 52 psFree(view); 53 psFree(stats); 54 return false; 39 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to generate stats for image."); 40 psFree(view); 41 return false; 55 42 } 56 43 57 44 psFree(view); 58 psFree(stats);59 45 return true; 60 46 }
Note:
See TracChangeset
for help on using the changeset viewer.
