Changeset 9730 for trunk/psModules
- Timestamp:
- Oct 24, 2006, 12:55:05 PM (20 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 29 edited
-
astrom/pmAstrometryDistortion.c (modified) (5 diffs)
-
astrom/pmAstrometryObjects.c (modified) (11 diffs)
-
camera/pmFPAConstruct.c (modified) (1 diff)
-
camera/pmFPAMaskWeight.c (modified) (2 diffs)
-
camera/pmHDUGenerate.c (modified) (1 diff)
-
concepts/pmConceptsWrite.c (modified) (1 diff)
-
config/pmConfig.c (modified) (2 diffs)
-
detrend/pmFlatNormalize.c (modified) (4 diffs)
-
detrend/pmFringeStats.c (modified) (8 diffs)
-
detrend/pmShutterCorrection.c (modified) (6 diffs)
-
detrend/pmSubtractBias.c (modified) (3 diffs)
-
detrend/pmSubtractSky.c (modified) (3 diffs)
-
imcombine/pmImageCombine.c (modified) (8 diffs)
-
imcombine/pmImageSubtract.c (modified) (9 diffs)
-
imcombine/pmReadoutCombine.c (modified) (2 diffs)
-
objects/models/pmModel_GAUSS.c (modified) (1 diff)
-
objects/models/pmModel_PGAUSS.c (modified) (1 diff)
-
objects/models/pmModel_QGAUSS.c (modified) (1 diff)
-
objects/models/pmModel_SGAUSS.c (modified) (1 diff)
-
objects/pmGrowthCurve.c (modified) (2 diffs)
-
objects/pmModel.c (modified) (4 diffs)
-
objects/pmPSF.c (modified) (4 diffs)
-
objects/pmPSFtry.c (modified) (4 diffs)
-
objects/pmPeaks.c (modified) (6 diffs)
-
objects/pmSource.c (modified) (3 diffs)
-
objects/pmSourceContour.c (modified) (6 diffs)
-
objects/pmSourceFitModel.c (modified) (11 diffs)
-
objects/pmSourceIO_CMF.c (modified) (3 diffs)
-
objects/pmSourcePhotometry.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryDistortion.c
r8815 r9730 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2006- 09-15 09:49:01$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-10-24 22:55:04 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 54 54 55 55 if (grads == NULL) { 56 grads = psArrayAlloc (100);56 grads = psArrayAllocEmpty (100); 57 57 } 58 58 … … 76 76 int Ymax = Ymin + DY; 77 77 78 psVector *L = psVectorAlloc (100, PS_TYPE_F32);79 psVector *M = psVectorAlloc (100, PS_TYPE_F32);80 psVector *dP = psVectorAlloc (100, PS_TYPE_F32);81 psVector *dQ = psVectorAlloc (100, PS_TYPE_F32);78 psVector *L = psVectorAllocEmpty (100, PS_TYPE_F32); 79 psVector *M = psVectorAllocEmpty (100, PS_TYPE_F32); 80 psVector *dP = psVectorAllocEmpty (100, PS_TYPE_F32); 81 psVector *dQ = psVectorAllocEmpty (100, PS_TYPE_F32); 82 82 int Npts = 0; 83 83 … … 121 121 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 122 122 psVector *mask = psVectorAlloc (Npts, PS_TYPE_MASK); 123 mask->n = Npts;124 123 psVectorInit (mask, 0); 125 124 … … 175 174 M->data.F32[i] = grad->FP.y; 176 175 } 177 dPdL->n = dQdL->n = dPdM->n = dQdM->n = grads->n;178 L->n = M->n = grads->n;179 176 180 177 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 181 178 psVector *mask = psVectorAlloc (grads->n, PS_TYPE_MASK); 182 mask->n = grads->n;183 179 psVectorInit (mask, 0); 184 180 -
trunk/psModules/src/astrom/pmAstrometryObjects.c
r9639 r9730 8 8 * @author EAM, IfA 9 9 * 10 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-10- 19 02:56:40$10 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-10-24 22:55:04 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 76 76 const double RADIUS) // matching radius 77 77 { 78 psArray *matches = psArrayAlloc(x1->n); 79 matches->n = 0; 78 psArray *matches = psArrayAllocEmpty(x1->n); 80 79 81 80 const double RADIUS_SQR = PS_SQR(RADIUS); … … 144 143 /* sort both lists by X coord; st1 first */ \ 145 144 psVector *x1 = psVectorAlloc(st1->n, PS_TYPE_F64); \ 146 \147 x1->n = x1->nalloc; \148 145 for (int i = 0; i < st1->n; i++) { \ 149 146 x1->data.F64[i] = ((pmAstromObj *)st1->data[i])->MEMBER->x; \ … … 153 150 \ 154 151 psVector *y1 = psVectorAlloc(st1->n, PS_TYPE_F64); \ 155 y1->n = y1->nalloc; \156 152 for (int i = 0; i < st1->n; i++) { \ 157 153 x1->data.F64[i] = ((pmAstromObj *)st1->data[sorted1->data.S32[i]])->MEMBER->x; \ … … 161 157 /* now st2 */ \ 162 158 psVector *x2 = psVectorAlloc(st2->n, PS_TYPE_F64); \ 163 x2->n = x2->nalloc; \164 159 for (int i = 0; i < st2->n; i++) { \ 165 160 x2->data.F64[i] = ((pmAstromObj *)st2->data[i])->MEMBER->x; \ … … 168 163 \ 169 164 psVector *y2 = psVectorAlloc(st2->n, PS_TYPE_F64); \ 170 y2->n = y2->nalloc; \171 165 for (int i = 0; i < st2->n; i++) { \ 172 166 x2->data.F64[i] = ((pmAstromObj *)st2->data[sorted2->data.S32[i]])->MEMBER->x; \ … … 236 230 psVector *y = psVectorAlloc (match->n, PS_TYPE_F32); 237 231 psVector *wt = psVectorAlloc (match->n, PS_TYPE_F32); 238 X->n = X->nalloc;239 Y->n = Y->nalloc;240 x->n = x->nalloc;241 y->n = y->nalloc;242 wt->n = wt->nalloc;243 232 // take the matched stars, first fit 244 233 for (int i = 0; i < match->n; i++) { … … 259 248 // constant errors 260 249 psVector *mask = psVectorAlloc (match->n, PS_TYPE_U8); 261 mask->n = match->n;262 250 psVectorInit (mask, 0); 263 251 … … 352 340 353 341 psArray *new = psArrayAlloc (old->n); 354 new->n = new->nalloc;355 342 double cs = cos(angle); 356 343 double sn = sin(angle); … … 659 646 // sort the NP values and choose 660 647 psVector *listNP = psVectorAlloc (nPix*nPix, PS_TYPE_U32); 661 listNP->n = nPix*nPix;662 648 int n = 0; 663 649 for (int i = 0; i < nPix; i++) { … … 780 766 psVector *xHist = psVectorAlloc (nBin, PS_TYPE_F32); 781 767 psVector *yHist = psVectorAlloc (nBin, PS_TYPE_F32); 782 xHist->n = yHist->n = nBin;783 768 psVectorInit (xHist, 0); 784 769 psVectorInit (yHist, 0); -
trunk/psModules/src/camera/pmFPAConstruct.c
r9701 r9730 61 61 *second = psArrayAlloc(values->n); 62 62 *third = psArrayAlloc(values->n); 63 (*first)->n = (*second)->n = (*third)->n = values->n;64 63 int num = 0; 65 64 psListIterator *valuesIter = psListIteratorAlloc(values, PS_LIST_HEAD, false); // Iterator for values -
trunk/psModules/src/camera/pmFPAMaskWeight.c
r9594 r9730 29 29 if (!masks) { 30 30 masks = psArrayAlloc(images->n); 31 masks->n = images->n;32 31 hdu->masks = masks; 33 32 } … … 56 55 if (!weights) { 57 56 weights = psArrayAlloc(images->n); 58 weights->n = images->n;59 57 hdu->weights = weights; 60 58 } -
trunk/psModules/src/camera/pmHDUGenerate.c
r9603 r9730 294 294 // Generate the HDU 295 295 hdu->images = psArrayAlloc(numReadouts); 296 hdu->images->n = numReadouts;297 296 for (int i = 0; i < numReadouts; i++) { 298 297 psImage *image = psImageAlloc(xSize, ySize, type); -
trunk/psModules/src/concepts/pmConceptsWrite.c
r9572 r9730 51 51 } 52 52 psVector *match = psVectorAlloc(cList->n, PS_TYPE_U8); // Array indicating which values match 53 match->n = cList->n;54 53 psVectorInit(match, 0); 55 54 psListIterator *cIter = psListIteratorAlloc(cList, PS_LIST_HEAD, false); // compare iterator -
trunk/psModules/src/config/pmConfig.c
r9591 r9730 4 4 * @author EAM (IfA) 5 5 * 6 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-10- 17 01:25:22$6 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-10-24 22:55:05 $ 8 8 * 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 883 883 884 884 // we load all input files onto a psArray, to be parsed later 885 psArray *input = psArrayAlloc (16); 886 input->n = 0; 885 psArray *input = psArrayAllocEmpty(16); 887 886 888 887 // load the list of filenames the supplied file -
trunk/psModules/src/detrend/pmFlatNormalize.c
r9614 r9730 32 32 } else { 33 33 *expFluxesPtr = psVectorAlloc(numExps, PS_TYPE_F32); 34 (*expFluxesPtr)->n = numExps;35 34 } 36 35 expFluxes = psMemIncrRefCounter(*expFluxesPtr); 37 36 } else { 38 37 expFluxes = psVectorAlloc(numExps, PS_TYPE_F32); 39 expFluxes->n = numExps;40 38 } 41 39 … … 47 45 } else { 48 46 *chipGainsPtr = psVectorAlloc(numChips, PS_TYPE_F32); 49 (*chipGainsPtr)->n = numChips;50 47 psVectorInit(*chipGainsPtr, 1.0); 51 48 } … … 53 50 } else { 54 51 chipGains = psVectorAlloc(numChips, PS_TYPE_F32); 55 chipGains->n = numChips;56 52 psVectorInit(chipGains, 1.0); 57 53 } … … 62 58 psImageInit(fluxMask, 0); 63 59 psVector *gainMask = psVectorAlloc(numChips, PS_TYPE_U8); // Mask for bad gains 64 gainMask->n = numChips;65 60 psVectorInit(gainMask, 0); 66 61 psVector *expMask = psVectorAlloc(numExps, PS_TYPE_U8); // Mask for bad exposures 67 expMask->n = numExps;68 62 psVectorInit(expMask, 0); 69 63 for (int i = 0; i < numChips; i++) { -
trunk/psModules/src/detrend/pmFringeStats.c
r9615 r9730 133 133 134 134 psArray *table = psArrayAlloc(numRows); // The table 135 table->n = numRows;136 135 // Translate the vectors into the required format for psFitsWriteTable() 137 136 for (long i = 0; i < numRows; i++) { … … 205 204 psVector *y = psVectorAlloc(numRows, PS_TYPE_F32); // y position 206 205 psVector *mask = psVectorAlloc(numRows, PS_TYPE_U8); // mask 207 x->n = y->n = mask->n = numRows;208 206 regions->x = x; 209 207 regions->y = y; … … 253 251 stats->f = psVectorAlloc(numRegions, PS_TYPE_F32); 254 252 stats->df = psVectorAlloc(numRegions, PS_TYPE_F32); 255 stats->f->n = stats->df->n = numRegions;256 253 257 254 return stats; … … 365 362 // Vectors: f, df 366 363 psArray *table = psArrayAlloc(numRows); // The table 367 table->n = numRows;368 364 // Translate the vectors into the required format for psFitsWriteTable() 369 365 for (long i = 0; i < numRows; i++) { … … 527 523 scale->coeff = psVectorAlloc(nFringeFrames + 1, PS_TYPE_F32); 528 524 scale->coeffErr = psVectorAlloc(nFringeFrames + 1, PS_TYPE_F32); 529 scale->coeff->n = nFringeFrames + 1;530 scale->coeff->n = nFringeFrames + 1;531 525 532 526 return scale; … … 551 545 psImage *A = psImageAlloc(numCoeffs, numCoeffs, PS_TYPE_F64); // The least-squares matrix 552 546 psVector *B = psVectorAlloc(numCoeffs, PS_TYPE_F64); // The least-squares vector 553 B->n = numCoeffs;554 547 555 548 // Generate the least-squares matrix and vector … … 718 711 if (!regions->mask) { 719 712 regions->mask = psVectorAlloc(numRegions, PS_TYPE_U8); 720 regions->mask->n = numRegions;721 713 psVectorInit(regions->mask, 0); 722 714 } … … 725 717 unsigned int numClipped = 0; // Total number clipped 726 718 psVector *diff = psVectorAlloc(numRegions, PS_TYPE_F32); // The differences between obs. and pred. 727 diff->n = numRegions;728 719 729 720 pmFringeScale *scale = pmFringeScaleAlloc(fringes->n); // The fringe scales -
trunk/psModules/src/detrend/pmShutterCorrection.c
r9618 r9730 104 104 psVector *tmpX = psVectorAlloc(2, PS_TYPE_F32); 105 105 psVector *tmpY = psVectorAlloc(2, PS_TYPE_F32); 106 tmpX->n = tmpY->n = 2;107 106 108 107 long index; … … 210 209 psVector *x = psVectorAlloc(exptime->n, PS_TYPE_F32); 211 210 psVector *y = psVectorAlloc(exptime->n, PS_TYPE_F32); 212 x->n = y->n = exptime->n;213 211 214 212 for (long i = 0; i < exptime->n; i++) { … … 301 299 params->data.F32[1] = guess->offset; 302 300 params->data.F32[2] = guess->offref; 303 params->n = 3;304 301 305 302 // XXX for the moment, don't set any constraints … … 317 314 // construct the coordinate and value entries (y is counts) 318 315 psArray *x = psArrayAlloc(exptime->n); // Coordinates 319 x->n = exptime->n;320 316 321 317 for (long i = 0; i < exptime->n; i++) { 322 318 psVector *coord = psVectorAlloc(1, PS_TYPE_F32); 323 coord->n = 1;324 319 coord->data.F32[0] = exptime->data.F32[i]; 325 320 x->data[i] = coord; … … 371 366 psRegion refRegion; // Reference region 372 367 psVector *refs = psVectorAlloc(num, PS_TYPE_F32); // Reference measurements 373 refs->n = num;374 368 psVectorInit(refs, 0); 375 369 psArray *regions = psArrayAlloc(MEASURE_SAMPLES); // Array of sample regions, made on each image 376 regions->n = MEASURE_SAMPLES;377 370 psImage *samplesMean = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Measurements for each file 378 371 psImage *samplesStdev = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Errors for each file … … 505 498 psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern 506 499 psVector *mask = psVectorAlloc(num, PS_TYPE_U8); // Mask for each image 507 mask->n = num;508 500 psVectorInit(mask, 0); 509 501 psTrace("psModules.detrend", 2, "Performing linear fit on individual pixels...\n"); -
trunk/psModules/src/detrend/pmSubtractBias.c
r9619 r9730 129 129 psVector *ordinate = psVectorAlloc(pixels->n, PS_TYPE_F32); // Ordinate 130 130 psVector *mask = psVectorAlloc(pixels->n, PS_TYPE_U8); // Mask for fitting 131 reduced->n = ordinate->n = mask->n = pixels->n;132 131 133 132 for (int i = 0; i < pixels->n; i++) { … … 268 267 // The read direction is rows 269 268 psArray *pixels = psArrayAlloc(image->numRows); // Array of vectors containing pixels 270 pixels->n = image->numRows;271 269 for (int i = 0; i < pixels->n; i++) { 272 270 psVector *values = psVectorAlloc(0, PS_TYPE_F32); … … 312 310 // The read direction is columns 313 311 psArray *pixels = psArrayAlloc(image->numCols); // Array of vectors containing pixels 314 pixels->n = image->numCols;315 312 for (int i = 0; i < pixels->n; i++) { 316 313 psVector *values = psVectorAlloc(0, PS_TYPE_F32); -
trunk/psModules/src/detrend/pmSubtractSky.c
r9541 r9730 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-10- 13 22:11:02$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 … … 345 345 psImage *Aout = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64); 346 346 psVector *B = psVectorAlloc(localPolyTerms, PS_TYPE_F64); 347 B->n = B->nalloc;348 347 psVector *outPerm = NULL; 349 348 … … 412 411 PS_ASSERT_IMAGE_NON_EMPTY(Aout, NULL); 413 412 psVector *C = psVectorAlloc(localPolyTerms, PS_TYPE_F64); 414 C->n = C->nalloc;415 413 psMatrixLUSolve(C, Aout, B, outPerm); 416 414 -
trunk/psModules/src/imcombine/pmImageCombine.c
r8815 r9730 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $11 * @date $Date: 2006- 09-15 09:49:01$10 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-10-24 22:55:05 $ 12 12 * 13 13 * XXX: pmRejectPixels() has a known bug with the pmImageTransform() call. … … 122 122 if (*questionablePixels == NULL) { 123 123 *questionablePixels = psArrayAlloc(numImages); 124 (*questionablePixels)->n = numImages;125 124 } else if ((*questionablePixels)->n != numImages) { 126 125 *questionablePixels = psArrayRealloc(*questionablePixels, numImages); … … 137 136 psVector *qpPtr = psVectorAlloc(numImages, PS_TYPE_S32); 138 137 psVectorInit(qpPtr, 0); 139 qpPtr->n = numImages;140 138 // 141 139 // Allocate the necessary psVectors for the call to psVectorStats(). … … 144 142 // 145 143 psVector *pixelData = psVectorAlloc(numImages, PS_TYPE_F32); 146 pixelData->n = pixelData->nalloc;147 144 psVector *pixelMask = NULL; 148 145 if (masks != NULL) { 149 146 pixelMask = psVectorAlloc(numImages, PS_TYPE_U8); 150 147 psVectorInit(pixelMask, 0); 151 pixelMask->n = numImages;152 148 } 153 149 … … 156 152 pixelErrors = psVectorAlloc(numImages, PS_TYPE_F32); 157 153 psVectorInit(pixelErrors, 1.0); 158 pixelErrors->n = numImages;159 154 } 160 155 … … 320 315 psVector *pixels = psVectorAlloc(8, PS_TYPE_F32); // Array of pixels 321 316 psVector *mask = psVectorAlloc(8, PS_TYPE_U8); // Corresponding mask 322 pixels->n = 8;323 mask->n = 8;324 317 325 318 // Get limits … … 538 531 // 539 532 psArray *rejects = psArrayAlloc(numImages); 540 rejects->n = numImages;541 533 for (psS32 im = 0 ; im < numImages ; im++) { 542 534 rejects->data[im] = (psPtr *) psPixelsAlloc(PS_REJECT_PIXEL_INITIAL_PIXEL_LIST_LENGTH); … … 550 542 psVector *rPtr = psVectorAlloc(numImages, PS_TYPE_S32); 551 543 psVectorInit(rPtr, 0); 552 rPtr->n = numImages;553 544 554 545 psS32 numCols = ((psImage *) images->data[0])->numCols; -
trunk/psModules/src/imcombine/pmImageSubtract.c
r8815 r9730 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2006- 09-15 09:49:01$9 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-10-24 22:55:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 122 122 tmp->u = psVectorAlloc(nBF, PS_TYPE_F32); 123 123 tmp->v = psVectorAlloc(nBF, PS_TYPE_F32); 124 tmp->u->n = tmp->u->nalloc;125 tmp->v->n = tmp->v->nalloc;126 124 tmp->sigma = NULL; 127 125 tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32); 128 tmp->xOrder->n = tmp->xOrder->nalloc;129 126 tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32); 130 tmp->yOrder->n = tmp->yOrder->nalloc;131 127 tmp->subIndex = 0; 132 128 tmp->preCalc = NULL; … … 223 219 tmp->u = psVectorAlloc(nBF, PS_TYPE_F32); 224 220 tmp->v = psVectorAlloc(nBF, PS_TYPE_F32); 225 tmp->u->n = tmp->u->nalloc;226 tmp->v->n = tmp->v->nalloc;227 221 tmp->sigma = psVectorAlloc(nBF, PS_TYPE_F32); 228 222 tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32); … … 232 226 tmp->spatialOrder = spatialOrder; 233 227 tmp->preCalc = psArrayAlloc(nBF); 234 tmp->u->n = tmp->u->nalloc;235 tmp->v->n = tmp->v->nalloc;236 tmp->sigma->n = tmp->sigma->nalloc;237 tmp->xOrder->n = tmp->xOrder->nalloc;238 tmp->yOrder->n = tmp->yOrder->nalloc;239 tmp->preCalc->n = tmp->preCalc->nalloc;240 228 241 229 // … … 367 355 } else { 368 356 stamps = (psArray *) psArrayAlloc(xNum * yNum); 369 stamps->n = stamps->nalloc;370 357 for (psS32 s = 0 ; s < (xNum * yNum) ; s++) { 371 358 stamps->data[s] = (psPtr *) p_pmStampAlloc(PM_STAMP_REJECTED); … … 826 813 if (stampVector == NULL) { 827 814 stampVector = psVectorAlloc(numSolveParams, PS_TYPE_F64); 828 stampVector->n = stampVector->nalloc;829 815 stamp->vector = stampVector; 830 816 } else { … … 1045 1031 } else { 1046 1032 solution = psVectorAlloc(size, PS_TYPE_F64); 1047 solution->n = solution->nalloc;1048 1033 } 1049 1034 … … 1057 1042 psImage *sumMatrix = psImageAlloc(size, size, PS_TYPE_F64); 1058 1043 psVector *sumVector = psVectorAlloc(size, PS_TYPE_F64); 1059 sumVector->n = sumVector->nalloc;1060 1044 psVectorInit(sumVector, 0.0); 1061 1045 psImageInit(sumMatrix, 0.0); … … 1150 1134 } else { 1151 1135 deviations = psVectorAlloc(stamps->n, PS_TYPE_F32); 1152 deviations->n = deviations->nalloc;1153 1136 // XXX: Probably not necessary. 1154 1137 psVectorInit(deviations, 0.0); -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r9611 r9730 201 201 202 202 psVector *pixels = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of pixels 203 pixels->n = inputs->n;204 203 psF32 *pixelsData = pixels->data.F32; // Dereference pixels 205 204 206 205 psVector *mask = psVectorAlloc(inputs->n, PS_TYPE_U8); // Mask for stack 207 mask->n = inputs->n;208 206 psU8 *maskData = mask->data.U8; // Dereference mask 209 207 … … 212 210 if (haveWeights) { 213 211 weights = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of weights 214 weights->n = inputs->n;215 212 weightsData = weights->data.F32; 216 213 } -
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.
