IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2006, 5:14:23 PM (20 years ago)
Author:
magnier
Message:

major rework of objects code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/objects/pmSourceSky.c

    r6537 r6556  
     1/** @file  pmSourceSky.c
     2 *
     3 *  Functions to measure the local sky and sky variance for sources on images
     4 *
     5 *  @author GLG, MHPCC
     6 *  @author EAM, IfA: significant modifications.
     7 *
     8 *  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-03-09 03:14:23 $
     10 *
     11 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     12 *
     13 */
     14
     15#include <stdio.h>
     16#include <math.h>
     17#include <string.h>
     18#include "pslib.h"
     19#include "pmHDU.h"
     20#include "pmFPA.h"
     21#include "pmPeaks.h"
     22#include "pmMoments.h"
     23#include "pmModel.h"
     24#include "pmSource.h"
     25#include "pmSourceSky.h"
    126
    227/******************************************************************************
    3 pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this
    4 routine creates a new pmSource data structure and sets the following members:
    5     ->pmPeak
    6     ->pmMoments->sky
     28pmSource *pmSourceLocalSky(source, statsOptions, Radius): this
     29routine creates a new pmSource.moments element if needed and sets pmSource.pmMoments.sky
    730 
    831The sky value is set from the pixels in the square annulus surrounding the
    932peak pixel.
    1033 
    11 We simply create a subSet image and mask the inner pixels, then call
    12 psImageStats on that subImage+mask.
    13  
    14 XXX: The subImage has width of 1+2*outerRadius.  Verify with IfA.
    15  
    16 XXX: Use static data structures for:
    17      subImage
    18      subImageMask
    19      myStats
    20  
    21 XXX: ensure that the inner and out radius fit in the actual image.  Should
    22      we generate an error, or warning?  Currently an error.
    23  
    24 XXX: Sync with IfA on whether the peak x/y coords are data structure coords,
    25      or they use the image row/column offsets.
    26 XXX  EAM : peak->x,y uses parent coordinates
    27  
    28 XXX: Should we simply set pmSource->peak = peak?  If so, should we increase
    29 the reference counter?  Or, should we copy the data structure?
    30  
    31 XXX: Currently the subimage always has an even number of rows/columns.  Is
    32      this correct?  Since there is a center pixel, maybe it should have an
    33      odd number of rows/columns.
    34  
    35 XXX: Use psTrace() for the print statements.
    36  
    37 XXX: Don't use separate structs for the subimage and mask.  Use the source->
    38      members.
     34The source.pixels and source.mask must already exist
    3935*****************************************************************************/
    4036
     
    6056    srcRegion = psRegionForImage(mask, srcRegion);
    6157
    62     psImageMaskRegion(mask, srcRegion, "OR", PSPHOT_MASK_MARKED);
     58    psImageMaskRegion(mask, srcRegion, "OR", PM_SOURCE_MASK_MARKED);
    6359    psStats *myStats = psStatsAlloc(statsOptions);
    6460    myStats = psImageStats(myStats, image, mask, 0xff);
    65     psImageMaskRegion(mask, srcRegion, "AND", ~PSPHOT_MASK_MARKED);
     61    psImageMaskRegion(mask, srcRegion, "AND", ~PM_SOURCE_MASK_MARKED);
    6662
    6763    psF64 tmpF64;
     
    10399    srcRegion = psRegionForImage(mask, srcRegion);
    104100
    105     psImageMaskRegion(mask, srcRegion, "OR", PSPHOT_MASK_MARKED);
     101    psImageMaskRegion(mask, srcRegion, "OR", PM_SOURCE_MASK_MARKED);
    106102    psStats *myStats = psStatsAlloc(statsOptions);
    107103    myStats = psImageStats(myStats, image, mask, 0xff);
    108     psImageMaskRegion(mask, srcRegion, "AND", ~PSPHOT_MASK_MARKED);
     104    psImageMaskRegion(mask, srcRegion, "AND", ~PM_SOURCE_MASK_MARKED);
    109105
    110106    psF64 tmpF64;
Note: See TracChangeset for help on using the changeset viewer.