IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10875


Ignore:
Timestamp:
Jan 1, 2007, 11:06:12 AM (20 years ago)
Author:
magnier
Message:

updated tests

Location:
trunk/psModules/test/astrom
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/astrom/tap_pmAstrometryWCS.c

    r10824 r10875  
    4646        pmChip *chip = pmChipAlloc (NULL, "test");
    4747
    48         // toFPA carries pixel scale (pixels per micron)
    49         // toTPA 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);
    5151        ok (status, "converted WCS keywords to FPA astrometry");
    5252        skip_start (!status, 1, "*** WCS Conversion FAILS *** : skipping related tests");
     
    5858        ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PM_DEG_RAD);
    5959
    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);
    6262
    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]);
    6565
    6666        ok_float(chip->toFPA->x->coeff[0][0], 0.0, "ref pixel X: %f", chip->toFPA->x->coeff[0][0]);
    6767        ok_float(chip->toFPA->y->coeff[0][0], 0.0, "ref pixel Y: %f", chip->toFPA->y->coeff[0][0]);
    6868
    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]);
    7070        ok_float(chip->toFPA->x->coeff[0][1], 0.0, "CD1_2: %f", chip->toFPA->x->coeff[0][1]);
    7171        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]);
    7373
    7474        psFree (fpa);
     
    115115        // toFPA carries pixel scale (pixels per micron)
    116116        // 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);
    118118        ok (status, "converted WCS keywords to FPA astrometry");
    119119        skip_start (!status, 1, "*** WCS Conversion FAILS *** : skipping related tests");
     
    125125        ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PM_DEG_RAD);
    126126
    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);
    129129
    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]);
    132132
    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]);
    135135
    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]);
    137137        ok_float(chip->toFPA->x->coeff[0][1], 0.0, "CD1_2: %f", chip->toFPA->x->coeff[0][1]);
    138138        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]);
    140140
    141141        psFree (fpa);
  • trunk/psModules/test/astrom/tap_pmAstrometryWCS_DVO3.c

    r10824 r10875  
    4949    coords.crpix1 = 0.0;
    5050    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;
    5353    coords.pc1_1  = 1.0;
    5454    coords.pc1_2  = 0.0;
     
    6565    pmChip *chip = pmChipAlloc (fpa, NULL);
    6666
    67     bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);
     67    bool status = pmAstromReadWCS (fpa, chip, header1, 10.0);
    6868
    6969    ok (status, "converted WCS keywords to WCS astrometry");
     
    139139    coords.crpix1 = 0.0;
    140140    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;
    143143    coords.pc1_1  = 0.9;
    144144    coords.pc1_2  = 0.1;
     
    156156    pmChip *chip = pmChipAlloc (fpa, NULL);
    157157
    158     bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);
     158    bool status = pmAstromReadWCS (fpa, chip, header1, 10.0);
    159159
    160160    ok (status, "converted WCS keywords to WCS astrometry");
     
    231231    coords.crpix1 = 0.0;
    232232    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;
    235235    coords.pc1_1  = 1.0;
    236236    coords.pc1_2  = 0.0;
     
    249249    pmChip *chip = pmChipAlloc (fpa, NULL);
    250250
    251     bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);
     251    bool status = pmAstromReadWCS (fpa, chip, header1, 10.0);
    252252
    253253    ok (status, "converted WCS keywords to WCS astrometry");
     
    324324    coords.crpix1 = 20.0;
    325325    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;
    328328    coords.pc1_1  = 1.0;
    329329    coords.pc1_2  = 0.0;
     
    340340    pmChip *chip = pmChipAlloc (fpa, NULL);
    341341
    342     bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);
     342    bool status = pmAstromReadWCS (fpa, chip, header1, 10.0);
    343343
    344344    ok (status, "converted WCS keywords to WCS astrometry");
     
    414414    coords.crpix1 = 50.0;
    415415    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;
    418418    coords.pc1_1  = 0.9;
    419419    coords.pc1_2  = 0.1;
     
    431431    pmChip *chip = pmChipAlloc (fpa, NULL);
    432432
    433     bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);
     433    bool status = pmAstromReadWCS (fpa, chip, header1, 10.0);
    434434
    435435    ok (status, "converted WCS keywords to WCS astrometry");
     
    506506    coords.crpix1 = 20.0;
    507507    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;
    510510    coords.pc1_1  = 1.0;
    511511    coords.pc1_2  = 0.0;
     
    524524    pmChip *chip = pmChipAlloc (fpa, NULL);
    525525
    526     bool status = pmAstromReadWCS (fpa, chip, header1, PM_RAD_DEG*10.0/3600.0);
     526    bool status = pmAstromReadWCS (fpa, chip, header1, 10.0);
    527527
    528528    ok (status, "converted WCS keywords to WCS astrometry");
     
    530530
    531531    psMetadata *header2 = psMetadataAlloc();
    532     status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
     532    status = pmAstromWriteWCS (header2, fpa, chip, 0.00001);
    533533
    534534    pmAstromWCS *wcs = pmAstromWCSfromHeader(header2);
     
    564564                bSky->r += 2*M_PI;
    565565
    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);
    568570        }
    569571    }
     
    601603
    602604    // center coords (R,D)
    603     psMetadataAddF32 (header, PS_LIST_TAIL, "CRVAL1", PS_META_REPLACE, "", coords[0].crval1);
    604     psMetadataAddF32 (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);
    605607
    606608    // center coords (X,Y)
    607     psMetadataAddF32 (header, PS_LIST_TAIL, "CRPIX1", PS_META_REPLACE, "", coords[0].crpix1);
    608     psMetadataAddF32 (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);
    609611
    610612    // degrees per pixel
    611     psMetadataAddF32 (header, PS_LIST_TAIL, "CDELT1",  PS_META_REPLACE, "", coords[0].cdelt1);
    612     psMetadataAddF32 (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);
    613615
    614616    // rotation matrix
    615     psMetadataAddF32 (header, PS_LIST_TAIL, "PC001001", PS_META_REPLACE, "", coords[0].pc1_1);
    616     psMetadataAddF32 (header, PS_LIST_TAIL, "PC001002", PS_META_REPLACE, "", coords[0].pc1_2);
    617     psMetadataAddF32 (header, PS_LIST_TAIL, "PC002001", PS_META_REPLACE, "", coords[0].pc2_1);
    618     psMetadataAddF32 (header, PS_LIST_TAIL, "PC002002", PS_META_REPLACE, "", coords[0].pc2_2);
    619 
    620     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X2Y0", PS_META_REPLACE, "", coords[0].polyterms[0][0]);
    621     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X1Y1", PS_META_REPLACE, "", coords[0].polyterms[1][0]);
    622     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X0Y2", PS_META_REPLACE, "", coords[0].polyterms[2][0]);
    623     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA2X2Y0", PS_META_REPLACE, "", coords[0].polyterms[0][1]);
    624     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA2X1Y1", PS_META_REPLACE, "", coords[0].polyterms[1][1]);
    625     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA2X0Y2", PS_META_REPLACE, "", coords[0].polyterms[2][1]);
    626     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X3Y0", PS_META_REPLACE, "", coords[0].polyterms[3][0]);
    627     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X2Y1", PS_META_REPLACE, "", coords[0].polyterms[4][0]);
    628     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X1Y2", PS_META_REPLACE, "", coords[0].polyterms[5][0]);
    629     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA1X0Y3", PS_META_REPLACE, "", coords[0].polyterms[6][0]);
    630     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA2X3Y0", PS_META_REPLACE, "", coords[0].polyterms[3][1]);
    631     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA2X2Y1", PS_META_REPLACE, "", coords[0].polyterms[4][1]);
    632     psMetadataAddF32 (header, PS_LIST_TAIL, "PCA2X1Y2", PS_META_REPLACE, "", coords[0].polyterms[5][1]);
    633     psMetadataAddF32 (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]);
    634636
    635637    psMetadataAddS32 (header, PS_LIST_TAIL, "NPLYTERM", PS_META_REPLACE, "", coords[0].Npolyterms);
Note: See TracChangeset for help on using the changeset viewer.