Changeset 10872
- Timestamp:
- Jan 1, 2007, 11:05:09 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryDistortion.c
r10859 r10872 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $10 * @date $Date: 200 6-12-30 03:27:19 $9 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-01-01 21:05:09 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 118 118 continue; 119 119 120 char key;121 pmKapaPlotVectorPair (L, M);122 fscanf (stdin, "%c", &key);123 124 pmKapaPlotVectorPair (L, dP);125 fscanf (stdin, "%c", &key);126 127 pmKapaPlotVectorPair (L, dQ);128 fscanf (stdin, "%c", &key);129 130 120 // stats structure and mask for use in measuring the clipping statistic 131 121 // this analysis has too few data points to use the robust median method … … 236 226 localX->mask[i-1][j] = 1; 237 227 } 238 if ((j > 0) && (j <= fpa->toTPA-> y->nY)) {228 if ((j > 0) && (j <= fpa->toTPA->x->nY)) { 239 229 localY->mask[i][j-1] = 1; 240 230 } … … 260 250 // update fpa->toTP distortion terms 261 251 fpa->toTPA->x->coeff[0][0] = 0; 262 for (int i = 1; i < fpa->toTPA->x->nX; i++) {252 for (int i = 1; i <= fpa->toTPA->x->nX; i++) { 263 253 if (!fpa->toTPA->x->mask[i][0]) { 264 254 fpa->toTPA->x->coeff[i][0] = localX->coeff[i-1][0] / i; 265 255 } 266 256 } 267 for (int j = 1; j < fpa->toTPA->x->nY; j++) {257 for (int j = 1; j <= fpa->toTPA->x->nY; j++) { 268 258 if (!fpa->toTPA->x->mask[0][j]) { 269 259 fpa->toTPA->x->coeff[0][j] = localY->coeff[0][j-1] / j; 270 260 } 271 261 } 272 for (int i = 1; i < fpa->toTPA->x->nX; i++) {273 for (int j = 1; j < fpa->toTPA->x->nY; j++) {262 for (int i = 1; i <= fpa->toTPA->x->nX; i++) { 263 for (int j = 1; j <= fpa->toTPA->x->nY; j++) { 274 264 if (!fpa->toTPA->x->mask[i][j]) { 275 265 fpa->toTPA->x->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); … … 277 267 } 278 268 } 269 fpa->toTPA->x->coeff[1][0] += 1.0; 279 270 psFree (localX); 280 271 psFree (localY); … … 289 280 for (int j = 0; j < fpa->toTPA->y->nY; j++) { 290 281 if (fpa->toTPA->y->mask[i][j]) { 291 localX->mask[i-1][j] = 1; 292 localY->mask[i][j-1] = 1; 282 if ((i > 0) && (i <= fpa->toTPA->y->nX)) { 283 localX->mask[i-1][j] = 1; 284 } 285 if ((j > 0) && (j <= fpa->toTPA->y->nY)) { 286 localY->mask[i][j-1] = 1; 287 } 293 288 } 294 289 } … … 320 315 // update fpa->toTP distortion terms 321 316 fpa->toTPA->y->coeff[0][0] = 0; 322 for (int i = 1; i < fpa->toTPA->y->nX; i++) {317 for (int i = 1; i <= fpa->toTPA->y->nX; i++) { 323 318 if (!fpa->toTPA->y->mask[i][0]) { 324 319 fpa->toTPA->y->coeff[i][0] = localX->coeff[i-1][0] / i; 325 320 } 326 321 } 327 for (int j = 1; j < fpa->toTPA->y->nY; j++) {322 for (int j = 1; j <= fpa->toTPA->y->nY; j++) { 328 323 if (!fpa->toTPA->y->mask[0][j]) { 329 324 fpa->toTPA->y->coeff[0][j] = localY->coeff[0][j-1] / j; 330 325 } 331 326 } 332 for (int i = 1; i < fpa->toTPA->y->nX; i++) {333 for (int j = 1; j < fpa->toTPA->y->nY; j++) {327 for (int i = 1; i <= fpa->toTPA->y->nX; i++) { 328 for (int j = 1; j <= fpa->toTPA->y->nY; j++) { 334 329 if (!fpa->toTPA->y->mask[i][j]) { 335 330 fpa->toTPA->y->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); … … 337 332 } 338 333 } 334 fpa->toTPA->y->coeff[0][1] += 1.0; 339 335 psFree (localX); 340 336 psFree (localY); … … 353 349 // XXX choose an appropriate region based on the range of values 354 350 // in L and M? 355 psRegion region = psRegionSet (0, 4000, 0, 4000); 356 psPlaneTransformInvert(fpa->fromTPA, fpa->toTPA, region, 50); 351 psRegion region = psRegionSet (-125000, +125000, -125000, +125000); 352 psFree (fpa->fromTPA); 353 fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, region, 50); 357 354 358 355 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
