IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2007, 3:08:13 PM (19 years ago)
Author:
Paul Price
Message:

Adding maskVal parameter to ppStats so that when it's called as a library function, it uses the nominated maskVal rather than it's own (which may be completely different from what the parent program may think it should mask).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStats/src/ppStats.c

    r13640 r13658  
    1212                    pmFPA *fpa,         // FPA for which to get statistics
    1313                    pmFPAview *view,    // View for analysis
     14                    psMaskType maskVal, // Value to mask
    1415                    pmConfig *config    // Configuration
    1516    )
    1617{
    17     psExit status;
     18    PS_ASSERT_PTR_NON_NULL(fpa, NULL)
     19    PS_ASSERT_PTR_NON_NULL(view, NULL);
     20    PS_ASSERT_PTR_NON_NULL(config, NULL);
     21
     22    ppStatsData *data = ppStatsDataAlloc(); // All the input data
    1823
    1924    // Get the options, open the files
    20     ppStatsData *data = ppStatsSetupFromRecipe(NULL, config);
     25    if (!ppStatsSetupFromRecipe(data, config)) {
     26        psError(PS_ERR_UNKNOWN, false, "Unable to get ppStats options from recipe.");
     27        psFree(data);
     28        return NULL;
     29    }
     30
     31    // Override recipe mask value if one is provided
     32    if (maskVal != 0) {
     33        data->maskVal = maskVal;
     34    }
    2135
    2236    if (data->fpa) {
     
    3145
    3246    // Go through the FPA and do the hard work
     47    psExit status;                      // Status of statistics loop
    3348    psMetadata *result = ppStatsLoop(&status, out, data, config);
    3449    if (status != PS_EXIT_SUCCESS) {
    35         psError (PS_ERR_UNKNOWN, false, "trouble getting stats\n");
     50        psError (PS_ERR_UNKNOWN, false, "Not able to measure FPA statistics.\n");
    3651        psFree(result);
    37         psFree(data);
    38         return (NULL);
     52        psFree(data);
     53        return (NULL);
    3954    }
    4055
Note: See TracChangeset for help on using the changeset viewer.