Changeset 9730 for trunk/psModules/src/astrom
- Timestamp:
- Oct 24, 2006, 12:55:05 PM (20 years ago)
- Location:
- trunk/psModules/src/astrom
- Files:
-
- 2 edited
-
pmAstrometryDistortion.c (modified) (5 diffs)
-
pmAstrometryObjects.c (modified) (11 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);
Note:
See TracChangeset
for help on using the changeset viewer.
