IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2006, 2:55:23 PM (20 years ago)
Author:
Paul Price
Message:

Addition of a vast quantity of assertions in public functions. Adopted a policy of using assert() within file-static functions (since they are only called internally, any errors there are problems with the program) and using the PS_ASSERT_WHATEVER() macros within public functions. Cleaned a few things up in the process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmFringeStats.c

    r7126 r7278  
    33 *  @author Eugene Magnier, IfA
    44 *
    5  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-05-17 00:55:35 $
     5 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-06-02 00:55:23 $
    77 *
    88 *  Copyright 2004 IfA
     
    6161bool pmFringeRegionsCreatePoints(pmFringeRegions *fringe, const psImage *image)
    6262{
     63    PS_ASSERT_PTR_NON_NULL(fringe, false);
     64    PS_ASSERT_PTR_NON_NULL(image, false);
     65    PS_ASSERT_IMAGE_NON_EMPTY(image, false);
    6366
    6467    double frnd;
     
    106109pmFringeStats *pmFringeStatsAlloc(pmFringeRegions *regions)
    107110{
     111    PS_ASSERT_PTR_NON_NULL(regions, false);
     112
    108113    pmFringeStats *stats = psAlloc(sizeof(pmFringeStats));
    109114    (void)psMemSetDeallocator(stats, (psFreeFunc)fringeStatsFree);
     
    120125pmFringeStats *pmFringeStatsMeasure(pmFringeRegions *fringe, pmReadout *readout, psMaskType maskVal)
    121126{
     127    PS_ASSERT_PTR_NON_NULL(fringe, NULL);
     128    PS_ASSERT_PTR_NON_NULL(readout, NULL);
     129    PS_ASSERT_PTR_NON_NULL(readout->image, NULL);
     130    PS_ASSERT_IMAGE_NON_EMPTY(readout->image, NULL);
     131
    122132    if (!fringe->x || !fringe->y) {
    123133        // create the fringe vectors for this image
     
    364374                                    unsigned int nIter, float keepFrac)
    365375{
     376    PS_ASSERT_PTR_NON_NULL(science, NULL);
     377    PS_ASSERT_PTR_NON_NULL(fringes, NULL);
     378    PS_ASSERT_INT_POSITIVE(fringes->n, NULL);
     379    PS_ASSERT_INT_POSITIVE(nIter, NULL);
     380
    366381    pmFringeRegions *regions = science->regions; // The fringe regions
    367382    int numRegions = regions->nRequested; // Number of regions
     
    439454                         unsigned int nIter, float keepFrac)
    440455{
     456    PS_ASSERT_PTR_NON_NULL(readout, NULL);
     457    PS_ASSERT_PTR_NON_NULL(readout->image, NULL);
     458    PS_ASSERT_IMAGE_NON_EMPTY(readout->image, NULL);
     459    PS_ASSERT_PTR_NON_NULL(fringes, NULL);
     460    PS_ASSERT_PTR_NON_NULL(fringeImages, NULL);
     461    PS_ASSERT_PTR_NON_NULL(fringeStats, NULL);
     462    PS_ASSERT_INT_EQUAL(fringeImages->n, fringeStats->n, NULL);
     463    PS_ASSERT_INT_POSITIVE(nIter, NULL);
     464
    441465    // measure the fringe stats for the science frame and solve for the scales
    442466    pmFringeStats *scienceStats = pmFringeStatsMeasure(fringes, readout, maskVal);
Note: See TracChangeset for help on using the changeset viewer.