IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15980


Ignore:
Timestamp:
Jan 2, 2008, 10:39:04 AM (18 years ago)
Author:
gusciora
Message:

Removed pmSourceTest() and added some PS_ASSERTS.

Location:
trunk/psModules/src/objects
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSource.c

    r15814 r15980  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-12-13 22:09:35 $
     8 *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-01-02 20:39:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    130130}
    131131
    132 bool pmSourceTest(const psPtr ptr)
    133 {
    134     return (psMemGetDeallocator(ptr) == (psFreeFunc)sourceFree);
    135 }
    136 
    137132/******************************************************************************
    138133pmSourceCopy(): copy the pmSource structure and contents
     
    807802// construct a realization of the source model
    808803bool pmSourceCacheModel (pmSource *source, psMaskType maskVal) {
    809 
     804    PS_ASSERT_PTR_NON_NULL(source, false);
    810805    // select appropriate model
    811806    pmModel *model = pmSourceGetModel (NULL, source);
     
    826821// XXX this function should optionally save an existing psf image from modelFlux
    827822bool pmSourceCachePSF (pmSource *source, psMaskType maskVal) {
     823    PS_ASSERT_PTR_NON_NULL(source, false);
    828824
    829825    // select appropriate model
     
    846842{
    847843    PS_ASSERT_PTR_NON_NULL(source, false);
     844    PS_ASSERT_PTR_NON_NULL(source->peak, false);
    848845    bool status;
    849846
  • trunk/psModules/src/objects/pmSource.h

    r15799 r15980  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2007-12-13 04:05:58 $
     5 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2008-01-02 20:39:04 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    122122void pmSourceFreePixels(pmSource *source);
    123123
    124 bool pmSourceTest(const psPtr ptr);
    125 
    126124/** pmSourceDefinePixels()
    127125 *
  • trunk/psModules/src/objects/pmSourceContour.c

    r15619 r15980  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-11-14 22:15:42 $
     8 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-01-02 20:39:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    227227    int y = yc - image->row0;
    228228
    229     // the requested point must be within the contour
    230     if (image->data.F32[y][x] < threshold) {
    231         return NULL;
    232     }
    233 
    234229    // Ensure that the starting column is allowable.
    235230    if (x < 0) {
     
    243238    }
    244239    if (y >= image->numRows) {
     240        return NULL;
     241    }
     242
     243    // the requested point must be within the contour
     244    if (image->data.F32[y][x] < threshold) {
    245245        return NULL;
    246246    }
  • trunk/psModules/src/objects/pmSourceExtendedPars.h

    r15562 r15980  
    33 * @author EAM, IfA
    44 *
    5  * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2007-11-10 01:09:20 $
     5 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2008-01-02 20:39:04 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    5656
    5757pmSourceExtendedPars *pmSourceExtendedParsAlloc ();
     58bool psMemCheckSourceExtendedPars(psPtr ptr);
    5859pmSourceRadialProfile *pmSourceRadialProfileAlloc ();
     60bool psMemCheckSourceRadialProfile(psPtr ptr);
    5961pmSourceIsophotalValues *pmSourceIsophotalValuesAlloc ();
     62bool psMemCheckSourceIsophotalValues(psPtr ptr);
    6063pmSourcePetrosianValues *pmSourcePetrosianValuesAlloc ();
     64bool psMemCheckSourcePetrosianValues(psPtr ptr);
    6165pmSourceKronValues *pmSourceKronValuesAlloc ();
     66bool psMemCheckSourceKronValues(psPtr ptr);
    6267pmSourceAnnuli *pmSourceAnnuliAlloc ();
     68bool psMemCheckSourceAnnuli(psPtr ptr);
    6369
    6470/// @}
  • trunk/psModules/src/objects/pmSourceFitSet.c

    r15622 r15980  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-11-15 23:18:20 $
     8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-01-02 20:39:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    120120bool pmSourceFitSetJoin (psVector *deriv, psVector *param, pmSourceFitSetData *set)
    121121{
    122     assert (set);
    123     assert (set->paramSet->n == set->derivSet->n);
    124 
     122    PS_ASSERT_PTR_NON_NULL(set, false);
     123    PS_ASSERT_PTR_NON_NULL(set->paramSet, false);
     124    PS_ASSERT_PTR_NON_NULL(set->derivSet, false);
     125    PS_ASSERT_VECTORS_SIZE_EQUAL(set->paramSet, set->derivSet, false);
    125126    int n = 0;
     127    int sum = 0;
     128    for (int i = 0; i < set->paramSet->n; i++) {
     129        sum+= set->paramSet->n;
     130    }
     131
     132    // Must assert that the deriv and param psVectors are large enough, or else
     133    // a seg fault occurs.
     134    // XXX: Put the correct error call in here:
     135    if (0) {
     136        if (deriv->n < sum || param->n < sum) {
     137            PS_ASSERT_PTR_NON_NULL(0, false);
     138        }
     139    }
     140
    126141    for (int i = 0; i < set->paramSet->n; i++) {
    127142
     
    150165bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param)
    151166{
    152     assert (param);
    153     assert (set);
    154     assert (set->paramSet->n == set->derivSet->n);
     167    PS_ASSERT_VECTOR_NON_NULL(param, false);
     168    PS_ASSERT_PTR_NON_NULL(set, false);
     169    PS_ASSERT_PTR_NON_NULL(set->paramSet, false);
     170    PS_ASSERT_PTR_NON_NULL(set->derivSet, false);
     171    PS_ASSERT_VECTORS_SIZE_EQUAL(set->paramSet, set->derivSet, false);
    155172
    156173    int n = 0;
     
    175192                           psMinimization *myMin, int nPix, bool fitStatus)
    176193{
    177     assert (set);
     194    PS_ASSERT_PTR_NON_NULL(set, false);
     195    PS_ASSERT_PTR_NON_NULL(set->paramSet, false);
     196    PS_ASSERT_VECTOR_NON_NULL(dparam, false);
     197    PS_ASSERT_VECTOR_NON_NULL(param, false);
     198    PS_ASSERT_PTR_NON_NULL(source, false);
     199    PS_ASSERT_PTR_NON_NULL(source->pixels, false);
     200    PS_ASSERT_PTR_NON_NULL(myMin, false);
     201
    178202    bool onPic = true;
    179203
     
    216240psF32 pmSourceFitSetFunction(psVector *deriv, const psVector *param, const psVector *x)
    217241{
    218     assert (thisSet);
     242    PS_ASSERT_PTR_NON_NULL(thisSet, NAN);
    219243    float chisqSum = 0.0;
    220244    float chisqOne = 0.0;
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c

    r15562 r15980  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-11-10 01:09:20 $
     5 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-01-02 20:39:04 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6969
    7070        // no difference between PSF and non-PSF model
    71         pmModel *model = pmSourceGetModel (NULL, source);
     71        pmModel *model = pmSourceGetModel(NULL, source);
    7272
    7373        if (model != NULL) {
     
    8181            axes = pmPSF_ModelToAxes (PAR, 20.0);
    8282        } else {
     83            // XXX: This code seg faults if source->peak is NULL.
    8384            xPos = source->peak->xf;
    8485            yPos = source->peak->yf;
     
    168169    psArray *table = psFitsReadTable (fits);
    169170    // validate a single row of the table (must match SMP)
    170 
     171    // XXX: The following seg-faults if table returns NULL, so I added the ASSERT
     172    PS_ASSERT_PTR_NON_NULL(table, NULL);
    171173    psArray *sources = psArrayAlloc (table->n);
    172174
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c

    r15799 r15980  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-12-13 04:05:58 $
     5 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-01-02 20:39:04 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4747// XXX how do I generate the source tables which I need to send to PSPS?
    4848
    49 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, char *xsrcname)
     49bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader,
     50                               psMetadata *tableHeader, char *extname, char *xsrcname)
    5051{
     52    PS_ASSERT_PTR_NON_NULL(fits, false);
     53    PS_ASSERT_PTR_NON_NULL(sources, false);
     54    PS_ASSERT_PTR_NON_NULL(extname, false);
    5155
    5256    psArray *table;
     
    161165psArray *pmSourcesRead_PS1_DEV_1 (psFits *fits, psMetadata *header)
    162166{
     167    PS_ASSERT_PTR_NON_NULL(fits, false);
     168    PS_ASSERT_PTR_NON_NULL(header, false);
    163169
    164170    bool status;
  • trunk/psModules/src/objects/pmSourceSky.c

    r14938 r15980  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-21 00:09:05 $
     8 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-01-02 20:39:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5757    PS_ASSERT_PTR_NON_NULL(source->peak, false);
    5858    PS_ASSERT_INT_POSITIVE(Radius, false);
    59     PS_ASSERT_INT_NONNEGATIVE(Radius, false);
    6059
    6160    psStatsOptions statistic = psStatsSingleOption(statsOptions);
     
    111110    PS_ASSERT_PTR_NON_NULL(source->peak, false);
    112111    PS_ASSERT_INT_POSITIVE(Radius, false);
    113     PS_ASSERT_INT_NONNEGATIVE(Radius, false);
    114112
    115113    psStatsOptions statistic = psStatsSingleOption(statsOptions);
Note: See TracChangeset for help on using the changeset viewer.