Changeset 5593
- Timestamp:
- Nov 25, 2005, 1:13:43 PM (21 years ago)
- Location:
- trunk/psphot
- Files:
-
- 2 deleted
- 13 edited
-
Makefile (modified) (2 diffs)
-
doc/notes.txt (modified) (1 diff)
-
src/models/pmModel_GAUSS.c (modified) (1 diff)
-
src/models/pmModel_PGAUSS.c (modified) (1 diff)
-
src/models/pmModel_QGAUSS.c (modified) (1 diff)
-
src/models/pmModel_SGAUSS.c (modified) (1 diff)
-
src/models/pmModel_TGAUSS.c (modified) (1 diff)
-
src/pmObjects_EAM.c (modified) (6 diffs)
-
src/pmPSF.c (modified) (2 diffs)
-
src/pmPSFtry.c (modified) (2 diffs)
-
src/pmPeaksSigmaLimit.c (modified) (1 diff)
-
src/psLibUtils.c (modified) (2 diffs)
-
src/psMinimize.c (deleted)
-
src/psPolynomials.c (deleted)
-
src/psphotFitGalaxies.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/Makefile
r5120 r5593 36 36 $(SRC)/psLibUtils.$(ARCH).o \ 37 37 $(SRC)/psLine.$(ARCH).o \ 38 $(SRC)/psMinimize.$(ARCH).o \39 $(SRC)/psPolynomials.$(ARCH).o \40 38 $(SRC)/psEllipse.$(ARCH).o \ 41 39 $(SRC)/psModulesUtils.$(ARCH).o \ … … 55 53 56 54 $(SRC)/pmModelGroup.$(ARCH).o: $(MODELS) 57 58 # deprecated59 55 60 56 FITSOURCE = \ -
trunk/psphot/doc/notes.txt
r5048 r5593 1 1 2 2 Notes on psphot 3 4 2005.11.16 5 6 I have made some fixes to make psphot work with pslib rel8_0. I 7 need to merge psphot with the rel8_0 version of the psMinimize and 8 pmObjects code. 3 9 4 10 2005.09.06 -
trunk/psphot/src/models/pmModel_GAUSS.c
r4977 r5593 124 124 for (int i = 4; i < 7; i++) { 125 125 psPolynomial2D *poly = psf->params->data[i-4]; 126 out[i] = Polynomial2DEval_EAM(poly, out[2], out[3]);126 out[i] = psPolynomial2DEval (poly, out[2], out[3]); 127 127 } 128 128 return(true); -
trunk/psphot/src/models/pmModel_PGAUSS.c
r4977 r5593 140 140 for (int i = 4; i < 7; i++) { 141 141 psPolynomial2D *poly = psf->params->data[i-4]; 142 out[i] = Polynomial2DEval_EAM(poly, out[2], out[3]);142 out[i] = psPolynomial2DEval (poly, out[2], out[3]); 143 143 } 144 144 return(true); -
trunk/psphot/src/models/pmModel_QGAUSS.c
r5129 r5593 170 170 for (int i = 4; i < 8; i++) { 171 171 psPolynomial2D *poly = psf->params->data[i-4]; 172 out[i] = Polynomial2DEval_EAM(poly, out[2], out[3]);172 out[i] = psPolynomial2DEval (poly, out[2], out[3]); 173 173 } 174 174 return(true); -
trunk/psphot/src/models/pmModel_SGAUSS.c
r4977 r5593 300 300 for (int i = 4; i < 9; i++) { 301 301 psPolynomial2D *poly = psf->params->data[i-4]; 302 out[i] = Polynomial2DEval_EAM(poly, out[2], out[3]);302 out[i] = psPolynomial2DEval (poly, out[2], out[3]); 303 303 } 304 304 return(true); -
trunk/psphot/src/models/pmModel_TGAUSS.c
r5130 r5593 173 173 for (int i = 4; i < 8; i++) { 174 174 psPolynomial2D *poly = psf->params->data[i-4]; 175 out[i] = Polynomial2DEval_EAM(poly, out[2], out[3]);175 out[i] = psPolynomial2DEval (poly, out[2], out[3]); 176 176 } 177 177 return(true); -
trunk/psphot/src/pmObjects_EAM.c
r5351 r5593 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-1 0-17 19:04:33 $8 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-11-25 23:13:43 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 999 999 int Ncr = 0; 1000 1000 int Nsatstar = 0; 1001 // psRegion allArray;1001 psRegion allArray = psRegionSet (0, 0, 0, 0); 1002 1002 1003 1003 psVector *starsn = psVectorAlloc (sources->n, PS_TYPE_F32); … … 1031 1031 1032 1032 // XXX EAM : can we use the value of SATURATE if mask is NULL? 1033 // XXX EAM *** serious errors in psImageCountPixelMask: inconsistent with psRegion and subimage 1034 // allArray = psRegionSet (1, tmpSrc->mask->numCols, 1, tmpSrc->mask->numRows); 1035 // int Nsatpix = psImageCountPixelMask (tmpSrc->mask, allArray, PSPHOT_MASK_SATURATED); 1036 int Nsatpix = psImageCountPixelMask_EAM (tmpSrc->mask, PSPHOT_MASK_SATURATED); 1033 // allArray = psRegionSet (0, 0, 0, 0); 1034 int Nsatpix = psImageCountPixelMask (tmpSrc->mask, allArray, PSPHOT_MASK_SATURATED); 1037 1035 1038 1036 // saturated star (size consistent with PSF or larger) … … 1648 1646 Ro = 1.0 + fabs (y->data.F32[tmpCnt] - ymodel) / sqrt(PS_SQR(ymodel - So) + PS_SQR(So)); 1649 1647 1650 // psMinimizeLMChi2 _EAMtakes wt = 1/dY^21648 // psMinimizeLMChi2 takes wt = 1/dY^2 1651 1649 if (source->weight->data.F32[i][j] == 0) { 1652 1650 yErr->data.F32[tmpCnt] = 0.0; … … 1701 1699 1702 1700 psTrace (".pmObjects.pmSourceFitModel", 5, "fitting function\n"); 1703 fitStatus = psMinimizeLMChi2_EAM(myMin, covar, params, paramMask, x, y, yErr, modelFunc); 1701 1702 fitStatus = psMinimizeLMChi2 (myMin, covar, params, paramMask, x, y, yErr, modelFunc); 1704 1703 for (int i = 0; i < dparams->n; i++) { 1705 1704 if ((paramMask != NULL) && paramMask->data.U8[i]) continue; 1706 1705 dparams->data.F32[i] = sqrt(covar->data.F64[i][i]); 1707 1706 } 1708 1709 1707 // XXX EAM: we need to do something (give an error?) if rc is false 1710 1708 // XXX EAM: psMinimizeLMChi2 does not check convergence … … 1724 1722 if (paramMask != NULL) { 1725 1723 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64); 1726 psMinimizeGaussNewtonDelta _EAM(delta, params, NULL, x, y, yErr, modelFunc);1724 psMinimizeGaussNewtonDelta (delta, params, NULL, x, y, yErr, modelFunc); 1727 1725 for (int i = 0; i < dparams->n; i++) { 1728 1726 if (!paramMask->data.U8[i]) continue; -
trunk/psphot/src/pmPSF.c
r5126 r5593 38 38 psf->params = psArrayAlloc (Nparams - 4); 39 39 for (int i = 0; i < psf->params->n; i++) { 40 // XXX EAM : make this a user-defined value? 41 // XXX EAM : future version (0.7.0?) psf->params->data[i] = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 1, 1); 40 // XXX EAM : make polynomial order user-specified? 42 41 if (1) { 43 psf->params->data[i] = Polynomial2DAlloc_EAM(PS_POLYNOMIAL_ORD, 1, 1);42 psf->params->data[i] = psPolynomial2DAlloc(1, 1, PS_POLYNOMIAL_ORD); 44 43 } else { 45 psf->params->data[i] = Polynomial2DAlloc_EAM(PS_POLYNOMIAL_ORD, 0, 0);44 psf->params->data[i] = psPolynomial2DAlloc(0, 0, PS_POLYNOMIAL_ORD); 46 45 } 47 46 } … … 93 92 94 93 // XXX EAM : this is the expected API (cycle 7? cycle 8?) 95 psf->params->data[i] = VectorClipFitPolynomial2D_EAM(psf->params->data[i], stats, mask, 0xff, z, dz, x, y);94 psf->params->data[i] = psVectorClipFitPolynomial2D (psf->params->data[i], stats, mask, 0xff, z, dz, x, y); 96 95 97 96 // XXX EAM : drop this when above is implemented... -
trunk/psphot/src/pmPSFtry.c
r5134 r5593 265 265 } 266 266 267 // linear fit to rfBin, daBin 268 psPolynomial1D *poly = Polynomial1DAlloc_EAM (PS_POLYNOMIAL_ORD, 1); 269 270 // XXX EAM : this is the intended API (cycle 7? cycle 8?) 267 // linear clipped fit to rfBin, daBin 268 psPolynomial1D *poly = psPolynomial1DAlloc (1, PS_POLYNOMIAL_ORD); 271 269 psStats *fitstat = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 272 poly = VectorClipFitPolynomial1D_EAM (poly, fitstat, maskB, 1, daBin, NULL, rfBin); 273 274 // poly = VectorFitPolynomial1D_EAM (poly, maskB, 1, daBin, NULL, rfBin); 275 276 // XXX EAM : replace this when the above version is implemented 277 // poly = VectorFitPolynomial1DOrd_EAM (poly, maskB, rfBin, daBin, NULL); 278 279 psVector *daBinFit = Polynomial1DEvalVector_EAM (poly, rfBin); 270 poly = psVectorClipFitPolynomial1D (poly, fitstat, maskB, 1, daBin, NULL, rfBin); 271 272 psVector *daBinFit = psPolynomial1DEvalVector (poly, rfBin); 280 273 psVector *daResid = (psVector *) psBinaryOp (NULL, (void *) daBin, "-", (void *) daBinFit); 281 274 … … 326 319 stats->clipIter = 3; 327 320 328 // linear fit to rfBin, daBin 329 psPolynomial1D *poly = Polynomial1DAlloc_EAM (PS_POLYNOMIAL_ORD, 1); 330 331 // XXX EAM : this is the intended API (cycle 7? cycle 8?) 332 poly = VectorClipFitPolynomial1D_EAM (poly, stats, try->mask, PSFTRY_MASK_ALL, try->metric, NULL, rflux); 333 321 // linear clipped fit to rfBin, daBin 322 psPolynomial1D *poly = psPolynomial1DAlloc (1, PS_POLYNOMIAL_ORD); 323 poly = psVectorClipFitPolynomial1D (poly, stats, try->mask, PSFTRY_MASK_ALL, try->metric, NULL, rflux); 334 324 fprintf (stderr, "fit stats: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev); 335 336 // these stats should come back from the fit above...337 // psVector *daFit = Polynomial1DEvalVector_EAM (poly, rflux);338 // psVector *daResid = (psVector *) psBinaryOp (NULL, (void *) try->metric, "-", (void *) daFit);339 340 // stats = psStatsAlloc (PS_STAT_CLIPPED_STDEV);341 // stats->clipIter = 3;342 // stats->clipSigma = 3;343 344 // stats = psVectorStats (stats, daResid, NULL, maskB, 1);345 325 346 326 try->psf->ApResid = poly->coeff[0]; -
trunk/psphot/src/pmPeaksSigmaLimit.c
r5049 r5593 16 16 17 17 psImage *smooth = psImageCopy (NULL, imdata->image, PS_TYPE_F32); 18 psImageSmooth _EAM(smooth, SIGMA, NSIGMA);18 psImageSmooth (smooth, SIGMA, NSIGMA); 19 19 psLogMsg ("psphot", 4, "smooth: %f sec\n", psTimerMark ("psphot")); 20 20 -
trunk/psphot/src/psLibUtils.c
r5351 r5593 1 1 # include <strings.h> // for strncasecmp 2 # include <unistd.h> // for write 2 3 # include <pslib.h> 3 4 # include "psLibUtils.h" 4 5 5 // XXX EAM : this is NOT included in the C99 headers ?? 6 FILE *fdopen(int fildes, const char *mode); 7 8 // XXX EAM : these utility functions should be added back into PSLib 9 10 # if (0) // now in psLib (v8) 11 static psHash *timers = NULL; 12 13 // start/restart a named timer 14 bool psTimerStart (char *name) { 15 16 psTime *start; 17 18 if (timers == NULL) timers = psHashAlloc (16); 19 20 start = psTimeGetNow (PS_TIME_UTC); 21 psHashAdd (timers, name, start); 22 psFree (start); 23 return (TRUE); 24 } 25 26 bool psTimerClear (char *name) { 27 28 bool status; 29 30 if (name == NULL) return false; 31 32 status = psHashRemove (timers, name); 33 return (status); 34 } 35 36 // get current elapsed time on named timer 37 psF64 psTimerMark (char *name) { 38 39 psTime *start; 40 psTime *mark; 41 psF64 delta; 42 43 if (timers == NULL) return (0); 44 45 start = psHashLookup (timers, name); 46 if (start == NULL) return (0); 47 48 mark = psTimeGetNow (PS_TIME_UTC); 49 delta = psTimeDelta (mark, start); 50 psFree (mark); 51 // psFree (start); -- XXX is psHashLookup not psMemCopying? 52 53 return (delta); 54 } 55 56 void psTimerFree () { 57 58 psFree (timers); 59 p_psTimeFinalize(); 60 return; 61 } 62 # endif 63 64 # if (0) 65 // find the location of the specified argument 66 int psArgumentGet (int argc, char **argv, char *arg) { 67 68 int i; 69 70 for (i = 0; i < argc; i++) { 71 if (!strcmp(argv[i], arg)) 72 return (i); 73 } 74 75 return ((int)NULL); 76 } 77 78 // remove the specified argument (by location) 79 int psArgumentRemove (int N, int *argc, char **argv) { 80 81 int i; 82 83 if ((N != (int)NULL) && (N != 0)) { 84 (*argc)--; 85 for (i = N; i < *argc; i++) { 86 argv[i] = argv[i+1]; 87 } 88 } 89 90 return (N); 91 } 92 # endif 93 6 // XXX EAM : These two functions (psLogArguments and psTraceArguments) have been 7 // rolled together into a single function in psLib 94 8 // we have log levels 1 (Error), 2 (Warning), 3 (Info), 4 (Details), 5 (Minutiae) 95 9 // 2 = default, -v = 3, -vv = 4, -vvv = 5 … … 151 65 } 152 66 153 # if (0)154 // alternate implementation of this function from pmObjects.c155 // now defined in psLib SDRS as psImageRow156 psVector *psGetRowVectorFromImage(psImage *image,157 psU32 row)158 {159 PS_ASSERT_IMAGE_NON_NULL(image, NULL);160 PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, NULL);161 162 psVector *tmpVector = psVectorAlloc(image->numCols, PS_TYPE_F32);163 memcpy (tmpVector->data.F32, image->data.F32[row], image->numCols*sizeof(psF32));164 return(tmpVector);165 }166 # endif167 168 // XXX EAM : this is now in psLib169 void psImageSmooth_EAM (psImage *image, float sigma, float Nsigma) {170 171 int Nx, Ny, Npixel, Nrange;172 float factor, g, s;173 psVector *temp;174 175 // relevant terms176 Nrange = sigma*Nsigma + 0.5;177 Npixel = 2*Nrange + 1;178 factor = -0.5/(sigma*sigma);179 180 Nx = image->numCols;181 Ny = image->numRows;182 183 // generate gaussian184 psVector *gaussnorm = psVectorAlloc (Npixel, PS_TYPE_F32);185 for (int i = -Nrange; i < Nrange + 1; i++) {186 gaussnorm->data.F32[i+Nrange] = exp (factor*i*i);187 }188 psF32 *gauss = &gaussnorm->data.F32[Nrange];189 190 // smooth in X direction191 temp = psVectorAlloc (Nx, PS_TYPE_F32);192 for (int j = 0; j < Ny; j++) {193 psF32 *vi = image->data.F32[j];194 psF32 *vo = temp->data.F32;195 for (int i = 0; i < Nx; i++) {196 g = s = 0;197 for (int n = -Nrange; n < Nrange + 1; n++) {198 if (i+n < 0) continue;199 if (i+n >= Nx) continue;200 s += gauss[n]*vi[i+n];201 g += gauss[n];202 }203 vo[i] = s / g;204 }205 memcpy (image->data.F32[j], temp->data.F32, Nx*sizeof(psF32));206 }207 psFree (temp);208 209 // smooth in Y direction210 temp = psVectorAlloc (image->numRows, PS_TYPE_F32);211 for (int i = 0; i < Nx; i++) {212 psF32 *vo = temp->data.F32;213 psF32 **vi = image->data.F32;214 for (int j = 0; j < Ny; j++) {215 g = s = 0;216 for (int n = -Nrange; n < Nrange + 1; n++) {217 if (j+n < 0) continue;218 if (j+n >= Ny) continue;219 s += gauss[n]*vi[j+n][i];220 g += gauss[n];221 }222 vo[j] = s / g;223 }224 // replace temp in image225 for (int j = 0; j < Ny; j++) {226 vi[j][i] = vo[j];227 }228 }229 psFree (temp);230 psFree (gaussnorm);231 }232 233 bool psImageInit (psImage *image,...) {234 235 va_list argp;236 psU8 vU8;237 psF32 vF32;238 psF64 vF64;239 240 if (image == NULL) return (false);241 242 va_start (argp, image);243 244 switch (image->type.type) {245 case PS_TYPE_U8:246 vU8 = va_arg (argp, psU32);247 248 for (int iy = 0; iy < image->numRows; iy++) {249 for (int ix = 0; ix < image->numCols; ix++) {250 image->data.U8[iy][ix] = vU8;251 }252 }253 break;254 255 case PS_TYPE_F32:256 vF32 = va_arg (argp, psF64);257 258 for (int iy = 0; iy < image->numRows; iy++) {259 for (int ix = 0; ix < image->numCols; ix++) {260 image->data.F32[iy][ix] = vF32;261 }262 }263 return (true);264 265 case PS_TYPE_F64:266 vF64 = va_arg (argp, psF64);267 268 for (int iy = 0; iy < image->numRows; iy++) {269 for (int ix = 0; ix < image->numCols; ix++) {270 image->data.F64[iy][ix] = vF64;271 }272 }273 return (true);274 275 default:276 psAbort ("psphot.psUtils", "datatype %d not defined in psImageInit\n", image->type);277 return (false);278 }279 return (false);280 }281 282 // now in psLib (v8)283 // count number of pixels with given mask value284 // XXX EAM : version in psLib is broken285 int psImageCountPixelMask_EAM (psImage *mask, psU8 value)286 {287 int Npixels = 0;288 289 for (int i = 0; i < mask->numRows; i++) {290 for (int j = 0; j < mask->numCols; j++) {291 if (mask->data.U8[i][j] & value) {292 Npixels ++;293 }294 }295 }296 return (Npixels);297 }298 299 // define a square region centered on the given coordinate300 // XXX EAM : this is now in psLib301 # if (0)302 psRegion *psRegionSquare (psF32 x, psF32 y, psF32 radius) {303 psRegion *region;304 region = psRegionAlloc (x - radius, x + radius + 1,305 y - radius, y + radius + 1);306 return (region);307 }308 # endif309 310 // set actual region based on image parameters:311 // compensate for negative upper limits312 // XXX this is inconsistent: the coordindates should always be in the parent313 // frame, which means the negative values should subtract from Nx,Ny of314 // the parent, not the child. but, we don't carry the dimensions of the315 // parent in the psImage container. for now, use the child Nx,Ny316 // force range to be on this subimage317 // XXX EAM : this needs to be changed to use psRegion rather than psRegion*318 // XXX EAM : this is now in psLib319 # if (0)320 psRegion *psRegionForImage (psRegion *out, psImage *image, psRegion *in) {321 322 // x0,y0, x1,y1 are in *parent* units323 324 if (out == NULL) {325 out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1);326 } else {327 *out = *in;328 }329 // XXX these are probably wrong (see above)330 if (out->x1 <= 0) {331 out->x1 = image->col0 + image->numCols + out->x1;332 }333 if (out->y1 <= 0) {334 out->y1 = image->row0 + image->numRows + out->y1;335 }336 337 // force the lower-limits to be on the child338 out->x0 = PS_MAX(image->col0, out->x0);339 out->y0 = PS_MAX(image->row0, out->y0);340 341 // force the upper-limits to be on the child342 out->x1 = PS_MIN(image->col0 + image->numCols, out->x1);343 out->y1 = PS_MIN(image->row0 + image->numRows, out->y1);344 return (out);345 }346 # endif347 348 // mask the area contained by the region349 // the region is defined wrt the parent image350 // XXX EAM : this is now in psLib351 # if (0)352 void psImageMaskRegion (psImage *image, psRegion *region, bool logical_and, int maskValue) {353 354 for (int iy = 0; iy < image->numRows; iy++) {355 for (int ix = 0; ix < image->numCols; ix++) {356 if (ix + image->col0 < region->x0) continue;357 if (ix + image->col0 >= region->x1) continue;358 if (iy + image->row0 < region->y0) continue;359 if (iy + image->row0 >= region->y1) continue;360 if (logical_and) {361 image->data.U8[iy][ix] &= maskValue;362 } else {363 image->data.U8[iy][ix] |= maskValue;364 }365 }366 }367 }368 # endif369 370 // mask the area not contained by the region371 // the region is defined wrt the parent image372 // XXX EAM : this is now in psLib373 # if (0)374 void psImageKeepRegion (psImage *image, psRegion *region, bool logical_and, int maskValue) {375 376 for (int iy = 0; iy < image->numRows; iy++) {377 for (int ix = 0; ix < image->numCols; ix++) {378 if (ix + image->col0 < region->x0) goto maskit;379 if (ix + image->col0 >= region->x1) goto maskit;380 if (iy + image->row0 < region->y0) goto maskit;381 if (iy + image->row0 >= region->y1) goto maskit;382 continue;383 maskit:384 if (logical_and) {385 image->data.U8[iy][ix] &= maskValue;386 } else {387 image->data.U8[iy][ix] |= maskValue;388 }389 }390 }391 }392 # endif393 394 // mask the area contained by the region395 // the region is defined wrt the parent image396 // XXX EAM : this is now in psLib397 # if (0)398 void psImageMaskCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue) {399 400 double dx, dy, r2, R2;401 402 R2 = PS_SQR(radius);403 404 for (int iy = 0; iy < image->numRows; iy++) {405 for (int ix = 0; ix < image->numCols; ix++) {406 dx = ix + image->col0 - x;407 dy = iy + image->row0 - y;408 r2 = PS_SQR(dx) + PS_SQR(dy);409 if (r2 > R2) continue;410 if (logical_and) {411 image->data.U8[iy][ix] &= maskValue;412 } else {413 image->data.U8[iy][ix] |= maskValue;414 }415 }416 }417 }418 # endif419 420 // mask the area contained by the region421 // the region is defined wrt the parent image422 // XXX EAM : this is now in psLib423 # if (0)424 void psImageKeepCircle (psImage *image, double x, double y, double radius, bool logical_and, int maskValue) {425 426 double dx, dy, r2, R2;427 428 R2 = PS_SQR(radius);429 430 for (int iy = 0; iy < image->numRows; iy++) {431 for (int ix = 0; ix < image->numCols; ix++) {432 dx = ix + image->col0 - x;433 dy = iy + image->row0 - y;434 r2 = PS_SQR(dx) + PS_SQR(dy);435 if (r2 < R2) continue;436 if (logical_and) {437 image->data.U8[iy][ix] &= maskValue;438 } else {439 image->data.U8[iy][ix] |= maskValue;440 }441 }442 }443 }444 # endif445 446 # if (0)447 psVector *psVectorCreate (double lower, double upper, double delta, psElemType type) {448 449 int nBin = (upper - lower) / delta;450 451 psVector *out = psVectorAlloc (nBin, type);452 453 for (int i = 0; i < nBin; i++) {454 out->data.F64[i] = lower + i * delta;455 }456 457 return (out);458 }459 # endif460 461 67 // XXX EAM a utility function 462 68 bool p_psVectorPrintRow (int fd, psVector *a, char *name) 463 69 { 464 70 465 FILE *f; 466 f = fdopen(fd, "a+"); 467 fprintf (f, "vector: %s\n", name); 71 char line[1024]; 72 73 sprintf (line, "vector: %s\n", name); 74 write (fd, line, strlen(line)); 468 75 469 76 for (int i = 0; i < a[0].n; i++) { 470 fprintf (f, "%f ", p_psVectorGetElementF64(a, i)); 77 sprintf (line, "%f ", p_psVectorGetElementF64(a, i)); 78 write (fd, line, strlen(line)); 471 79 } 472 fprintf (f, "\n"); 473 fclose(f); 80 write (fd, "\n", 1); 474 81 return (true); 475 82 } 476 // XXX EAM is the use of fdopen here a good way to do this? -
trunk/psphot/src/psphotFitGalaxies.c
r5058 r5593 75 75 // fit FLT (not PSF) model (set/unset the pixel mask) 76 76 psImageKeepCircle (source->mask, x, y, model->radius, "OR", PSPHOT_MASK_MARKED); 77 // XXX EAM : 0.5.0 code used _EAM version78 // status = pmSourceFitModel (source, model, false);79 77 status = pmSourceFitModel (source, model, false); 80 78 psImageKeepCircle (source->mask, x, y, model->radius, "AND", ~PSPHOT_MASK_MARKED);
Note:
See TracChangeset
for help on using the changeset viewer.
