IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4251


Ignore:
Timestamp:
Jun 14, 2005, 3:23:24 AM (21 years ago)
Author:
eugene
Message:

mask/noise are working

Location:
trunk/psphot
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/Makefile

    r4129 r4251  
    2323$(SRC)/psPolynomials.$(ARCH).o \
    2424$(SRC)/psUtils.$(ARCH).o \
     25$(SRC)/load_args.$(ARCH).o \
    2526$(SRC)/setup.$(ARCH).o \
    2627$(SRC)/image_stats.$(ARCH).o \
     
    3738$(SRC)/fit_galaxies.$(ARCH).o \
    3839$(SRC)/subtract_galaxies.$(ARCH).o \
     40$(SRC)/LocalSky.$(ARCH).o \
    3941$(SRC)/find_defects.$(ARCH).o
    4042
  • trunk/psphot/src/LocalSky.c

    r4216 r4251  
    77                          psF32 Radius)
    88{
     9    psRegion *srcRegion;
     10
    911    // Grab a subimage of the original image of size (2 * outerRadius).
    1012    srcRegion = psRegionSquare (x, y, Radius);
    11     srcRegion = psRegionForImage (srcRegion, imdata->image);
     13    srcRegion = psRegionForImage (srcRegion, imdata->image, srcRegion);
    1214
    13     psImage *subImage = psImageSubset(imdata->image, srcRegion);
    14     psImage *subImageMask = psImageSubset(imdata->mask, srcRegion);
    15     psImage *subImageNoise = psImageSubset(imdata->noise, srcRegion);
     15//  psImage *subImage = psImageSubset(imdata->image, srcRegion);
     16//  psImage *subImageMask = psImageSubset(imdata->mask, srcRegion);
     17//  psImage *subImageNoise = psImageSubset(imdata->noise, srcRegion);
     18
     19    psImage *subImage = psImageSubset(imdata->image, srcRegion->x0, srcRegion->y0, srcRegion->x1, srcRegion->y1);
     20    psImage *subImageMask = psImageSubset(imdata->mask, srcRegion->x0, srcRegion->y0, srcRegion->x1, srcRegion->y1);
     21    psImage *subImageNoise = psImageSubset(imdata->noise, srcRegion->x0, srcRegion->y0, srcRegion->x1, srcRegion->y1);
    1622
    1723    mySource->pixels = subImage;
     
    3036    psImage *image = source->pixels;
    3137    psImage *mask  = source->mask;
    32     psImage *peak  = source->peak;
     38    psPeak *peak  = source->peak;
     39    psRegion *srcRegion;
    3340
    3441    srcRegion = psRegionSquare (peak->x, peak->y, Radius);
    35     srcRegion = psRegionForImage (srcRegion, imdata->mask);
    36     psImageMaskRegion (imdata->mask, region, OR, 0x80);
     42    srcRegion = psRegionForImage (srcRegion, mask, srcRegion);
     43    psImageMaskRegion (mask, srcRegion, OR, 0x80);
    3744
    3845    psStats *myStats = psStatsAlloc(statsOptions);
    3946    myStats = psImageStats(myStats, image, mask, 0xff);
    40     psImageMaskRegion (imdata->mask, region, AND, 0x7f);
     47    psImageMaskRegion (mask, srcRegion, AND, 0x7f);
    4148
    42     mySource->moments = pmMomentsAlloc();
     49    source->moments = pmMomentsAlloc();
    4350    psF64 tmpF64;
    4451    p_psGetStatValue(myStats, &tmpF64);
    45     mySource->moments->Sky = (psF32) tmpF64;
     52    source->moments->Sky = (psF32) tmpF64;
    4653
    4754    return (true);
    4855}
    4956
    50 // define a square region centered on the given coordinate
    51 psRegion *psRegionSquare (psF32 x, psF32 y, psF32 radius) {
    52     region = psRegionAlloc (x - Radius, y - Radius, x + Radius + 1, y + Radius + 1);
    53     return (region);
    54 }
  • trunk/psphot/src/apply_psf_model.c

    r4216 r4251  
    55// run this function to a specific flux limit?
    66
    7 bool apply_psf_model (psImage *image, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky)
     7bool apply_psf_model (psImageData *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky)
    88{
    99    bool  status;
     10    float x;
     11    float y;
    1012    int   Nfit = 0;
    1113    int   Niter = 0;
     
    4244        x = model->params->data.F32[2];
    4345        y = model->params->data.F32[3];
     46        // XXX I need to check if the model center has moved too much relative to the peak
    4447
    4548        // set the fit radius based on the object flux limit and the model
     
    5154        }
    5255       
    53         // mask off saturated pixels (move this to setup?)
    54         pmSourceMaskSaturated (source, SATURATE);
    55 
    5656        // check if we need to redefine the pixels
    5757        if (model->radius > OUTER) {
  • trunk/psphot/src/choose_psf_model.c

    r4216 r4251  
    33// test PSF models and select best option
    44
    5 pmPSF *choose_psf_model (psImage *image, psMetadata *config, psArray *sources)
     5pmPSF *choose_psf_model (psMetadata *config, psArray *sources)
    66{
    77    bool        status;
  • trunk/psphot/src/find_defects.c

    r4188 r4251  
    11# include "psphot.h"
    22# define NSIGMA 3.0
    3 
    4 void dump_image (psImage *image, char *filename);
    53
    64bool find_defects (psImage *zapmask, psArray *sources, psMetadata *config, pmPSF *psf)
     
    3432  // generate the image flux
    3533  pmSourceAddModel (flux, NULL, model, true);
    36   dump_image (flux, "psf.fits");
     34  DumpImage (flux, "psf.fits");
    3735
    3836  fprintf (stderr, "sx: %f, sy: %f\n", model->params->data.F32[4], model->params->data.F32[5]);
  • trunk/psphot/src/fit_galaxies.c

    r4114 r4251  
    88    int   Nfit = 0;
    99    int   Niter = 0;
    10 
    11     float XBORDER  = psMetadataLookupF32 (&status, config, "XBORDER");
    12     float YBORDER  = psMetadataLookupF32 (&status, config, "YBORDER");
    13     psRegion *keep = psRegionAlloc (XBORDER, -XBORDER, YBORDER, -YBORDER);
    14     keep           = psRegionForImage (keep, image, keep);
    1510
    1611    float RADIUS   = psMetadataLookupF32 (&status, config, "FIT_RADIUS");
     
    2520
    2621        // need a better model guess and a better radius choice
    27         pmSourceSetPixelCircle (source, image, RADIUS);
    28         pmSourceMaskRegion (source, keep);
     22        // when radius is not fixed, we will need to check if new radius fits on image
     23# if (0)
     24        if (model->radius > OUTER) {
     25          // allocate image, noise, mask arrays for each peak (square of radius OUTER)
     26          pmSourceDefinePixels (source, imdata, x, y, OUTER);
     27        }
     28# endif
    2929        psModel  *model  = pmSourceModelGuess (source, modelType);
    3030
  • trunk/psphot/src/load_args.c

    r4189 r4251  
    22
    33psMetadata *load_args (int *argc, char **argv) {
     4
     5  int N, Nfail;
     6
     7  // basic pslib options
     8  psLogSetFormat ("M");
     9  psLogArguments (argc, argv);
     10  psTraceArguments (argc, argv);
    411
    512  // identify options in args list - these go on config
     
    1926  }
    2027
    21   if (argc != 4) usage ();
     28  if (*argc != 4) usage ();
    2229
    2330  psMetadata *config = psMetadataParseConfig (NULL, &Nfail, argv[3], FALSE);
  • trunk/psphot/src/psUtils.c

    r4188 r4251  
    11# include "psphot.h"
    2 
    3 // set actual region based on image parameters
    4 // XXX EAM : this needs to be changes to use psRegion rather than psRegion*
    5 psRegion *psRegionForImage (psRegion *out, psImage *image, psRegion *in) {
    6    
    7     if (out == NULL) {
    8         out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1);
    9     } else {
    10         *out = *in;
    11     }
    12     if (out->x1 <= 0) {
    13         out->x1 = image->numCols + out->x1;
    14     }
    15     if (out->y1 <= 0) {
    16         out->y1 = image->numRows + out->y1;
    17     }
    18     return (out);
    19 }
    202
    213static psHash *timers = NULL;
     
    336318  return (false);
    337319}           
     320
     321// define a square region centered on the given coordinate
     322psRegion *psRegionSquare (psF32 x, psF32 y, psF32 radius) {
     323    psRegion *region;
     324    region = psRegionAlloc (x - radius, x + radius + 1,   
     325                            y - radius, y + radius + 1);
     326    return (region);
     327}
     328
     329// set actual region based on image parameters:
     330// compensate for negative upper limits
     331// XXX this is inconsistent: the coordindates should always be in the parent
     332//     frame, which means the negative values should subtract from Nx,Ny of
     333//     the parent, not the child.  but, we don't carry the dimensions of the
     334//     parent in the psImage container.  for now, us the child Nx,Ny
     335// force range to be on this subimage
     336// XXX EAM : this needs to be changes to use psRegion rather than psRegion*
     337psRegion *psRegionForImage (psRegion *out, psImage *image, psRegion *in) {
     338   
     339    // x0,y0, x1,y1 are in *parent* units
     340
     341    if (out == NULL) {
     342        out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1);
     343    } else {
     344        *out = *in;
     345    }
     346    // XXX these are probably wrong (see above)
     347    if (out->x1 <= 0) {
     348        out->x1 = image->col0 + image->numCols + out->x1;
     349    }
     350    if (out->y1 <= 0) {
     351        out->y1 = image->row0 + image->numRows + out->y1;
     352    }
     353
     354    // force the lower-limits to be on the child
     355    out->x0 = PS_MAX(image->col0, out->x0);
     356    out->y0 = PS_MAX(image->row0, out->y0);
     357
     358    // force the upper-limits to be on the child
     359    out->x1 = PS_MIN(image->col0 + image->numCols, out->x1);
     360    out->y1 = PS_MIN(image->row0 + image->numRows, out->y1);
     361    return (out);
     362}
     363
     364// mask the area contained by the region
     365// the region is defined wrt the parent image
     366void psImageMaskRegion (psImage *image, psRegion *region, bool logical_and, int maskValue) {
     367
     368    for (int iy = 0; iy < image->numRows; iy++) {
     369        for (int ix = 0; ix < image->numCols; ix++) {
     370            if (ix + image->col0 <  region->x0) continue;
     371            if (ix + image->col0 >= region->x1) continue;
     372            if (iy + image->row0 <  region->y0) continue;
     373            if (iy + image->row0 >= region->y1) continue;
     374            if (logical_and) {
     375                image->data.U8[iy][ix] &= maskValue;
     376            } else {
     377                image->data.U8[iy][ix] |= maskValue;
     378            }
     379        }
     380    }
     381}
     382
     383// mask the area not contained by the region
     384// the region is defined wrt the parent image
     385void psImageKeepRegion (psImage *image, psRegion *region, bool logical_and, int maskValue) {
     386
     387    for (int iy = 0; iy < image->numRows; iy++) {
     388        for (int ix = 0; ix < image->numCols; ix++) {
     389            if (ix + image->col0 <  region->x0) goto maskit;
     390            if (ix + image->col0 >= region->x1) goto maskit;
     391            if (iy + image->row0 <  region->y0) goto maskit;
     392            if (iy + image->row0 >= region->y1) goto maskit;
     393            continue;
     394        maskit:
     395            if (logical_and) {
     396                image->data.U8[iy][ix] &= maskValue;
     397            } else {
     398                image->data.U8[iy][ix] |= maskValue;
     399            }
     400        }
     401    }
     402}
     403
     404// mask the area contained by the region
     405// the region is defined wrt the parent image
     406void psImageMaskCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue) {
     407
     408    double dx, dy, r2, R2;
     409
     410    R2 = PS_SQR(radius);
     411
     412    for (int iy = 0; iy < image->numRows; iy++) {
     413        for (int ix = 0; ix < image->numCols; ix++) {
     414            dx = ix + image->col0 - x;
     415            dy = iy + image->row0 - y;
     416            r2 = PS_SQR(dx) + PS_SQR(dy);
     417            if (r2 > R2) continue;
     418            if (logical_and) {
     419                image->data.U8[iy][ix] &= maskValue;
     420            } else {
     421                image->data.U8[iy][ix] |= maskValue;
     422            }
     423        }
     424    }
     425}
     426
     427// mask the area contained by the region
     428// the region is defined wrt the parent image
     429void psImageKeepCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue) {
     430
     431    double dx, dy, r2, R2;
     432
     433    R2 = PS_SQR(radius);
     434
     435    for (int iy = 0; iy < image->numRows; iy++) {
     436        for (int ix = 0; ix < image->numCols; ix++) {
     437            dx = ix + image->col0 - x;
     438            dy = iy + image->row0 - y;
     439            r2 = PS_SQR(dx) + PS_SQR(dy);
     440            if (r2 < R2) continue;
     441            if (logical_and) {
     442                image->data.U8[iy][ix] &= maskValue;
     443            } else {
     444                image->data.U8[iy][ix] |= maskValue;
     445            }
     446        }
     447    }
     448}
     449
  • trunk/psphot/src/psphot-utils.c

    r4216 r4251  
    135135    psFitsWriteImage (fits, NULL, image, 0, NULL);
    136136    psFree (fits);
    137     return;
     137    return true;
    138138}
    139139
     140# if (0)
    140141void pmSourceMaskSaturated (psSource *source, float saturate) {
    141142
     
    150151    }
    151152}
    152 
    153 // mask the area contained by the region
    154 // the region is defined wrt the parent image
    155 void psImageMaskRegion (psImage *image, psRegion *region, bool logical_and, int maskValue) {
    156 
    157     for (int iy = 0; iy < image->numRows; iy++) {
    158         for (int ix = 0; ix < image->numCols; ix++) {
    159             if (ix + image->col0 <  region->x0) continue;
    160             if (ix + image->col0 >= region->x1) continue;
    161             if (iy + image->row0 <  region->y0) continue;
    162             if (iy + image->row0 >= region->y1) continue;
    163             if (logical_and) {
    164                 image->data.U8[iy][ix] &= maskValue;
    165             } else {
    166                 image->data.U8[iy][ix] |= maskValue;
    167             }
    168         }
    169     }
    170 }
    171 
    172 // mask the area not contained by the region
    173 // the region is defined wrt the parent image
    174 void psImageKeepRegion (psImage *image, psRegion *region, bool logical_and, int maskValue) {
    175 
    176     for (int iy = 0; iy < image->numRows; iy++) {
    177         for (int ix = 0; ix < image->numCols; ix++) {
    178             if (ix + image->col0 <  region->x0) goto maskit;
    179             if (ix + image->col0 >= region->x1) goto maskit;
    180             if (iy + image->row0 <  region->y0) goto maskit;
    181             if (iy + image->row0 >= region->y1) goto maskit;
    182             continue;
    183         maskit:
    184             if (logical_and) {
    185                 image->data.U8[iy][ix] &= maskValue;
    186             } else {
    187                 image->data.U8[iy][ix] |= maskValue;
    188             }
    189         }
    190     }
    191 }
    192 
    193 // mask the area contained by the region
    194 // the region is defined wrt the parent image
    195 void psImageMaskCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue) {
    196 
    197     double R2 = PS_SQR(radius);
    198 
    199     for (int iy = 0; iy < image->numRows; iy++) {
    200         for (int ix = 0; ix < image->numCols; ix++) {
    201             dx = ix + image->col0 - x;
    202             dy = iy + image->row0 - y;
    203             r2 = PS_SQR(dx) + PS_SQR(dy);
    204             if (r2 > R2) continue;
    205             if (logical_and) {
    206                 image->data.U8[iy][ix] &= maskValue;
    207             } else {
    208                 image->data.U8[iy][ix] |= maskValue;
    209             }
    210         }
    211     }
    212 }
    213 
    214 // mask the area contained by the region
    215 // the region is defined wrt the parent image
    216 void psImageKeepCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue) {
    217 
    218     double R2 = PS_SQR(radius);
    219 
    220     for (int iy = 0; iy < image->numRows; iy++) {
    221         for (int ix = 0; ix < image->numCols; ix++) {
    222             dx = ix + image->col0 - x;
    223             dy = iy + image->row0 - y;
    224             r2 = PS_SQR(dx) + PS_SQR(dy);
    225             if (r2 < R2) continue;
    226             if (logical_and) {
    227                 image->data.U8[iy][ix] &= maskValue;
    228             } else {
    229                 image->data.U8[iy][ix] |= maskValue;
    230             }
    231         }
    232     }
    233 }
     153# endif
    234154
    235155// create a subset of sources for the PS_SOURCE_PSFSTAR entries
  • trunk/psphot/src/psphot.c

    r4216 r4251  
    1010    psStats     *sky     = NULL;
    1111
    12     psLogArguments (&argc, argv);
    13     psTraceArguments (&argc, argv);
    1412    config = load_args (&argc, argv);
    1513
     
    3129
    3230    // use stellar objects SN > PSF_SN_LIM
    33     psf = choose_psf_model (imdata, config, sources);
     31    psf = choose_psf_model (config, sources);
    3432
    35     if (0) {
    36       psImage *zap = psImageAlloc (imdata->image->numCols, imdata->image->numRows, PS_TYPE_F32);
    37       psImageInit (zap, 0);
    38       find_defects (zap, sources, config, psf);
    39       DumpImage (zap, argv[2]);
    40       exit (0);
    41     }
     33    // identify defects based on 1-pixel wide x and y direction 2nd moments
     34    find_defects (zap, sources, config, psf);
    4235
    4336    // test PSF on all except SATURATE and DEFECT (artifacts)
  • trunk/psphot/src/psphot.h

    r4216 r4251  
    4141int get_argument (int argc, char **argv, char *arg);
    4242int remove_argument (int N, int *argc, char **argv);
     43psMetadata *load_args (int *argc, char **argv);
    4344
    4445psArray *pmPeaksSubset(psArray *peaks, psF32 maxValue, const psRegion *valid);
     
    6667pmPSF *pmPSFAlloc (psModelType type);
    6768pmPSF_Test *pmPSF_TestAlloc (psArray *stars, char *modelName);
    68 pmPSF_Test *pmPSF_TestModel (psArray *stars, char *modelName);
     69pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float radius);
    6970
    7071bool pmPSFFromModels (pmPSF *psf, psArray *models, psVector *mask);
     
    7475
    7576// top-level psphot functions
    76 bool setup (psImage **image, psMetadata **header, psMetadata **config, char **argv);
    77 psStats *image_stats (psImage *image, psMetadata *config);
    78 psArray *find_peaks (psImage *image, psMetadata *config, psStats *sky);
    79 psArray *source_moments (psImage *image, psMetadata *config, psArray *allpeaks);
    80 pmPSF *choose_psf_model (psImage *image, psMetadata *config, psArray *sources);
    81 bool apply_psf_model (psImage *image, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);
     77psImageData *setup (psMetadata *config);
     78psStats *image_stats (psImageData *imdata, psMetadata *config);
     79psArray *find_peaks (psImageData *imdata, psMetadata *config, psStats *sky);
     80psArray *source_moments (psImageData *imdata, psMetadata *config, psArray *allpeaks);
     81pmPSF *choose_psf_model (psMetadata *config, psArray *sources);
     82bool apply_psf_model (psImageData *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);
    8283bool test_psf_scatter (psArray *sources);
    8384bool mark_psf_sources (psArray *sources, psMetadata *config);
     
    9091bool mark_psf_source (psSource *source, float shapeNsigma);
    9192bool find_defects (psImage *zapmask, psArray *sources, psMetadata *config, pmPSF *psf);
     93
     94bool pmSourceDefinePixels(psSource *mySource, const psImageData *imdata, psF32 x, psF32 y, psF32 Radius);
     95bool pmSourceLocalSky_EAM (psSource *source, psStatsOptions statsOptions, psF32 Radius);
     96psRegion *psRegionSquare (psF32 x, psF32 y, psF32 radius);
     97
     98// image mask functions
     99void psImageMaskRegion (psImage *image, psRegion *region, bool logical_and, int maskValue);
     100void psImageKeepRegion (psImage *image, psRegion *region, bool logical_and, int maskValue);
     101void psImageMaskCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue);
     102void psImageKeepCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue);
     103
     104# define AND true
     105# define OR false
  • trunk/psphot/src/pspsf.c

    r4216 r4251  
    4646}
    4747
    48 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float RADIUS) {
     48pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float RADIUS)
     49{
    4950 
     51    float x;
     52    float y;
     53    bool status;
    5054    int Nflt = 0;
    5155    int Npsf = 0;
     
    102106        }
    103107        psModel  *modelPSF = psModelFromPSF (modelFLT, test->psf); // set shape for this model
    104 
    105         psImageKeepCircle (source->mask, RADIUS, OR, 0x80);
     108        x = source->peak->x;
     109        y = source->peak->y;
     110
     111        psImageKeepCircle (source->mask, x, y, RADIUS, OR, 0x80);
    106112        status = pmSourceFitModel (source, modelPSF, true);
    107         psImageKeepCircle (source->mask, RADIUS, AND, 0x7f);
     113        psImageKeepCircle (source->mask, x, y, RADIUS, AND, 0x7f);
    108114
    109115        // skip poor fits
  • trunk/psphot/src/setup.c

    r4216 r4251  
    1313    psImage *noise = NULL;
    1414    psImage *mask = NULL;
    15 
    16     psRegion  region = {0,0,0,0};       // a region representing the entire array
     15    psRegion region = {0,0,0,0};        // a region representing the entire array
     16    bool status;
    1717
    1818    psTimerStart ("psphot");
     
    2424
    2525    // read header and image data from INPUT
    26     char *input = psMetadataLookupSTR (&status, config, "INPUT");
     26    char *input = psMetadataLookupPtr (&status, config, "INPUT");
    2727    psFits *file = psFitsAlloc (input);
    2828    header = psFitsReadHeader (header, file);
     
    3131
    3232    // grab these values from the approrpiate location (image header if necessary)
    33     bool  status   = false;
    3433    float RDNOISE  = pmConfigLookupF32 (&status, config, header, "RDNOISE");
    3534    float GAIN     = pmConfigLookupF32 (&status, config, header, "GAIN");
     
    3837
    3938    // load the noise image if it is supplied, otherwise build from input
    40     char *noiseName = psMetadataLookupSTR (&status, config, "NOISE");
     39    char *noiseName = psMetadataLookupPtr (&status, config, "NOISE");
    4140    if (status == true) {
    4241      file = psFitsAlloc (noiseName);
     
    4443      psFree (file);
    4544    } else {
    46       psScalar *value = psScalarAlloc (1.0 / GAIN, PS_TYPE_F64);
    47       noise = BinaryOp (NULL, image, '/', value);
     45      psScalar *value;
     46
     47      noise = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
     48      for (int iy = 0; iy < image->numRows; iy++) {
     49        for (int ix = 0; ix < image->numCols; ix++) {
     50          noise->data.F32[iy][ix] = image->data.F32[iy][ix] / GAIN + PS_SQR(RDNOISE/GAIN);
     51        }
     52      }
     53
     54      // XXX EAM it looks like psBinaryOp is broken for (image op scalar)
     55      # if (0)
     56      value = psScalarAlloc (1.0 / GAIN, PS_TYPE_F64);
     57      noise = (psImage *) psBinaryOp (NULL, image, "/", value);
    4858      psFree (value);
    4959
    50       psScalar *value = psScalarAlloc (PS_SQR(RDNOISE/GAIN), PS_TYPE_F64);
    51       noise = BinaryOp (noise, noise, '+', value);
     60      value = psScalarAlloc (PS_SQR(RDNOISE/GAIN), PS_TYPE_F64);
     61      noise = (psImage *) psBinaryOp (noise, noise, "+", value);
    5262      psFree (value);
     63      # endif
    5364    }
    5465
    55     char *maskName = psMetadataLookupSTR (&status, config, "MASK");
     66    char *maskName = psMetadataLookupPtr (&status, config, "MASK");
    5667    if (status == true) {
    5768      file = psFitsAlloc (maskName);
     
    6778    psRegion *keep = psRegionAlloc (XBORDER, -XBORDER, YBORDER, -YBORDER);
    6879    keep           = psRegionForImage (keep, image, keep);
    69     psImageKeepRegion (mask, keep, 0x01);
     80    psImageKeepRegion (mask, keep, OR, 0x01);
    7081
    7182    // mask the saturated pixels
     
    8798    imdata->mask = mask;
    8899
    89     return (true);
     100    return (imdata);
    90101}
  • trunk/psphot/src/source_moments.c

    r4216 r4251  
    11# include "psphot.h"
    22
    3 psArray *source_moments (psImageData *imdata, psMetadata *config, psArray *allpeaks)
     3psArray *source_moments (psImageData *imdata, psMetadata *config, psArray *peaks)
    44{
    55    bool     status  = false;
    66    psArray *sources = NULL;
    7     psArray *peaks   = NULL;
    87
    98    psTimerStart ("psphot");
  • trunk/psphot/src/subtract_psf_source.c

    r4129 r4251  
    2525  pmSourceSubModel (pixels, source->mask, model, false);
    2626  model->params->data.F32[0] = sky;
     27
     28  // XXX adjust (enhance) the noise matrix a la dophot?
     29
    2730  return (true);
    2831}
Note: See TracChangeset for help on using the changeset viewer.