Changeset 9730 for trunk/psModules/src/objects
- Timestamp:
- Oct 24, 2006, 12:55:05 PM (20 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 14 edited
-
models/pmModel_GAUSS.c (modified) (1 diff)
-
models/pmModel_PGAUSS.c (modified) (1 diff)
-
models/pmModel_QGAUSS.c (modified) (1 diff)
-
models/pmModel_SGAUSS.c (modified) (1 diff)
-
pmGrowthCurve.c (modified) (2 diffs)
-
pmModel.c (modified) (4 diffs)
-
pmPSF.c (modified) (4 diffs)
-
pmPSFtry.c (modified) (4 diffs)
-
pmPeaks.c (modified) (6 diffs)
-
pmSource.c (modified) (3 diffs)
-
pmSourceContour.c (modified) (6 diffs)
-
pmSourceFitModel.c (modified) (11 diffs)
-
pmSourceIO_CMF.c (modified) (3 diffs)
-
pmSourcePhotometry.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/models/pmModel_GAUSS.c
r9675 r9730 45 45 *params_min = psVectorAlloc (7, PS_TYPE_F32); 46 46 *params_max = psVectorAlloc (7, PS_TYPE_F32); 47 (*beta_lim)->n = (*beta_lim)->nalloc;48 (*params_min)->n = (*params_min)->nalloc;49 (*params_max)->n = (*params_max)->nalloc;50 47 51 48 beta_lim[0][0].data.F32[PM_PAR_SKY] = 1000; -
trunk/psModules/src/objects/models/pmModel_PGAUSS.c
r9621 r9730 48 48 *params_min = psVectorAlloc (7, PS_TYPE_F32); 49 49 *params_max = psVectorAlloc (7, PS_TYPE_F32); 50 (*beta_lim)->n = (*beta_lim)->nalloc;51 (*params_min)->n = (*params_min)->nalloc;52 (*params_max)->n = (*params_max)->nalloc;53 50 54 51 beta_lim[0][0].data.F32[0] = 1000; -
trunk/psModules/src/objects/models/pmModel_QGAUSS.c
r9676 r9730 63 63 *params_min = psVectorAlloc (8, PS_TYPE_F32); 64 64 *params_max = psVectorAlloc (8, PS_TYPE_F32); 65 (*beta_lim)->n = (*beta_lim)->nalloc;66 (*params_min)->n = (*params_min)->nalloc;67 (*params_max)->n = (*params_max)->nalloc;68 65 69 66 beta_lim[0][0].data.F32[PM_PAR_SKY] = 1000; -
trunk/psModules/src/objects/models/pmModel_SGAUSS.c
r9621 r9730 67 67 *params_min = psVectorAlloc (9, PS_TYPE_F32); 68 68 *params_max = psVectorAlloc (9, PS_TYPE_F32); 69 (*beta_lim)->n = (*beta_lim)->nalloc;70 (*params_min)->n = (*params_min)->nalloc;71 (*params_max)->n = (*params_max)->nalloc;72 69 73 70 beta_lim[0][0].data.F32[0] = 1000; -
trunk/psModules/src/objects/pmGrowthCurve.c
r8886 r9730 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2006- 09-22 21:35:34$7 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-10-24 22:55:05 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 growth->radius = psVectorCreate (NULL, minRadius, maxRadius, 1.0, PS_TYPE_F32); 41 41 growth->apMag = psVectorAlloc (growth->radius->n, PS_TYPE_F32); 42 growth->apMag->n = growth->radius->n;43 42 44 43 // XXX may want to extend this to allow for a different refRadius; -
trunk/psModules/src/objects/pmModel.c
r9559 r9730 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-10- 14 00:53:23$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 66 66 tmp->params = psVectorAlloc(Nparams, PS_TYPE_F32); 67 67 tmp->dparams = psVectorAlloc(Nparams, PS_TYPE_F32); 68 tmp->params->n = tmp->dparams->n = Nparams;69 68 70 69 for (psS32 i = 0; i < tmp->params->n; i++) { … … 117 116 x->data.F32[0] = (psF32) (col + image->col0); 118 117 x->data.F32[1] = (psF32) (row + image->row0); 119 x->n = 2;120 118 psF32 tmpF; 121 119 pmModelFunc modelFunc; … … 143 141 144 142 psVector *x = psVectorAlloc(2, PS_TYPE_F32); 145 x->n = 2;146 143 psVector *params = model->params; 147 144 pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type); -
trunk/psModules/src/objects/pmPSF.c
r9562 r9730 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-10- 14 00:55:43$8 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 121 121 122 122 psf->params = psArrayAlloc(Nparams - 4); 123 psf->params->n = psf->params->nalloc;124 123 125 124 // the order of the PSF parameter (X,Y) fits is determined by the … … 166 165 psVector *z = psVectorAlloc (models->n, PS_TYPE_F64); 167 166 psVector *dz = psVectorAlloc (models->n, PS_TYPE_F64); 168 x->n = x->nalloc;169 y->n = y->nalloc;170 z->n = z->nalloc;171 dz->n = dz->nalloc;172 167 173 168 for (int i = 0; i < models->n; i++) { … … 258 253 259 254 /*********************************************** 260 * this function masks the psf.ApTrend polynomial 255 * this function masks the psf.ApTrend polynomial 261 256 * to enable the specific subset of the coefficients 262 257 **********************************************/ -
trunk/psModules/src/objects/pmPSFtry.c
r9594 r9730 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-10- 17 02:21:03$7 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-10-24 22:55:05 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 71 71 test->fitMag = psVectorAlloc (sources->n, PS_TYPE_F64); 72 72 test->mask = psVectorAlloc (sources->n, PS_TYPE_U8); 73 test->metric->n = test->fitMag->n = test->mask->n = sources->n;74 test->modelEXT->n = test->modelPSF->n = sources->n;75 73 76 74 for (int i = 0; i < test->modelEXT->n; i++) { … … 196 194 psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 197 195 psVector *mask = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK); 198 flux->n = mask->n = chisq->n = psfTry->sources->n;199 196 200 197 // write sources with models first … … 256 253 // r2rflux = radius^2 * ten(0.4*fitMag); 257 254 psVector *r2rflux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 258 r2rflux->n = psfTry->sources->n;259 255 260 256 for (int i = 0; i < psfTry->sources->n; i++) { -
trunk/psModules/src/objects/pmPeaks.c
r8815 r9730 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 2006- 09-15 09:49:01$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 41 41 if (list == NULL) { 42 list = psArrayAlloc(100); 43 list->n = 0; 42 list = psArrayAllocEmpty(100); 44 43 } 45 44 psArrayAdd(list, 100, tmpPeak); … … 69 68 tmpVector->data.F32[col] = image->data.F32[row][col]; 70 69 } 71 tmpVector->n = image->numCols;72 70 psTrace("psModules.objects", 4, "---- %s() end ----\n", __func__); 73 71 return(tmpVector); … … 194 192 if (n == 1) { 195 193 psVector *tmpVector = NULL; 196 ;197 194 if (vector->data.F32[0] > threshold) { 198 195 tmpVector = psVectorAlloc(1, PS_TYPE_U32); 199 196 tmpVector->data.U32[0] = 0; 200 tmpVector->n = 1;201 197 } else { 202 198 tmpVector = psVectorAlloc(0, PS_TYPE_U32); … … 238 234 // 239 235 psVector *tmpVector = psVectorAlloc(count, PS_TYPE_U32); 240 tmpVector->n = count;241 236 count = 0; 242 237 … … 544 539 PS_ASSERT_PTR_NON_NULL(peaks, NULL); 545 540 546 psArray *output = psArrayAlloc (200); 547 output->n = 0; 541 psArray *output = psArrayAllocEmpty (200); 548 542 549 543 psTrace (".pmObjects.pmCullPeaks", 3, "list size is %ld\n", peaks->n); -
trunk/psModules/src/objects/pmSource.c
r9651 r9730 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-10- 19 21:10:08$8 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 294 294 maxSy = clump->y * SCALE + 0.2; 295 295 296 tmpSx = psVectorAlloc (sources->n, PS_TYPE_F32); 297 tmpSy = psVectorAlloc (sources->n, PS_TYPE_F32); 298 tmpSx->n = 0; 299 tmpSy->n = 0; 296 tmpSx = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 297 tmpSy = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 300 298 301 299 // XXX clip sources based on flux? … … 375 373 376 374 // report stats on S/N values for star-like objects 377 psVector *starsn = psVectorAlloc (sources->n, PS_TYPE_F32); 378 starsn->n = 0; 375 psVector *starsn = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 379 376 380 377 // check return status value (do these exist?) -
trunk/psModules/src/objects/pmSourceContour.c
r8815 r9730 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2006- 09-15 09:49:01$8 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 240 240 241 241 // Allocate data for x/y pairs. 242 psVector *xVec = psVectorAlloc (100, PS_TYPE_F32);243 psVector *yVec = psVectorAlloc (100, PS_TYPE_F32);242 psVector *xVec = psVectorAllocEmpty(100, PS_TYPE_F32); 243 psVector *yVec = psVectorAllocEmpty(100, PS_TYPE_F32); 244 244 245 245 // First row: find the left and right end-points … … 327 327 // fprintf (stderr, "done\n"); 328 328 psArray *tmpArray = psArrayAlloc(2); 329 tmpArray->n = 2;330 329 331 330 tmpArray->data[0] = (psPtr *) xVec; … … 338 337 pmSourceContour(src, img, level, mode): For an input subImage, and model, this 339 338 routine returns a psArray of coordinates that evaluate to the specified level. 340 339 341 340 XXX: Probably should remove the "image" argument. 342 341 XXX: What type should the output coordinate vectors consist of? col,row? … … 366 365 psVector *xVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32); 367 366 psVector *yVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32); 368 xVec->n = yVec->n = 2 * source->pixels->numRows;369 367 370 368 // … … 447 445 // 448 446 psArray *tmpArray = psArrayAlloc(2); 449 tmpArray->n = 2;450 447 451 448 tmpArray->data[0] = (psPtr *) yVec; -
trunk/psModules/src/objects/pmSourceFitModel.c
r9541 r9730 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-10- 13 22:11:02$8 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 78 78 79 79 // construct the coordinate and value entries 80 psArray *x = psArrayAlloc (nPix);81 psVector *y = psVectorAlloc (nPix, PS_TYPE_F32);82 psVector *yErr = psVectorAlloc (nPix, PS_TYPE_F32);80 psArray *x = psArrayAllocEmpty(nPix); 81 psVector *y = psVectorAllocEmpty(nPix, PS_TYPE_F32); 82 psVector *yErr = psVectorAllocEmpty(nPix, PS_TYPE_F32); 83 83 84 84 nPix = 0; … … 95 95 96 96 psVector *coord = psVectorAlloc(2, PS_TYPE_F32); 97 coord->n = 2;98 97 99 98 // Convert i/j to image space: … … 128 127 // set parameter mask based on fitting mode 129 128 paramMask = psVectorAlloc (params->n, PS_TYPE_U8); 130 paramMask->n = params->n;131 129 psVectorInit (paramMask, 1); 132 130 … … 208 206 if (paramMask != NULL) { 209 207 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64); 210 delta->n = params->n;211 208 psMinimizeGaussNewtonDelta(delta, params, NULL, x, y, yErr, modelFunc); 212 209 for (int i = 0; i < dparams->n; i++) { … … 272 269 onePar = psVectorAlloc (nPar, PS_DATA_F32); 273 270 oneDeriv = psVectorAlloc (nPar, PS_DATA_F32); 274 onePar->n = oneDeriv->n = nPar;275 271 276 272 return true; … … 357 353 psVector *params = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_F32); 358 354 psVector *dparams = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_F32); 359 params->n = params->nalloc;360 dparams->n = dparams->nalloc;361 355 362 356 pmModelLimits modelLimits = pmModelLimits_GetFunction (model->type); … … 373 367 constrain->paramMask = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_U8); 374 368 constrain->paramDelta = psVectorAlloc (nSrc*nPar + 1, PS_TYPE_F32); 375 constrain->paramMin->n = constrain->paramMin->nalloc;376 constrain->paramMax->n = constrain->paramMax->nalloc;377 constrain->paramMask->n = constrain->paramMask->nalloc;378 constrain->paramDelta->n = constrain->paramDelta->nalloc;379 369 380 370 // set the parameter guesses and constraints for the multiple models … … 459 449 460 450 // construct the coordinate and value entries 461 psArray *x = psArrayAlloc (nPix);462 psVector *y = psVectorAlloc (nPix, PS_TYPE_F32);463 psVector *yErr = psVectorAlloc (nPix, PS_TYPE_F32);451 psArray *x = psArrayAllocEmpty(nPix); 452 psVector *y = psVectorAllocEmpty(nPix, PS_TYPE_F32); 453 psVector *yErr = psVectorAllocEmpty(nPix, PS_TYPE_F32); 464 454 465 455 nPix = 0; … … 475 465 } 476 466 psVector *coord = psVectorAlloc(2, PS_TYPE_F32); 477 coord->n = 2;478 467 479 468 // Convert i/j to image space: … … 534 523 if (constrain->paramMask != NULL) { 535 524 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64); 536 delta->n = params->n;537 525 psMinimizeGaussNewtonDelta(delta, params, NULL, x, y, yErr, pmModelFitSet); 538 526 for (int i = 0; i < dparams->n; i++) { -
trunk/psModules/src/objects/pmSourceIO_CMF.c
r9653 r9730 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-10- 19 21:16:49$5 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-10-24 22:55:05 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT"); 51 51 52 table = psArrayAlloc (sources->n); 53 table->n = 0; 52 table = psArrayAllocEmpty (sources->n); 54 53 55 54 for (i = 0; i < sources->n; i++) { … … 130 129 131 130 psArray *sources = psArrayAlloc (table->n); 132 sources->n = table->n;133 131 134 132 // convert the table to the pmSource entries -
trunk/psModules/src/objects/pmSourcePhotometry.c
r9594 r9730 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-10- 17 02:21:03$5 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-10-24 22:55:05 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 241 241 pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type); 242 242 psVector *coord = psVectorAlloc(2, PS_TYPE_F32); 243 coord->n = 2;244 243 245 244 psVector *params = model->params;
Note:
See TracChangeset
for help on using the changeset viewer.
