Changeset 4251
- Timestamp:
- Jun 14, 2005, 3:23:24 AM (21 years ago)
- Location:
- trunk/psphot
- Files:
-
- 1 added
- 15 edited
-
Makefile (modified) (2 diffs)
-
src/LocalSky.c (modified) (2 diffs)
-
src/apply_psf_model.c (modified) (3 diffs)
-
src/choose_psf_model.c (modified) (1 diff)
-
src/find_defects.c (modified) (2 diffs)
-
src/find_defects_new.c (added)
-
src/fit_galaxies.c (modified) (2 diffs)
-
src/load_args.c (modified) (2 diffs)
-
src/psUtils.c (modified) (2 diffs)
-
src/psphot-utils.c (modified) (2 diffs)
-
src/psphot.c (modified) (2 diffs)
-
src/psphot.h (modified) (4 diffs)
-
src/pspsf.c (modified) (2 diffs)
-
src/setup.c (modified) (7 diffs)
-
src/source_moments.c (modified) (1 diff)
-
src/subtract_psf_source.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/Makefile
r4129 r4251 23 23 $(SRC)/psPolynomials.$(ARCH).o \ 24 24 $(SRC)/psUtils.$(ARCH).o \ 25 $(SRC)/load_args.$(ARCH).o \ 25 26 $(SRC)/setup.$(ARCH).o \ 26 27 $(SRC)/image_stats.$(ARCH).o \ … … 37 38 $(SRC)/fit_galaxies.$(ARCH).o \ 38 39 $(SRC)/subtract_galaxies.$(ARCH).o \ 40 $(SRC)/LocalSky.$(ARCH).o \ 39 41 $(SRC)/find_defects.$(ARCH).o 40 42 -
trunk/psphot/src/LocalSky.c
r4216 r4251 7 7 psF32 Radius) 8 8 { 9 psRegion *srcRegion; 10 9 11 // Grab a subimage of the original image of size (2 * outerRadius). 10 12 srcRegion = psRegionSquare (x, y, Radius); 11 srcRegion = psRegionForImage (srcRegion, imdata->image );13 srcRegion = psRegionForImage (srcRegion, imdata->image, srcRegion); 12 14 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); 16 22 17 23 mySource->pixels = subImage; … … 30 36 psImage *image = source->pixels; 31 37 psImage *mask = source->mask; 32 psImage *peak = source->peak; 38 psPeak *peak = source->peak; 39 psRegion *srcRegion; 33 40 34 41 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); 37 44 38 45 psStats *myStats = psStatsAlloc(statsOptions); 39 46 myStats = psImageStats(myStats, image, mask, 0xff); 40 psImageMaskRegion ( imdata->mask, region, AND, 0x7f);47 psImageMaskRegion (mask, srcRegion, AND, 0x7f); 41 48 42 mySource->moments = pmMomentsAlloc();49 source->moments = pmMomentsAlloc(); 43 50 psF64 tmpF64; 44 51 p_psGetStatValue(myStats, &tmpF64); 45 mySource->moments->Sky = (psF32) tmpF64;52 source->moments->Sky = (psF32) tmpF64; 46 53 47 54 return (true); 48 55 } 49 56 50 // define a square region centered on the given coordinate51 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 5 5 // run this function to a specific flux limit? 6 6 7 bool apply_psf_model (psImage *image, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky)7 bool apply_psf_model (psImageData *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky) 8 8 { 9 9 bool status; 10 float x; 11 float y; 10 12 int Nfit = 0; 11 13 int Niter = 0; … … 42 44 x = model->params->data.F32[2]; 43 45 y = model->params->data.F32[3]; 46 // XXX I need to check if the model center has moved too much relative to the peak 44 47 45 48 // set the fit radius based on the object flux limit and the model … … 51 54 } 52 55 53 // mask off saturated pixels (move this to setup?)54 pmSourceMaskSaturated (source, SATURATE);55 56 56 // check if we need to redefine the pixels 57 57 if (model->radius > OUTER) { -
trunk/psphot/src/choose_psf_model.c
r4216 r4251 3 3 // test PSF models and select best option 4 4 5 pmPSF *choose_psf_model (ps Image *image, psMetadata *config, psArray *sources)5 pmPSF *choose_psf_model (psMetadata *config, psArray *sources) 6 6 { 7 7 bool status; -
trunk/psphot/src/find_defects.c
r4188 r4251 1 1 # include "psphot.h" 2 2 # define NSIGMA 3.0 3 4 void dump_image (psImage *image, char *filename);5 3 6 4 bool find_defects (psImage *zapmask, psArray *sources, psMetadata *config, pmPSF *psf) … … 34 32 // generate the image flux 35 33 pmSourceAddModel (flux, NULL, model, true); 36 dump_image (flux, "psf.fits");34 DumpImage (flux, "psf.fits"); 37 35 38 36 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 8 8 int Nfit = 0; 9 9 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);15 10 16 11 float RADIUS = psMetadataLookupF32 (&status, config, "FIT_RADIUS"); … … 25 20 26 21 // 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 29 29 psModel *model = pmSourceModelGuess (source, modelType); 30 30 -
trunk/psphot/src/load_args.c
r4189 r4251 2 2 3 3 psMetadata *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); 4 11 5 12 // identify options in args list - these go on config … … 19 26 } 20 27 21 if ( argc != 4) usage ();28 if (*argc != 4) usage (); 22 29 23 30 psMetadata *config = psMetadataParseConfig (NULL, &Nfail, argv[3], FALSE); -
trunk/psphot/src/psUtils.c
r4188 r4251 1 1 # include "psphot.h" 2 3 // set actual region based on image parameters4 // 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 }20 2 21 3 static psHash *timers = NULL; … … 336 318 return (false); 337 319 } 320 321 // define a square region centered on the given coordinate 322 psRegion *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* 337 psRegion *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 366 void 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 385 void 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 406 void 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 429 void 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 135 135 psFitsWriteImage (fits, NULL, image, 0, NULL); 136 136 psFree (fits); 137 return ;137 return true; 138 138 } 139 139 140 # if (0) 140 141 void pmSourceMaskSaturated (psSource *source, float saturate) { 141 142 … … 150 151 } 151 152 } 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 234 154 235 155 // create a subset of sources for the PS_SOURCE_PSFSTAR entries -
trunk/psphot/src/psphot.c
r4216 r4251 10 10 psStats *sky = NULL; 11 11 12 psLogArguments (&argc, argv);13 psTraceArguments (&argc, argv);14 12 config = load_args (&argc, argv); 15 13 … … 31 29 32 30 // use stellar objects SN > PSF_SN_LIM 33 psf = choose_psf_model ( imdata,config, sources);31 psf = choose_psf_model (config, sources); 34 32 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); 42 35 43 36 // test PSF on all except SATURATE and DEFECT (artifacts) -
trunk/psphot/src/psphot.h
r4216 r4251 41 41 int get_argument (int argc, char **argv, char *arg); 42 42 int remove_argument (int N, int *argc, char **argv); 43 psMetadata *load_args (int *argc, char **argv); 43 44 44 45 psArray *pmPeaksSubset(psArray *peaks, psF32 maxValue, const psRegion *valid); … … 66 67 pmPSF *pmPSFAlloc (psModelType type); 67 68 pmPSF_Test *pmPSF_TestAlloc (psArray *stars, char *modelName); 68 pmPSF_Test *pmPSF_TestModel (psArray *s tars, char *modelName);69 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float radius); 69 70 70 71 bool pmPSFFromModels (pmPSF *psf, psArray *models, psVector *mask); … … 74 75 75 76 // 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 (ps Image *image, psMetadata *config, psArray *sources);81 bool apply_psf_model (psImage *image, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);77 psImageData *setup (psMetadata *config); 78 psStats *image_stats (psImageData *imdata, psMetadata *config); 79 psArray *find_peaks (psImageData *imdata, psMetadata *config, psStats *sky); 80 psArray *source_moments (psImageData *imdata, psMetadata *config, psArray *allpeaks); 81 pmPSF *choose_psf_model (psMetadata *config, psArray *sources); 82 bool apply_psf_model (psImageData *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky); 82 83 bool test_psf_scatter (psArray *sources); 83 84 bool mark_psf_sources (psArray *sources, psMetadata *config); … … 90 91 bool mark_psf_source (psSource *source, float shapeNsigma); 91 92 bool find_defects (psImage *zapmask, psArray *sources, psMetadata *config, pmPSF *psf); 93 94 bool pmSourceDefinePixels(psSource *mySource, const psImageData *imdata, psF32 x, psF32 y, psF32 Radius); 95 bool pmSourceLocalSky_EAM (psSource *source, psStatsOptions statsOptions, psF32 Radius); 96 psRegion *psRegionSquare (psF32 x, psF32 y, psF32 radius); 97 98 // image mask functions 99 void psImageMaskRegion (psImage *image, psRegion *region, bool logical_and, int maskValue); 100 void psImageKeepRegion (psImage *image, psRegion *region, bool logical_and, int maskValue); 101 void psImageMaskCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue); 102 void 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 46 46 } 47 47 48 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float RADIUS) { 48 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float RADIUS) 49 { 49 50 51 float x; 52 float y; 53 bool status; 50 54 int Nflt = 0; 51 55 int Npsf = 0; … … 102 106 } 103 107 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); 106 112 status = pmSourceFitModel (source, modelPSF, true); 107 psImageKeepCircle (source->mask, RADIUS, AND, 0x7f);113 psImageKeepCircle (source->mask, x, y, RADIUS, AND, 0x7f); 108 114 109 115 // skip poor fits -
trunk/psphot/src/setup.c
r4216 r4251 13 13 psImage *noise = NULL; 14 14 psImage *mask = NULL; 15 16 psRegion region = {0,0,0,0}; // a region representing the entire array15 psRegion region = {0,0,0,0}; // a region representing the entire array 16 bool status; 17 17 18 18 psTimerStart ("psphot"); … … 24 24 25 25 // read header and image data from INPUT 26 char *input = psMetadataLookup STR(&status, config, "INPUT");26 char *input = psMetadataLookupPtr (&status, config, "INPUT"); 27 27 psFits *file = psFitsAlloc (input); 28 28 header = psFitsReadHeader (header, file); … … 31 31 32 32 // grab these values from the approrpiate location (image header if necessary) 33 bool status = false;34 33 float RDNOISE = pmConfigLookupF32 (&status, config, header, "RDNOISE"); 35 34 float GAIN = pmConfigLookupF32 (&status, config, header, "GAIN"); … … 38 37 39 38 // load the noise image if it is supplied, otherwise build from input 40 char *noiseName = psMetadataLookup STR(&status, config, "NOISE");39 char *noiseName = psMetadataLookupPtr (&status, config, "NOISE"); 41 40 if (status == true) { 42 41 file = psFitsAlloc (noiseName); … … 44 43 psFree (file); 45 44 } 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); 48 58 psFree (value); 49 59 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); 52 62 psFree (value); 63 # endif 53 64 } 54 65 55 char *maskName = psMetadataLookup STR(&status, config, "MASK");66 char *maskName = psMetadataLookupPtr (&status, config, "MASK"); 56 67 if (status == true) { 57 68 file = psFitsAlloc (maskName); … … 67 78 psRegion *keep = psRegionAlloc (XBORDER, -XBORDER, YBORDER, -YBORDER); 68 79 keep = psRegionForImage (keep, image, keep); 69 psImageKeepRegion (mask, keep, 0x01);80 psImageKeepRegion (mask, keep, OR, 0x01); 70 81 71 82 // mask the saturated pixels … … 87 98 imdata->mask = mask; 88 99 89 return ( true);100 return (imdata); 90 101 } -
trunk/psphot/src/source_moments.c
r4216 r4251 1 1 # include "psphot.h" 2 2 3 psArray *source_moments (psImageData *imdata, psMetadata *config, psArray * allpeaks)3 psArray *source_moments (psImageData *imdata, psMetadata *config, psArray *peaks) 4 4 { 5 5 bool status = false; 6 6 psArray *sources = NULL; 7 psArray *peaks = NULL;8 7 9 8 psTimerStart ("psphot"); -
trunk/psphot/src/subtract_psf_source.c
r4129 r4251 25 25 pmSourceSubModel (pixels, source->mask, model, false); 26 26 model->params->data.F32[0] = sky; 27 28 // XXX adjust (enhance) the noise matrix a la dophot? 29 27 30 return (true); 28 31 }
Note:
See TracChangeset
for help on using the changeset viewer.
