IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2008, 12:24:10 PM (18 years ago)
Author:
Paul Price
Message:

Don't put statistics on an FPA: too troublesome to get to, and it's ok to just carry around a psMetadata in ppImageLoop, passing it to functions that need it. Updated times for output statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageMetadataStats.c

    r18556 r19928  
    66
    77// calculate stats from headers and concepts
    8 bool ppImageMetadataStats (pmConfig *config, const ppImageOptions *options) {
     8bool ppImageMetadataStats(pmConfig *config, psMetadata *stats, const ppImageOptions *options)
     9{
     10    bool mdok;              // Status of MD lookup
    911
    10     bool mdok;              // Status of MD lookup
    11    
    1212    if (!options->doStats) {
    13         return true;
     13        return true;
    1414    }
    1515
     
    2020
    2121    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;
    2425    }
    2526
     
    2728    pmFPAfile *output = outAstrom;
    2829    if (!output) {
    29         output = outPhotom;
     30        output = outPhotom;
    3031    }
    3132    if (!output) {
    32         output = outImage;
     33        output = outImage;
    3334    }
    3435
    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
    4837    pmFPAview *view = pmFPAviewAlloc(0);
    49 
    5038    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;
    5542    }
    5643
    5744    psFree(view);
    58     psFree(stats);
    5945    return true;
    6046}
Note: See TracChangeset for help on using the changeset viewer.