IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11762


Ignore:
Timestamp:
Feb 12, 2007, 5:14:42 PM (19 years ago)
Author:
Paul Price
Message:

Propagating API change in psImageStats.

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryObjects.c

    r11676 r11762  
    88*  @author EAM, IfA
    99*
    10 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2007-02-07 01:31:40 $
     10*  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2007-02-13 03:14:42 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3636/******************************************************************************
    3737pmAstromObjSortByMag(**a, **b): sort by mag (descending)
    38  
     38
    3939Is this a private routine?
    4040Should we do the early asserts?
     
    454454AstromGridBin(*dx, *dy, dX, dY): local function to convert x,y coords to grid
    455455bins it requires the globals defined above.
    456  
     456
    457457 ******************************************************************************/
    458458static bool AstromGridBin(
     
    567567        // find the max pixel
    568568        psStats *imStats = psStatsAlloc (PS_STAT_MAX | PS_STAT_MAX | PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    569         imStats = psImageStats (imStats, gridNP, NULL, 0);
     569        if (!psImageStats(imStats, gridNP, NULL, 0)) {
     570            psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
     571            psFree(imStats);
     572            psFree(gridNP);
     573            psFree(gridDX);
     574            psFree(gridDY);
     575            psFree(gridD2);
     576            psFree(stats);
     577            return NULL;
     578        }
    570579
    571580        # if 0
     
    860869   +15:+25 -> 5
    861870   +25:+35 -> 6
    862  
     871
    863872   maxOffsetRequest = 30
    864873   nPix = (int) (maxOffset / dPix + 0.5);
  • trunk/psModules/src/objects/pmSource.c

    r11261 r11762  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-01-24 21:32:19 $
     8 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-02-13 03:14:42 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    292292        // find the peak in this image
    293293        stats = psStatsAlloc (PS_STAT_MAX);
    294         stats = psImageStats (stats, splane, NULL, 0);
     294        if (!psImageStats (stats, splane, NULL, 0)) {
     295            psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
     296            psFree(stats);
     297            psFree(splane);
     298            return emptyClump;
     299        }
    295300        peaks = pmFindImagePeaks (splane, stats[0].max / 2);
    296301        psTrace ("psModules.objects", 2, "clump threshold is %f\n", stats[0].max/2);
     
    544549pmSource data structure, along with the peak location, and determines the
    545550various moments associated with that peak.
    546  
     551
    547552Requires the following to have been created:
    548553    pmSource
     
    551556    pmSource->weight
    552557    pmSource->mask
    553  
     558
    554559XXX: The peak calculations are done in image coords, not subImage coords.
    555  
     560
    556561XXX EAM : this version clips input pixels on S/N
    557562XXX EAM : this version returns false for several reasons
  • trunk/psModules/src/objects/pmSourceSky.c

    r9594 r11762  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-10-17 02:21:03 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-02-13 03:14:42 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333pmSource *pmSourceLocalSky(source, statsOptions, Radius): this
    3434routine creates a new pmSource.moments element if needed and sets pmSource.pmMoments.sky
    35  
     35
    3636The sky value is set from the pixels in the square annulus surrounding the
    3737peak pixel.
    38  
     38
    3939The source.pixels and source.mask must already exist
    4040*****************************************************************************/
     
    6969    psImageMaskRegion(mask, srcRegion, "OR", PM_MASK_MARK);
    7070    psStats *myStats = psStatsAlloc(statsOptions);
    71     myStats = psImageStats(myStats, image, mask, 0xff);
     71    if (!psImageStats(myStats, image, mask, 0xff)) {
     72        psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
     73        psFree(myStats);
     74        return false;
     75    }
    7276    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK));
    7377    double value = psStatsGetValue(myStats, statistic);
     
    116120    psImageMaskRegion(mask, srcRegion, "OR", PM_MASK_MARK);
    117121    psStats *myStats = psStatsAlloc(statsOptions);
    118     myStats = psImageStats(myStats, image, mask, 0xff);
     122    if (!psImageStats(myStats, image, mask, 0xff)) {
     123        psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
     124        psFree(myStats);
     125        return false;
     126    }
    119127    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK));
    120128    double value = psStatsGetValue(myStats, statistic);
Note: See TracChangeset for help on using the changeset viewer.