Changeset 27862
- Timestamp:
- May 5, 2010, 1:35:27 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
magic/remove/src/streaksastrom.c (modified) (1 diff)
-
psModules/src/astrom/pmAstrometryWCS.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksastrom.c
r27466 r27862 375 375 } 376 376 377 static void chipToSky(pmAstromObj *pt, pmFPA *fpa, pmChip *chip) 378 { 379 // chip to FP 380 psPlaneTransformApply(pt->FP, chip->toFPA, pt->chip); 381 // FP to TP to sky 382 psPlaneTransformApply(pt->TP, fpa->toTPA, pt->FP); 383 psDeproject(pt->sky, pt->TP, fpa->toSky); 384 } 385 386 377 387 bool 378 388 linearizeTransforms(strkAstrom *astrom) 379 389 { 380 if (!pmAstromLinearizeTransforms((pmFPA *) astrom->fpa, (pmChip *) astrom->chip, NULL, NULL, NULL, 0, 0)) { 381 psErrorStackPrint(stderr, "linear fit to astrometry failed. ignoring\n"); 390 pmFPA *inFPA = (pmFPA *) astrom->fpa; 391 pmChip *inChip = (pmChip *) astrom->chip; 392 393 // compute ra and dec of chip center 394 pmAstromObj *center = pmAstromObjAlloc(); 395 center->chip->x = (double) astrom->numCols / 2.; 396 center->chip->xErr = 0; 397 center->chip->y = (double) astrom->numRows / 2.; 398 center->chip->yErr = 0; 399 400 chipToSky(center, inFPA, inChip); 401 402 psRegion bounds = {0, astrom->numCols - 1, 0, astrom->numRows - 1 }; 403 404 // create skeleton containers for the linearized transforms; 405 pmFPA outFPA; 406 pmChip outChip; 407 408 memset(&outFPA, 0, sizeof(outFPA)); 409 memset(&outChip, 0, sizeof(outChip)); 410 411 outFPA.toSky = psProjectionAlloc (center->sky->r, center->sky->d, inFPA->toSky->Xs, inFPA->toSky->Ys, PS_PROJ_TAN); 412 413 psFree(center); 414 415 if (!pmAstromLinearizeToSky(inFPA, inChip, &outFPA, &outChip, &bounds)) { 416 psError(PS_ERR_UNKNOWN, false, "Failed to linearize astrometry\n"); 382 417 return false; 383 418 } 384 return true; 385 } 419 420 psFree(inFPA->toSky); 421 inFPA->toSky = outFPA.toSky; 422 423 psFree(inFPA->toTPA); 424 inFPA->toTPA = outFPA.toTPA; 425 426 psFree(inFPA->fromTPA); 427 inFPA->fromTPA = outFPA.fromTPA; 428 429 psFree(inChip->toFPA) 430 inChip->toFPA = outChip.toFPA; 431 432 psFree(inChip->fromFPA); 433 inChip->fromFPA = outChip.fromFPA; 434 435 return true; 436 } -
trunk/psModules/src/astrom/pmAstrometryWCS.c
r27461 r27862 972 972 // FPA -> TPA : identidy 973 973 974 // NOTE: streaksremove's linearizeTransform function passes pointers to skeleton outFPA and outChip structs 975 // Only outFPA->toSky is valid. No other memebers in these structs should be read. The resulting output transforms 976 // are copied to inFPA and inChip by the caller. 977 974 978 int nSamples = 10; // 10 samples in each dimension 975 979
Note:
See TracChangeset
for help on using the changeset viewer.
