Changeset 10875
- Timestamp:
- Jan 1, 2007, 11:06:12 AM (20 years ago)
- Location:
- trunk/psModules/test/astrom
- Files:
-
- 2 edited
-
tap_pmAstrometryWCS.c (modified) (4 diffs)
-
tap_pmAstrometryWCS_DVO3.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/astrom/tap_pmAstrometryWCS.c
r10824 r10875 46 46 pmChip *chip = pmChipAlloc (NULL, "test"); 47 47 48 // toFPA carries pixel scale ( pixels per micron)49 // to TPA carries plate scale (microns per arcsecond)50 bool status = pmAstromReadWCS (fpa, chip, header, 25.0*PM_RAD_DEG/3600.0);48 // toFPA carries pixel scale (microns per pixel) 49 // toSky carries plate scale (radians per micron) 50 bool status = pmAstromReadWCS (fpa, chip, header, 10.0); 51 51 ok (status, "converted WCS keywords to FPA astrometry"); 52 52 skip_start (!status, 1, "*** WCS Conversion FAILS *** : skipping related tests"); … … 58 58 ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PM_DEG_RAD); 59 59 60 ok_float(fpa->toSky->Xs, 25.0*PM_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Xs);61 ok_float(fpa->toSky->Ys, 25.0*PM_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Ys);60 ok_float(fpa->toSky->Xs, PM_RAD_DEG/3600.0/10.0, "projection X scale %f", fpa->toSky->Xs); 61 ok_float(fpa->toSky->Ys, PM_RAD_DEG/3600.0/10.0, "projection X scale %f", fpa->toSky->Ys); 62 62 63 ok_float(fpa->toTPA->x->coeff[1][0], 0.04, "TP scale (mm per pixel): %f", fpa->toTPA->x->coeff[1][0]);64 ok_float(fpa->toTPA->y->coeff[0][1], 0.04, "TP scale (mm per pixel): %f", fpa->toTPA->x->coeff[1][0]);63 ok_float(fpa->toTPA->x->coeff[1][0], 1.0, "TP scale (unity): %f", fpa->toTPA->x->coeff[1][0]); 64 ok_float(fpa->toTPA->y->coeff[0][1], 1.0, "TP scale (unity): %f", fpa->toTPA->x->coeff[1][0]); 65 65 66 66 ok_float(chip->toFPA->x->coeff[0][0], 0.0, "ref pixel X: %f", chip->toFPA->x->coeff[0][0]); 67 67 ok_float(chip->toFPA->y->coeff[0][0], 0.0, "ref pixel Y: %f", chip->toFPA->y->coeff[0][0]); 68 68 69 ok_float(chip->toFPA->x->coeff[1][0], 1 .0, "CD1_1: %f", chip->toFPA->x->coeff[1][0]);69 ok_float(chip->toFPA->x->coeff[1][0], 10.0, "CD1_1: %f", chip->toFPA->x->coeff[1][0]); 70 70 ok_float(chip->toFPA->x->coeff[0][1], 0.0, "CD1_2: %f", chip->toFPA->x->coeff[0][1]); 71 71 ok_float(chip->toFPA->y->coeff[1][0], 0.0, "CD2_1: %f", chip->toFPA->y->coeff[1][0]); 72 ok_float(chip->toFPA->y->coeff[0][1], 1 .0, "CD2_2: %f", chip->toFPA->y->coeff[0][1]);72 ok_float(chip->toFPA->y->coeff[0][1], 10.0, "CD2_2: %f", chip->toFPA->y->coeff[0][1]); 73 73 74 74 psFree (fpa); … … 115 115 // toFPA carries pixel scale (pixels per micron) 116 116 // toTPA carries plate scale (microns per arcsecond) 117 bool status = pmAstromReadWCS (fpa, chip, header, 25.0*PM_RAD_DEG/3600.0);117 bool status = pmAstromReadWCS (fpa, chip, header, 10.0); 118 118 ok (status, "converted WCS keywords to FPA astrometry"); 119 119 skip_start (!status, 1, "*** WCS Conversion FAILS *** : skipping related tests"); … … 125 125 ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PM_DEG_RAD); 126 126 127 ok_float(fpa->toSky->Xs, 25.0*PM_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Xs);128 ok_float(fpa->toSky->Ys, 25.0*PM_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Ys);127 ok_float(fpa->toSky->Xs, PM_RAD_DEG/3600.0/10.0, "projection X scale %f", fpa->toSky->Xs); 128 ok_float(fpa->toSky->Ys, PM_RAD_DEG/3600.0/10.0, "projection X scale %f", fpa->toSky->Ys); 129 129 130 ok_float(fpa->toTPA->x->coeff[1][0], 0.04, "TP scale (mm per pixel): %f", fpa->toTPA->x->coeff[1][0]);131 ok_float(fpa->toTPA->y->coeff[0][1], 0.04, "TP scale (mm per pixel): %f", fpa->toTPA->x->coeff[1][0]);130 ok_float(fpa->toTPA->x->coeff[1][0], 1.0, "TP scale (unity): %f", fpa->toTPA->x->coeff[1][0]); 131 ok_float(fpa->toTPA->y->coeff[0][1], 1.0, "TP scale (unity): %f", fpa->toTPA->x->coeff[1][0]); 132 132 133 ok_float(chip->toFPA->x->coeff[0][0], -10 .0, "ref pixel X: %f", chip->toFPA->x->coeff[0][0]);134 ok_float(chip->toFPA->y->coeff[0][0], -10 .0, "ref pixel Y: %f", chip->toFPA->y->coeff[0][0]);133 ok_float(chip->toFPA->x->coeff[0][0], -100.0, "ref pixel X: %f", chip->toFPA->x->coeff[0][0]); 134 ok_float(chip->toFPA->y->coeff[0][0], -100.0, "ref pixel Y: %f", chip->toFPA->y->coeff[0][0]); 135 135 136 ok_float(chip->toFPA->x->coeff[1][0], 1 .0, "CD1_1: %f", chip->toFPA->x->coeff[1][0]);136 ok_float(chip->toFPA->x->coeff[1][0], 10.0, "CD1_1: %f", chip->toFPA->x->coeff[1][0]); 137 137 ok_float(chip->toFPA->x->coeff[0][1], 0.0, "CD1_2: %f", chip->toFPA->x->coeff[0][1]); 138 138 ok_float(chip->toFPA->y->coeff[1][0], 0.0, "CD2_1: %f", chip->toFPA->y->coeff[1][0]); 139 ok_float(chip->toFPA->y->coeff[0][1], 1 .0, "CD2_2: %f", chip->toFPA->y->coeff[0][1]);139 ok_float(chip->toFPA->y->coeff[0][1], 10.0, "CD2_2: %f", chip->toFPA->y->coeff[0][1]); 140 140 141 141 psFree (fpa); -
trunk/psModules/test/astrom/tap_pmAstrometryWCS_DVO3.c
r10824 r10875 49 49 coords.crpix1 = 0.0; 50 50 coords.crpix2 = 0.0; 51 coords.cdelt1 = 1.0/3600 ;52 coords.cdelt2 = 1.0/3600 ;51 coords.cdelt1 = 1.0/3600.0; 52 coords.cdelt2 = 1.0/3600.0; 53 53 coords.pc1_1 = 1.0; 54 54 coords.pc1_2 = 0.0; … … 65 65 pmChip *chip = pmChipAlloc (fpa, NULL); 66 66 67 bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);67 bool status = pmAstromReadWCS (fpa, chip, header1, 10.0); 68 68 69 69 ok (status, "converted WCS keywords to WCS astrometry"); … … 139 139 coords.crpix1 = 0.0; 140 140 coords.crpix2 = 0.0; 141 coords.cdelt1 = 1.0/3600 ;142 coords.cdelt2 = 1.0/3600 ;141 coords.cdelt1 = 1.0/3600.0; 142 coords.cdelt2 = 1.0/3600.0; 143 143 coords.pc1_1 = 0.9; 144 144 coords.pc1_2 = 0.1; … … 156 156 pmChip *chip = pmChipAlloc (fpa, NULL); 157 157 158 bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);158 bool status = pmAstromReadWCS (fpa, chip, header1, 10.0); 159 159 160 160 ok (status, "converted WCS keywords to WCS astrometry"); … … 231 231 coords.crpix1 = 0.0; 232 232 coords.crpix2 = 0.0; 233 coords.cdelt1 = 1.0/3600 ;234 coords.cdelt2 = 1.0/3600 ;233 coords.cdelt1 = 1.0/3600.0; 234 coords.cdelt2 = 1.0/3600.0; 235 235 coords.pc1_1 = 1.0; 236 236 coords.pc1_2 = 0.0; … … 249 249 pmChip *chip = pmChipAlloc (fpa, NULL); 250 250 251 bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);251 bool status = pmAstromReadWCS (fpa, chip, header1, 10.0); 252 252 253 253 ok (status, "converted WCS keywords to WCS astrometry"); … … 324 324 coords.crpix1 = 20.0; 325 325 coords.crpix2 = 50.0; 326 coords.cdelt1 = 1.0/3600 ;327 coords.cdelt2 = 1.0/3600 ;326 coords.cdelt1 = 1.0/3600.0; 327 coords.cdelt2 = 1.0/3600.0; 328 328 coords.pc1_1 = 1.0; 329 329 coords.pc1_2 = 0.0; … … 340 340 pmChip *chip = pmChipAlloc (fpa, NULL); 341 341 342 bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);342 bool status = pmAstromReadWCS (fpa, chip, header1, 10.0); 343 343 344 344 ok (status, "converted WCS keywords to WCS astrometry"); … … 414 414 coords.crpix1 = 50.0; 415 415 coords.crpix2 = -20.0; 416 coords.cdelt1 = 1.0/3600 ;417 coords.cdelt2 = 1.0/3600 ;416 coords.cdelt1 = 1.0/3600.0; 417 coords.cdelt2 = 1.0/3600.0; 418 418 coords.pc1_1 = 0.9; 419 419 coords.pc1_2 = 0.1; … … 431 431 pmChip *chip = pmChipAlloc (fpa, NULL); 432 432 433 bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);433 bool status = pmAstromReadWCS (fpa, chip, header1, 10.0); 434 434 435 435 ok (status, "converted WCS keywords to WCS astrometry"); … … 506 506 coords.crpix1 = 20.0; 507 507 coords.crpix2 = 50.0; 508 coords.cdelt1 = 1.0/3600 ;509 coords.cdelt2 = 1.0/3600 ;508 coords.cdelt1 = 1.0/3600.0; 509 coords.cdelt2 = 1.0/3600.0; 510 510 coords.pc1_1 = 1.0; 511 511 coords.pc1_2 = 0.0; … … 524 524 pmChip *chip = pmChipAlloc (fpa, NULL); 525 525 526 bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);526 bool status = pmAstromReadWCS (fpa, chip, header1, 10.0); 527 527 528 528 ok (status, "converted WCS keywords to WCS astrometry"); … … 530 530 531 531 psMetadata *header2 = psMetadataAlloc(); 532 status = pmAstromWriteWCS (header2, fpa, chip, 0.00 1);532 status = pmAstromWriteWCS (header2, fpa, chip, 0.00001); 533 533 534 534 pmAstromWCS *wcs = pmAstromWCSfromHeader(header2); … … 564 564 bSky->r += 2*M_PI; 565 565 566 ok_float(aSky->r*PM_DEG_RAD, bSky->r*PM_DEG_RAD, "coordinate match: %f vs %f (delta = %f)", aSky->r*PM_DEG_RAD, bSky->r*PM_DEG_RAD, aSky->r*PM_DEG_RAD - bSky->r*PM_DEG_RAD); 567 ok_float(aSky->d*PM_DEG_RAD, bSky->d*PM_DEG_RAD, "coordinate match: %f vs %f (delta = %f)", aSky->d*PM_DEG_RAD, bSky->d*PM_DEG_RAD, aSky->d*PM_DEG_RAD - bSky->d*PM_DEG_RAD); 566 // XXX we are getting round-off errors as a result of the wcs transformation 567 // having terms in units of pix/degree. for now require 10mas on this 568 ok_float_tol(aSky->r*PM_DEG_RAD, bSky->r*PM_DEG_RAD, 0.01/3600.0, "coordinate match: %f vs %f (delta = %f)", aSky->r*PM_DEG_RAD, bSky->r*PM_DEG_RAD, aSky->r*PM_DEG_RAD - bSky->r*PM_DEG_RAD); 569 ok_float_tol(aSky->d*PM_DEG_RAD, bSky->d*PM_DEG_RAD, 0.01/3600.0, "coordinate match: %f vs %f (delta = %f)", aSky->d*PM_DEG_RAD, bSky->d*PM_DEG_RAD, aSky->d*PM_DEG_RAD - bSky->d*PM_DEG_RAD); 568 570 } 569 571 } … … 601 603 602 604 // center coords (R,D) 603 psMetadataAddF 32(header, PS_LIST_TAIL, "CRVAL1", PS_META_REPLACE, "", coords[0].crval1);604 psMetadataAddF 32(header, PS_LIST_TAIL, "CRVAL2", PS_META_REPLACE, "", coords[0].crval2);605 psMetadataAddF64 (header, PS_LIST_TAIL, "CRVAL1", PS_META_REPLACE, "", coords[0].crval1); 606 psMetadataAddF64 (header, PS_LIST_TAIL, "CRVAL2", PS_META_REPLACE, "", coords[0].crval2); 605 607 606 608 // center coords (X,Y) 607 psMetadataAddF 32(header, PS_LIST_TAIL, "CRPIX1", PS_META_REPLACE, "", coords[0].crpix1);608 psMetadataAddF 32(header, PS_LIST_TAIL, "CRPIX2", PS_META_REPLACE, "", coords[0].crpix2);609 psMetadataAddF64 (header, PS_LIST_TAIL, "CRPIX1", PS_META_REPLACE, "", coords[0].crpix1); 610 psMetadataAddF64 (header, PS_LIST_TAIL, "CRPIX2", PS_META_REPLACE, "", coords[0].crpix2); 609 611 610 612 // degrees per pixel 611 psMetadataAddF 32(header, PS_LIST_TAIL, "CDELT1", PS_META_REPLACE, "", coords[0].cdelt1);612 psMetadataAddF 32(header, PS_LIST_TAIL, "CDELT2", PS_META_REPLACE, "", coords[0].cdelt2);613 psMetadataAddF64 (header, PS_LIST_TAIL, "CDELT1", PS_META_REPLACE, "", coords[0].cdelt1); 614 psMetadataAddF64 (header, PS_LIST_TAIL, "CDELT2", PS_META_REPLACE, "", coords[0].cdelt2); 613 615 614 616 // rotation matrix 615 psMetadataAddF 32(header, PS_LIST_TAIL, "PC001001", PS_META_REPLACE, "", coords[0].pc1_1);616 psMetadataAddF 32(header, PS_LIST_TAIL, "PC001002", PS_META_REPLACE, "", coords[0].pc1_2);617 psMetadataAddF 32(header, PS_LIST_TAIL, "PC002001", PS_META_REPLACE, "", coords[0].pc2_1);618 psMetadataAddF 32(header, PS_LIST_TAIL, "PC002002", PS_META_REPLACE, "", coords[0].pc2_2);619 620 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X2Y0", PS_META_REPLACE, "", coords[0].polyterms[0][0]);621 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X1Y1", PS_META_REPLACE, "", coords[0].polyterms[1][0]);622 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X0Y2", PS_META_REPLACE, "", coords[0].polyterms[2][0]);623 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X2Y0", PS_META_REPLACE, "", coords[0].polyterms[0][1]);624 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X1Y1", PS_META_REPLACE, "", coords[0].polyterms[1][1]);625 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X0Y2", PS_META_REPLACE, "", coords[0].polyterms[2][1]);626 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X3Y0", PS_META_REPLACE, "", coords[0].polyterms[3][0]);627 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X2Y1", PS_META_REPLACE, "", coords[0].polyterms[4][0]);628 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X1Y2", PS_META_REPLACE, "", coords[0].polyterms[5][0]);629 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA1X0Y3", PS_META_REPLACE, "", coords[0].polyterms[6][0]);630 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X3Y0", PS_META_REPLACE, "", coords[0].polyterms[3][1]);631 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X2Y1", PS_META_REPLACE, "", coords[0].polyterms[4][1]);632 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X1Y2", PS_META_REPLACE, "", coords[0].polyterms[5][1]);633 psMetadataAddF 32(header, PS_LIST_TAIL, "PCA2X0Y3", PS_META_REPLACE, "", coords[0].polyterms[6][1]);617 psMetadataAddF64 (header, PS_LIST_TAIL, "PC001001", PS_META_REPLACE, "", coords[0].pc1_1); 618 psMetadataAddF64 (header, PS_LIST_TAIL, "PC001002", PS_META_REPLACE, "", coords[0].pc1_2); 619 psMetadataAddF64 (header, PS_LIST_TAIL, "PC002001", PS_META_REPLACE, "", coords[0].pc2_1); 620 psMetadataAddF64 (header, PS_LIST_TAIL, "PC002002", PS_META_REPLACE, "", coords[0].pc2_2); 621 622 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X2Y0", PS_META_REPLACE, "", coords[0].polyterms[0][0]); 623 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X1Y1", PS_META_REPLACE, "", coords[0].polyterms[1][0]); 624 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X0Y2", PS_META_REPLACE, "", coords[0].polyterms[2][0]); 625 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X2Y0", PS_META_REPLACE, "", coords[0].polyterms[0][1]); 626 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X1Y1", PS_META_REPLACE, "", coords[0].polyterms[1][1]); 627 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X0Y2", PS_META_REPLACE, "", coords[0].polyterms[2][1]); 628 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X3Y0", PS_META_REPLACE, "", coords[0].polyterms[3][0]); 629 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X2Y1", PS_META_REPLACE, "", coords[0].polyterms[4][0]); 630 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X1Y2", PS_META_REPLACE, "", coords[0].polyterms[5][0]); 631 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA1X0Y3", PS_META_REPLACE, "", coords[0].polyterms[6][0]); 632 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X3Y0", PS_META_REPLACE, "", coords[0].polyterms[3][1]); 633 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X2Y1", PS_META_REPLACE, "", coords[0].polyterms[4][1]); 634 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X1Y2", PS_META_REPLACE, "", coords[0].polyterms[5][1]); 635 psMetadataAddF64 (header, PS_LIST_TAIL, "PCA2X0Y3", PS_META_REPLACE, "", coords[0].polyterms[6][1]); 634 636 635 637 psMetadataAddS32 (header, PS_LIST_TAIL, "NPLYTERM", PS_META_REPLACE, "", coords[0].Npolyterms);
Note:
See TracChangeset
for help on using the changeset viewer.
