Changeset 6511
- Timestamp:
- Mar 3, 2006, 3:01:34 PM (20 years ago)
- Location:
- trunk/psModules
- Files:
-
- 19 edited
-
psmodule.kdevses (modified) (1 diff)
-
src/astrom/pmAstrometryObjects.c (modified) (3 diffs)
-
src/imcombine/pmImageCombine.c (modified) (9 diffs)
-
src/imcombine/pmReadoutCombine.c (modified) (5 diffs)
-
src/imsubtract/pmImageSubtract.c (modified) (9 diffs)
-
src/imsubtract/pmSubtractBias.c (modified) (12 diffs)
-
src/imsubtract/pmSubtractSky.c (modified) (3 diffs)
-
src/objects/models/pmModel_GAUSS.c (modified) (1 diff)
-
src/objects/models/pmModel_PGAUSS.c (modified) (1 diff)
-
src/objects/models/pmModel_QGAUSS.c (modified) (2 diffs)
-
src/objects/models/pmModel_SGAUSS.c (modified) (2 diffs)
-
src/objects/pmObjects.c (modified) (18 diffs)
-
src/objects/pmPSF.c (modified) (3 diffs)
-
src/objects/pmPSFtry.c (modified) (6 diffs)
-
test/astrom/tst_pmAstrometry01.c (modified) (3 diffs)
-
test/imcombine/tst_pmImageCombine.c (modified) (6 diffs)
-
test/imcombine/tst_pmReadoutCombine.c (modified) (3 diffs)
-
test/imsubtract/tst_pmImageSubtract.c (modified) (3 diffs)
-
test/objects/tst_pmObjects01.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/psmodule.kdevses
r5845 r6511 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 5" >5 <Doc0 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psModule/configure.ac" >6 <View0 line=" 21" Type="Source" />4 <DocsAndViews NumberOfDocuments="10" > 5 <Doc0 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/astrom/pmAstrometry.h" > 6 <View0 line="101" Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psLib/configure.ac" >9 <View0 line=" 53" Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/astrom/pmAstrometryObjects.c" > 9 <View0 line="254" Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psModule/src/imsubtract/pmSubtractBias.c" >12 <View0 line=" 893" Type="Source" />11 <Doc2 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/imcombine/pmImageCombine.c" > 12 <View0 line="114" Type="Source" /> 13 13 </Doc2> 14 <Doc3 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psModule/test/imsubtract/tst_pmSubtractBias.c" >15 <View0 line=" 628" Type="Source" />14 <Doc3 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/test/astrom/tst_pmAstrometry01.c" > 15 <View0 line="342" Type="Source" /> 16 16 </Doc3> 17 <Doc4 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psModule/src/astrom/pmAstrometryObjects.c" >18 <View0 line=" 560" Type="Source" />17 <Doc4 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/astrom/pmAstrometry.c" > 18 <View0 line="356" Type="Source" /> 19 19 </Doc4> 20 <Doc5 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/imsubtract/pmImageSubtract.c" > 21 <View0 line="359" Type="Source" /> 22 </Doc5> 23 <Doc6 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/objects/pmPSF.c" > 24 <View0 line="92" Type="Source" /> 25 </Doc6> 26 <Doc7 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/objects/pmObjects.c" > 27 <View0 line="1912" Type="Source" /> 28 </Doc7> 29 <Doc8 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/objects/pmObjects.h" > 30 <View0 line="77" Type="Source" /> 31 </Doc8> 32 <Doc9 NumberOfViews="1" URL="file:///home/drobbin/panstarrs/temp/psModule/src/objects/pmPSFtry.c" > 33 <View0 line="60" Type="Source" /> 34 </Doc9> 20 35 </DocsAndViews> 21 36 <pluginList> 37 <kdevdebugger> 38 <breakpointList/> 39 </kdevdebugger> 22 40 <kdevbookmarks> 23 41 <bookmarks/> 24 42 </kdevbookmarks> 25 <kdev subversion>26 < subversion recurseresolve="1" recurserelocate="1" recursemerge="1" recursecommit="1" base="" recursepropget="1" recurseswitch="1" recurseupdate="1" recursepropset="1" recursediff="1" recurserevert="1" forcemove="1" recursecheckout="1" forceremove="1" recurseadd="1" recurseproplist="1" forcemerge="1" />27 </kdevsubversion>28 <kdevdebugger>29 < breakpointList/>30 </kdev debugger>43 <kdevvalgrind> 44 <executable path="" params="" /> 45 <valgrind path="" params="" /> 46 <calltree path="" params="" /> 47 <kcachegrind path="" /> 48 </kdevvalgrind> 31 49 </pluginList> 32 50 </KDevPrjSession> -
trunk/psModules/src/astrom/pmAstrometryObjects.c
r5674 r6511 8 8 * @author EAM, IfA 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 200 5-12-05 20:49:30$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-03-04 01:01:33 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 201 201 psVector *y = psVectorAlloc (match->n, PS_TYPE_F32); 202 202 psVector *wt = psVectorAlloc (match->n, PS_TYPE_F32); 203 203 X->n = X->nalloc; 204 Y->n = Y->nalloc; 205 x->n = x->nalloc; 206 y->n = y->nalloc; 207 wt->n = wt->nalloc; 204 208 // take the matched stars, first fit 205 209 for (int i = 0; i < match->n; i++) { … … 249 253 250 254 psArray *new = psArrayAlloc (old->n); 251 255 new->n = new->nalloc; 252 256 double cs = cos(angle); 253 257 double sn = sin(angle); -
trunk/psModules/src/imcombine/pmImageCombine.c
r5741 r6511 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 200 5-12-08 00:29:53 $10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-03-04 01:01:33 $ 12 12 * 13 13 * XXX: pmRejectPixels() has a known bug with the pmImageTransform() call. … … 113 113 if (*questionablePixels == NULL) { 114 114 *questionablePixels = psArrayAlloc(numImages); 115 (*questionablePixels)->n = numImages; 115 116 } else if ((*questionablePixels)->n != numImages) { 116 117 *questionablePixels = psArrayRealloc(*questionablePixels, numImages); … … 118 119 for (psS32 im = 0 ; im < numImages ; im++) { 119 120 psFree((*questionablePixels)->data[im]); 120 ((*questionablePixels)->data[im]) = (psPtr *) psPixelsAlloc(PS_COMBINE_IMAGE_INITIAL_PIXEL_LIST_LENGTH); 121 ((*questionablePixels)->data[im]) = 122 (psPtr *) psPixelsAlloc(PS_COMBINE_IMAGE_INITIAL_PIXEL_LIST_LENGTH); 121 123 ((psPixels *) ((*questionablePixels)->data[im]))->n = 0; 122 124 } … … 126 128 psVector *qpPtr = psVectorAlloc(numImages, PS_TYPE_S32); 127 129 PS_VECTOR_SET_S32(qpPtr, 0); 128 130 qpPtr->n = numImages; 129 131 // 130 132 // Allocate the necessary psVectors for the call to psVectorStats(). … … 133 135 // 134 136 psVector *pixelData = psVectorAlloc(numImages, PS_TYPE_F32); 135 137 pixelData->n = pixelData->nalloc; 136 138 psVector *pixelMask = NULL; 137 139 if (masks != NULL) { 138 140 pixelMask = psVectorAlloc(numImages, PS_TYPE_U8); 139 141 PS_VECTOR_SET_U8(pixelMask, 0); 142 pixelMask->n = numImages; 140 143 } 141 144 … … 144 147 pixelErrors = psVectorAlloc(numImages, PS_TYPE_F32); 145 148 PS_VECTOR_SET_F32(pixelErrors, 1.0); 149 pixelErrors->n = numImages; 146 150 } 147 151 … … 320 324 psVector *pixels = psVectorAlloc(8, PS_TYPE_F32); // Array of pixels 321 325 psVector *mask = psVectorAlloc(8, PS_TYPE_U8); // Corresponding mask 326 pixels->n = 8; 327 mask->n = 8; 322 328 323 329 // Get limits … … 536 542 // 537 543 psArray *rejects = psArrayAlloc(numImages); 544 rejects->n = numImages; 538 545 for (psS32 im = 0 ; im < numImages ; im++) { 539 546 rejects->data[im] = (psPtr *) psPixelsAlloc(PS_REJECT_PIXEL_INITIAL_PIXEL_LIST_LENGTH); 547 ((psPixels *)(rejects->data[im]))->n = ((psPixels *)(rejects->data[im]))->nalloc; 540 548 psPixels *pixels = (psPixels *) rejects->data[im]; 541 549 pixels->n = 0; … … 546 554 psVector *rPtr = psVectorAlloc(numImages, PS_TYPE_S32); 547 555 PS_VECTOR_SET_S32(rPtr, 0); 556 rPtr->n = numImages; 548 557 549 558 psS32 numCols = ((psImage *) images->data[0])->numCols; -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r6325 r6511 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-0 2-06 21:03:25$7 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-03-04 01:01:33 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 176 176 177 177 psVector *tmpPixels = psVectorAlloc(numInputs, PS_TYPE_F32); 178 tmpPixels->n = tmpPixels->nalloc; 178 179 psVector *tmpPixelErrors = psVectorAlloc(numInputs, PS_TYPE_F32); 180 tmpPixelErrors->n = tmpPixelErrors->nalloc; 179 181 psVector *tmpPixelMask = psVectorAlloc(numInputs, PS_TYPE_U8); 182 tmpPixelMask->n = tmpPixelMask->nalloc; 180 183 psVector *tmpPixelMaskNKeep = psVectorAlloc(numInputs, PS_TYPE_U8); 184 tmpPixelMaskNKeep->n = tmpPixelMaskNKeep->nalloc; 181 185 psVector *outRowLower = psVectorAlloc(numInputs, PS_TYPE_U32); 186 outRowLower->n = outRowLower->nalloc; 182 187 psVector *outRowUpper = psVectorAlloc(numInputs, PS_TYPE_U32); 188 outRowUpper->n = outRowUpper->nalloc; 183 189 psVector *outColLower = psVectorAlloc(numInputs, PS_TYPE_U32); 190 outColLower->n = outColLower->nalloc; 184 191 psVector *outColUpper = psVectorAlloc(numInputs, PS_TYPE_U32); 192 outColUpper->n = outColUpper->nalloc; 185 193 pmReadout **tmpReadouts = (pmReadout **) psAlloc(numInputs * sizeof(pmReadout *)); 186 194 … … 414 422 psStats *diffStats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); 415 423 psVector *diffs = psVectorAlloc(fringePoints->n, PS_TYPE_F32); 424 diffs->n = diffs->nalloc; 416 425 417 426 // … … 517 526 psVector *localChipGains = chipGains; 518 527 if (numChips != chipGains->n) { 519 psLogMsg(__func__, PS_LOG_WARN, "WARNING: the chipGains vector length does not match the number of chips.\n"); 528 psLogMsg(__func__, PS_LOG_WARN, 529 "WARNING: the chipGains vector length does not match the number of chips.\n"); 520 530 localChipGains = psVectorAlloc(numChips, PS_TYPE_F64); 531 localChipGains->n = localChipGains->nalloc; 521 532 psBool rc = psVectorInit(localChipGains, 1.0); 522 533 if (rc == false) { … … 531 542 psBool meanFlag = false; 532 543 psVector *chipGainsMask = psVectorAlloc(chipGains->n, PS_TYPE_U8); 544 chipGainsMask->n = chipGainsMask->nalloc; 533 545 for (psS32 i = 0 ; i < chipGains->n ; i++) { 534 546 if ((fabs(chipGains->data.F64[i]) < FLT_EPSILON) || -
trunk/psModules/src/imsubtract/pmImageSubtract.c
r5170 r6511 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 200 5-09-28 20:43:52$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-03-04 01:01:33 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 119 119 tmp->u = psVectorAlloc(nBF, PS_TYPE_F32); 120 120 tmp->v = psVectorAlloc(nBF, PS_TYPE_F32); 121 tmp->u->n = tmp->u->nalloc; 122 tmp->v->n = tmp->v->nalloc; 121 123 tmp->sigma = NULL; 122 124 tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32); 125 tmp->xOrder->n = tmp->xOrder->nalloc; 123 126 tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32); 127 tmp->yOrder->n = tmp->yOrder->nalloc; 124 128 tmp->subIndex = 0; 125 129 tmp->preCalc = NULL; … … 216 220 tmp->u = psVectorAlloc(nBF, PS_TYPE_F32); 217 221 tmp->v = psVectorAlloc(nBF, PS_TYPE_F32); 222 tmp->u->n = tmp->u->nalloc; 223 tmp->v->n = tmp->v->nalloc; 218 224 tmp->sigma = psVectorAlloc(nBF, PS_TYPE_F32); 219 225 tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32); … … 223 229 tmp->spatialOrder = spatialOrder; 224 230 tmp->preCalc = psArrayAlloc(nBF); 231 tmp->u->n = tmp->u->nalloc; 232 tmp->v->n = tmp->v->nalloc; 233 tmp->sigma->n = tmp->sigma->nalloc; 234 tmp->xOrder->n = tmp->xOrder->nalloc; 235 tmp->yOrder->n = tmp->yOrder->nalloc; 236 tmp->preCalc->n = tmp->preCalc->nalloc; 225 237 226 238 // … … 352 364 } else { 353 365 stamps = (psArray *) psArrayAlloc(xNum * yNum); 366 stamps->n = stamps->nalloc; 354 367 for (psS32 s = 0 ; s < (xNum * yNum) ; s++) { 355 368 stamps->data[s] = (psPtr *) p_pmStampAlloc(PM_STAMP_REJECTED); … … 810 823 if (stampVector == NULL) { 811 824 stampVector = psVectorAlloc(numSolveParams, PS_TYPE_F64); 825 stampVector->n = stampVector->nalloc; 812 826 stamp->vector = stampVector; 813 827 } else { … … 1028 1042 } else { 1029 1043 solution = psVectorAlloc(size, PS_TYPE_F64); 1044 solution->n = solution->nalloc; 1030 1045 } 1031 1046 … … 1039 1054 psImage *sumMatrix = psImageAlloc(size, size, PS_TYPE_F64); 1040 1055 psVector *sumVector = psVectorAlloc(size, PS_TYPE_F64); 1056 sumVector->n = sumVector->nalloc; 1041 1057 PS_VECTOR_SET_F64(sumVector, 0.0); 1042 1058 PS_IMAGE_SET_F64(sumMatrix, 0.0); … … 1131 1147 } else { 1132 1148 deviations = psVectorAlloc(stamps->n, PS_TYPE_F32); 1149 deviations->n = deviations->nalloc; 1133 1150 // XXX: Probably not necessary. 1134 1151 PS_VECTOR_SET_F32(deviations, 0.0); -
trunk/psModules/src/imsubtract/pmSubtractBias.c
r6506 r6511 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-03-0 2 23:16:05$8 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-03-04 01:01:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 307 307 // XXX: use psVectorCopy if they get it working. 308 308 out->knots = psVectorAlloc(in->knots->n, in->knots->type.type); 309 out->knots->n = out->knots->nalloc; 309 310 for (psS32 i = 0 ; i < in->knots->n ; i++) { 310 311 out->knots->data.F32[i] = in->knots->data.F32[i]; … … 346 347 // Allocate the new vector. 347 348 psVector *newVec = psVectorAlloc(n, PS_TYPE_F32); 348 349 newVec->n = newVec->nalloc; 349 350 // 350 351 // If the new vector is the same size as the old, simply copy the data. … … 491 492 psS32 numOverscanImages = my_psListLength(bias); 492 493 psVector *statsAll = psVectorAlloc(numOverscanImages, PS_TYPE_F32); 494 statsAll->n = statsAll->nalloc; 493 495 psListElem *tmpOverscan = (psListElem *) bias->head; 494 496 psS32 i = 0; … … 554 556 psVector *tmpRow = psVectorAlloc(overscanImage->numCols, PS_TYPE_F32); 555 557 psVector *tmpCol = psVectorAlloc(overscanImage->numRows, PS_TYPE_F32); 558 tmpRow->n = tmpRow->nalloc; 559 tmpCol->n = tmpCol->nalloc; 556 560 557 561 // … … 594 598 psVector *tmpRow = psVectorAlloc(overscanImage->numCols, PS_TYPE_F32); 595 599 psVector *tmpCol = psVectorAlloc(overscanImage->numRows, PS_TYPE_F32); 600 tmpRow->n = tmpRow->nalloc; 601 tmpCol->n = tmpCol->nalloc; 596 602 597 603 // … … 649 655 psS32 vecSize = GetOverscanSize(inImg, overScanAxis); 650 656 psVector *overscanVector = psVectorAlloc(vecSize, PS_TYPE_F32); 657 overscanVector->n = overscanVector->nalloc; 651 658 652 659 // … … 658 665 psS32 numOverscanImages = my_psListLength(bias); 659 666 psVector **overscanVectors = (psVector **) psAlloc(numOverscanImages * sizeof(psVector *)); 667 // (*overscanVectors)->n = (*overscanVectors)->nalloc; 660 668 for (psS32 i = 0 ; i < numOverscanImages ; i++) { 661 669 overscanVectors[i] = NULL; … … 711 719 // 712 720 psVector *tmpVec = psVectorAlloc(numOverscanImages, PS_TYPE_F32); 721 tmpVec->n = tmpVec->nalloc; 713 722 psF64 statValue; 714 723 for (psS32 i = 0 ; i < vecSize ; i++) { … … 772 781 psVector *myBin = psVectorAlloc(numBins, PS_TYPE_F32); 773 782 psVector *binVec = psVectorAlloc(nBinOrig, PS_TYPE_F32); 783 myBin->n = myBin->nalloc; 784 binVec->n = binVec->nalloc; 774 785 775 786 for (psS32 i=0;i<numBins;i++) { … … 859 870 psS32 vecSize = GetOverscanSize(inImg, overScanAxis); 860 871 psVector *newVec = psVectorAlloc(vecSize, PS_TYPE_F32); 872 newVec->n = newVec->nalloc; 861 873 if ((nBin > 1) && (nBin < overscanVector->n)) { 862 874 for (psS32 i = 0 ; i < vecSize ; i++) { … … 905 917 906 918 psVector *newVec = psVectorAlloc(vecSize, PS_TYPE_F32); 919 newVec->n = newVec->nalloc; 907 920 for (psS32 i = 0 ; i < vecSize ; i++) { 908 921 newVec->data.F32[i] = overscanVector->data.F32[i/nBin]; -
trunk/psModules/src/imsubtract/pmSubtractSky.c
r6325 r6511 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 2-06 21:03:25$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-03-04 01:01:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 12 12 * 13 * 13 * 14 14 * 15 15 */ … … 341 341 psImage *Aout = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64); 342 342 psVector *B = psVectorAlloc(localPolyTerms, PS_TYPE_F64); 343 B->n = B->nalloc; 343 344 psVector *outPerm = NULL; 344 345 … … 407 408 PS_ASSERT_IMAGE_NON_EMPTY(Aout, NULL); 408 409 psVector *C = psVectorAlloc(localPolyTerms, PS_TYPE_F64); 410 C->n = C->nalloc; 409 411 psMatrixLUSolve(C, Aout, B, outPerm); 410 412 -
trunk/psModules/src/objects/models/pmModel_GAUSS.c
r5257 r6511 71 71 *params_min = psVectorAlloc (7, PS_TYPE_F32); 72 72 *params_max = psVectorAlloc (7, PS_TYPE_F32); 73 (*beta_lim)->n = (*beta_lim)->nalloc; 74 (*params_min)->n = (*params_min)->nalloc; 75 (*params_max)->n = (*params_max)->nalloc; 73 76 74 77 beta_lim[0][0].data.F32[0] = 1000; -
trunk/psModules/src/objects/models/pmModel_PGAUSS.c
r5257 r6511 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; 47 50 48 51 beta_lim[0][0].data.F32[0] = 1000; -
trunk/psModules/src/objects/models/pmModel_QGAUSS.c
r5257 r6511 11 11 params->data.F32[5] = sqrt(2.0) / SigmaY; 12 12 params->data.F32[6] = Sxy; 13 params->data.F32[7] = 14 params->data.F32[8] = 13 params->data.F32[7] = 14 params->data.F32[8] = 15 15 *****************************************************************************/ 16 16 … … 53 53 *params_min = psVectorAlloc (8, PS_TYPE_F32); 54 54 *params_max = psVectorAlloc (8, PS_TYPE_F32); 55 (*beta_lim)->n = (*beta_lim)->nalloc; 56 (*params_min)->n = (*params_min)->nalloc; 57 (*params_max)->n = (*params_max)->nalloc; 55 58 56 59 beta_lim[0][0].data.F32[0] = 1000; -
trunk/psModules/src/objects/models/pmModel_SGAUSS.c
r5257 r6511 64 64 *params_min = psVectorAlloc (9, PS_TYPE_F32); 65 65 *params_max = psVectorAlloc (9, PS_TYPE_F32); 66 (*beta_lim)->n = (*beta_lim)->nalloc; 67 (*params_min)->n = (*params_min)->nalloc; 68 (*params_max)->n = (*params_max)->nalloc; 66 69 67 70 beta_lim[0][0].data.F32[0] = 1000; … … 116 119 117 120 psVector *contour = psVectorAlloc (Nt, PS_TYPE_F32); 121 contour->n = contour->nalloc; 118 122 for (t = 0, N = 0; (t < 2*M_PI) && (N < Nt); t += dt) { 119 123 x = ct*axes.major*cos(t) + st*axes.minor*sin(t) + xo; -
trunk/psModules/src/objects/pmObjects.c
r6329 r6511 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 2-06 22:17:54$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-03-04 01:01:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 97 97 psVector *tmpVector = psVectorAlloc(image->numCols, PS_TYPE_F32); 98 tmpVector->n = tmpVector->nalloc; 98 99 for (psU32 col = 0; col < image->numCols ; col++) { 99 100 tmpVector->data.F32[col] = image->data.F32[row][col]; … … 282 283 tmp->params = psVectorAlloc(Nparams, PS_TYPE_F32); 283 284 tmp->dparams = psVectorAlloc(Nparams, PS_TYPE_F32); 285 tmp->params->n = tmp->params->nalloc; 286 tmp->dparams->n = tmp->dparams->nalloc; 284 287 285 288 for (psS32 i = 0; i < tmp->params->n; i++) { … … 348 351 if (vector->data.F32[0] > threshold) { 349 352 tmpVector = psVectorAlloc(1, PS_TYPE_U32); 353 tmpVector->n = 1; 350 354 tmpVector->data.U32[0] = 0; 351 355 } else { … … 388 392 // 389 393 psVector *tmpVector = psVectorAlloc(count, PS_TYPE_U32); 394 tmpVector->n = tmpVector->nalloc; 390 395 count = 0; 391 396 … … 1428 1433 // 1429 1434 psVector *x = psVectorAlloc(2, PS_TYPE_F32); 1435 x->n = x->nalloc; 1430 1436 x->data.F32[0] = (psF32) (col + image->col0); 1431 1437 x->data.F32[1] = (psF32) (row + image->row0); … … 1472 1478 psVector *xVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32); 1473 1479 psVector *yVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32); 1474 1480 xVec->n = xVec->nalloc; 1481 yVec->n = yVec->nalloc; 1475 1482 // 1476 1483 // Start at the row with peak pixel, then decrement. … … 1552 1559 // 1553 1560 psArray *tmpArray = psArrayAlloc(2); 1561 tmpArray->n = 2; 1554 1562 tmpArray->data[0] = (psPtr *) yVec; 1555 1563 tmpArray->data[1] = (psPtr *) xVec; … … 1616 1624 psVector *y = psVectorAlloc(count, PS_TYPE_F32); 1617 1625 psVector *yErr = psVectorAlloc(count, PS_TYPE_F32); 1626 x->n = x->nalloc; 1627 y->n = y->nalloc; 1628 yErr->n = yErr->nalloc; 1618 1629 psS32 tmpCnt = 0; 1619 1630 for (psS32 i = 0; i < source->pixels->numRows; i++) { … … 1621 1632 if (source->mask->data.U8[i][j] == 0) { 1622 1633 psVector *coord = psVectorAlloc(2, PS_TYPE_F32); 1634 coord->n = 2; 1623 1635 // XXX: Convert i/j to image space: 1624 1636 // XXX EAM: coord order is (x,y) == (col,row) … … 1641 1653 if (PSF) { 1642 1654 paramMask = psVectorAlloc (params->n, PS_TYPE_U8); 1655 paramMask->n = paramMask->nalloc; 1643 1656 for (int i = 0; i < 4; i++) { 1644 1657 paramMask->data.U8[i] = 0; … … 1673 1686 if (paramMask != NULL) { 1674 1687 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64); 1688 delta->n = delta->nalloc; 1675 1689 psMinimizeGaussNewtonDelta (delta, params, NULL, x, y, yErr, modelFunc); 1676 1690 for (int i = 0; i < dparams->n; i++) { … … 1763 1777 psVector *y = psVectorAlloc(count, PS_TYPE_F32); 1764 1778 psVector *yErr = psVectorAlloc(count, PS_TYPE_F32); 1779 x->n = x->nalloc; 1780 y->n = y->nalloc; 1781 yErr->n = yErr->nalloc; 1765 1782 psS32 tmpCnt = 0; 1766 1783 for (psS32 i = 0; i < source->pixels->numRows; i++) { … … 1768 1785 if (source->mask->data.U8[i][j] == 0) { 1769 1786 psVector *coord = psVectorAlloc(2, PS_TYPE_F32); 1787 coord->n = 2; 1770 1788 // XXX: Convert i/j to image space: 1771 1789 // XXX EAM: coord order is (x,y) == (col,row) … … 1779 1797 1780 1798 // this test enhances the weight based on deviation from the model flux 1781 Ro = 1.0 + fabs (y->data.F32[tmpCnt] - ymodel) / sqrt(PS_SQR(ymodel - So) + PS_SQR(So)); 1799 Ro = 1.0 + fabs (y->data.F32[tmpCnt] - ymodel) / sqrt(PS_SQR(ymodel - So) 1800 + PS_SQR(So)); 1782 1801 1783 1802 // psMinimizeLMChi2_EAM takes wt = 1/dY^2 … … 1798 1817 if (PSF) { 1799 1818 paramMask = psVectorAlloc (params->n, PS_TYPE_U8); 1819 paramMask->n = paramMask->nalloc; 1800 1820 for (int i = 0; i < 4; i++) { 1801 1821 paramMask->data.U8[i] = 0; … … 1846 1866 if (paramMask != NULL) { 1847 1867 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F64); 1868 delta->n = delta->nalloc; 1848 1869 psMinimizeGaussNewtonDelta(delta, params, NULL, x, y, yErr, modelFunc); 1849 1870 for (int i = 0; i < dparams->n; i++) { … … 1897 1918 1898 1919 psVector *x = psVectorAlloc(2, PS_TYPE_F32); 1920 x->n = 2; 1899 1921 psVector *params = model->params; 1900 1922 pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type); -
trunk/psModules/src/objects/pmPSF.c
r5844 r6511 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 200 5-12-24 01:24:32$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-03-04 01:01:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 91 91 92 92 psf->params = psArrayAlloc(Nparams - 4); 93 psf->params->n = psf->params->nalloc; 93 94 for (int i = 0; i < psf->params->n; i++) { 94 95 // XXX EAM : make this a user-defined value? … … 119 120 psVector *z = psVectorAlloc (models->n, PS_TYPE_F64); 120 121 psVector *dz = psVectorAlloc (models->n, PS_TYPE_F64); 122 x->n = x->nalloc; 123 y->n = y->nalloc; 124 z->n = z->nalloc; 125 dz->n = dz->nalloc; 121 126 122 127 for (int i = 0; i < models->n; i++) { -
trunk/psModules/src/objects/pmPSFtry.c
r5844 r6511 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $8 * @date $Date: 200 5-12-24 01:24:32$7 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-03-04 01:01:33 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 59 test->mask = psVectorAlloc (sources->n, PS_TYPE_U8); 60 60 61 test->modelFLT->n = test->modelFLT->nalloc; 62 test->modelPSF->n = test->modelPSF->nalloc; 63 test->metric->n = test->metric->nalloc; 64 test->fitMag->n = test->fitMag->nalloc; 65 test->mask->n = test->mask->nalloc; 66 61 67 for (int i = 0; i < test->modelFLT->n; i++) { 62 68 test->mask->data.U8[i] = 0; … … 204 210 // rflux = ten(0.4*fitMag); 205 211 psVector *rflux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 212 rflux->n = rflux->nalloc; 206 213 for (int i = 0; i < psfTry->sources->n; i++) { 207 214 if (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL) … … 219 226 psVector *daBin = psVectorAlloc (rfBin->n, PS_TYPE_F64); 220 227 psVector *maskB = psVectorAlloc (rfBin->n, PS_TYPE_U8); 228 daBin->n = daBin->nalloc; 229 maskB->n = maskB->nalloc; 221 230 psFree (stats); 222 231 … … 272 281 273 282 psVector *tmp2 = psVectorAlloc (nKeep, PS_TYPE_F64); 283 tmp2->n = tmp2->nalloc; 274 284 for (int j = 0; j < tmp2->n; j++) { 275 285 tmp2->data.F64[j] = tmp->data.F64[j + nSkip]; … … 337 347 psVector *rflux = psVectorAlloc (try 338 348 ->sources->n, PS_TYPE_F64); 349 rflux->n = rflux->nalloc; 339 350 for (int i = 0; i < try 340 351 ->sources->n; i++) { -
trunk/psModules/test/astrom/tst_pmAstrometry01.c
r5739 r6511 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $8 * @date $Date: 200 5-12-08 00:00:57$7 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-03-04 01:01:33 $ 9 9 * 10 10 * XXX: Add tests were the coordinate does not transform to any legitimate cell … … 28 28 29 29 testDescription tests[] = { 30 {test3, -3, "pmAstrometry focal plane transformations", 0, false},31 {test4, -3, "pmCheckParents()", 0, false},32 {test5, -3, "pmFPASelectChip() and pmFPAExcludeChip()", 0, false},30 {test3, 666, "pmAstrometry focal plane transformations", 0, false}, 31 {test4, 667, "pmCheckParents()", 0, false}, 32 {test5, 668, "pmFPASelectChip() and pmFPAExcludeChip()", 0, false}, 33 33 {NULL} 34 34 }; … … 229 229 230 230 pmCoordFPAToTP() yes 231 pmCoordTPToFPA() yes 231 pmCoordTPToFPA() yes 232 232 233 233 pmCoordTPToSky() yes -
trunk/psModules/test/imcombine/tst_pmImageCombine.c
r5258 r6511 10 10 * XXX: Must test masks with pmRejectPixels() 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 200 5-10-10 21:58:34 $12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-03-04 01:01:34 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 67 67 psArray *errors = psArrayAlloc(numImages); 68 68 psArray *masks = psArrayAlloc(numImages); 69 images->n = images->nalloc; 70 errors->n = errors->nalloc; 71 masks->n = masks->nalloc; 69 72 for (psS32 i = 0 ; i < numImages ; i++) { 70 73 images->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F32); … … 94 97 psArray *errorsLong = psArrayAlloc(numImages+1); 95 98 psArray *masksLong = psArrayAlloc(numImages+1); 99 imagesLong->n = imagesLong->nalloc; 100 errorsLong->n = errorsLong->nalloc; 101 masksLong->n = masksLong->nalloc; 96 102 for (psS32 i = 0 ; i < numImages+1 ; i++) { 97 103 imagesLong->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F32); … … 121 127 psArray *errorsBadType = psArrayAlloc(numImages); 122 128 psArray *masksBadType = psArrayAlloc(numImages); 129 imagesBadType->n = imagesBadType->nalloc; 130 errorsBadType->n = errorsBadType->nalloc; 131 masksBadType->n = masksBadType->nalloc; 123 132 for (psS32 i = 0 ; i < numImages ; i++) { 124 133 imagesBadType->data[i] = (psPtr *) psImageAlloc(numCols, numRows, PS_TYPE_F64); … … 143 152 144 153 psPixels *pixels = psPixelsAlloc(TST00_NUM_PIXELS); 154 pixels->n = pixels->nalloc; 145 155 for (psS32 p = 0 ; p < TST00_NUM_PIXELS ; p++) { 146 156 psS32 col = genRanInt(0, numCols); … … 284 294 psArray *expandTransforms = psArrayAlloc(numImages); 285 295 psArray *contractTransforms = psArrayAlloc(numImages); 296 expandTransforms->n = expandTransforms->nalloc; 297 contractTransforms->n = contractTransforms->nalloc; 286 298 for (psS32 im = 0 ; im < numImages ; im++) { 287 299 psPlaneTransform *ptExpand = psPlaneTransformAlloc(2, 2); -
trunk/psModules/test/imcombine/tst_pmReadoutCombine.c
r5169 r6511 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 200 5-09-28 20:42:52$7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-03-04 01:01:34 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 83 83 psVector *zero = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32); 84 84 psVector *scale = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32); 85 zero->n = zero->nalloc; 86 scale->n = scale->nalloc; 85 87 printPositiveTestHeader(stdout, "pmReadoutCombine", "simpleCombineNoOverlap"); 86 88 … … 207 209 psVector *scaleBig = psVectorAlloc(NUM_READOUTS*2, PS_TYPE_F32); 208 210 psVector *scaleF64 = psVectorAlloc(NUM_READOUTS, PS_TYPE_F64); 211 zero->n = zero->nalloc; 212 zeroHalf->n = zeroHalf->nalloc; 213 zeroBig->n = zeroBig->nalloc; 214 zeroF64->n = zeroF64->nalloc; 215 scale->n = scale->nalloc; 216 scaleHalf->n = scaleHalf->nalloc; 217 scaleBig->n = scaleBig->nalloc; 218 scaleF64->n = scaleF64->nalloc; 209 219 for (i=0;i<NUM_READOUTS;i++) { 210 220 zero->data.F32[i] = 3.0; -
trunk/psModules/test/imsubtract/tst_pmImageSubtract.c
r5169 r6511 10 10 * data. More work need to be done to verify the results. 11 11 * 12 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $13 * @date $Date: 200 5-09-28 20:42:52$12 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-03-04 01:01:34 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 161 161 162 162 psVector *sigmas = psVectorAlloc(sigmaLength, PS_TYPE_F32); 163 sigmas->n = sigmas->nalloc; 163 164 for (psS32 i = 0 ; i < sigmas->n ; i++) { 164 165 sigmas->data.F32[i] = 1.0 + (psF32) i; 165 166 } 166 167 psVector *orders = psVectorAlloc(orderLength, PS_TYPE_S32); 168 orders->n = orders->nalloc; 167 169 for (psS32 i = 0 ; i < orders->n ; i++) { 168 170 orders->data.S32[i] = i + 2; … … 617 619 // 618 620 psVector *sigmas = psVectorAlloc(TST03_SIGMA_LENGTH, PS_TYPE_F32); 621 sigmas->n = sigmas->nalloc; 619 622 for (psS32 i = 0 ; i < sigmas->n ; i++) { 620 623 sigmas->data.F32[i] = 1.0 + (psF32) i; 621 624 } 622 625 psVector *orders = psVectorAlloc(TST03_ORDER_LENGTH, PS_TYPE_S32); 626 orders->n = orders->nalloc; 623 627 for (psS32 i = 0 ; i < orders->n ; i++) { 624 628 orders->data.S32[i] = i + 2; -
trunk/psModules/test/objects/tst_pmObjects01.c
r6326 r6511 31 31 most of psObjects.c is not tested 32 32 * 33 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $34 * @date $Date: 2006-0 2-06 21:23:46$33 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 34 * @date $Date: 2006-03-04 01:01:34 $ 35 35 * 36 36 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 234 234 bool testStatus = true; 235 235 psVector *inData = psVectorAlloc(n, PS_TYPE_F32); 236 inData->n = inData->nalloc; 236 237 psVector *outData = NULL; 237 238 … … 401 402 psVector *tmpVecF64 = psVectorAlloc(TST01_VECTOR_LENGTH, PS_TYPE_F64); 402 403 psVector *tmpVecEmpty = psVectorAlloc(0, PS_TYPE_F32); 404 tmpVecF64->n = tmpVecF64->nalloc; 405 tmpVecEmpty->n = tmpVecEmpty->nalloc; 403 406 404 407 psTraceSetLevel(".", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
