IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10786


Ignore:
Timestamp:
Dec 16, 2006, 11:48:15 PM (20 years ago)
Author:
magnier
Message:

finished tests for non-linear WCS conversions

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

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/astrom

    • Property svn:ignore
      •  

        old new  
        99tap_pmAstrometryWCS_DVO2
        1010tap_pmAstrometryWCS_DVO3
         11tap_pmAstrometryWCS_DVO
  • trunk/psModules/test/astrom/.cvsignore

    r10711 r10786  
    99tap_pmAstrometryWCS_DVO2
    1010tap_pmAstrometryWCS_DVO3
     11tap_pmAstrometryWCS_DVO
  • trunk/psModules/test/astrom/Makefile.am

    r10711 r10786  
    1 
    2 
    31AM_CPPFLAGS = \
    42        $(SRCINC) \
     
    2018
    2119test: check
     20
     21tests: $(check_PROGRAMS)
     22        $(top_srcdir)/test/test.pl
     23
  • trunk/psModules/test/astrom/tap_pmAstrometryWCS.c

    r10615 r10786  
    99int main (void)
    1010{
     11    plan_tests(33);
    1112
    12     pmModelGroupInit ();
    13 
    14     plan_tests(240);
    15 
    16     diag("pmAstrometryWCS tests");
     13    note("pmAstrometryWCS tests");
    1714
    1815    {
    19         diag("test pmAstromReadWCS");
     16        note("test pmAstromReadWCS");
    2017        psMemId id = psMemGetId();
    2118
     
    5148        // toFPA carries pixel scale (pixels per micron)
    5249        // toTPA carries plate scale (microns per arcsecond)
    53         bool status = pmAstromReadWCS (fpa, chip, header, 25.0*PS_RAD_DEG/3600.0, false);
     50        bool status = pmAstromReadWCS (fpa, chip, header, 25.0*PM_RAD_DEG/3600.0, false);
    5451        ok (status, "converted WCS keywords to FPA astrometry");
    5552        skip_start (!status, 1, "*** WCS Conversion FAILS *** : skipping related tests");
     
    5855
    5956        // make these tests double
    60         ok_float(fpa->toSky->R*PS_DEG_RAD, 0.0, "projection center RA %f", fpa->toSky->R*PS_DEG_RAD);
    61         ok_float(fpa->toSky->R*PS_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PS_DEG_RAD);
     57        ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center RA %f", fpa->toSky->R*PM_DEG_RAD);
     58        ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PM_DEG_RAD);
    6259
    63         ok_float(fpa->toSky->Xs, 25.0*PS_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Xs);
    64         ok_float(fpa->toSky->Ys, 25.0*PS_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Ys);
     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);
    6562
    6663        ok_float(fpa->toTPA->x->coeff[1][0][0][0], 0.04, "TP scale (mm per pixel): %f", fpa->toTPA->x->coeff[1][0][0][0]);
     
    8481
    8582    {
    86         diag("test pmAstromReadWCS");
     83        note("test pmAstromReadWCS");
    8784        psMemId id = psMemGetId();
    88 
    89         psPlaneTransform *wcsTrans = psPlaneTransformAlloc (1, 1);
    90         wcsTrans->x->coeff[0][0] = 0.0;
    91         wcsTrans->y->coeff[0][0] = 0.0;
    92         wcsTrans->x->coeff[1][0] = 1.0;
    93         wcsTrans->x->coeff[0][1] = 0.0;
    94         wcsTrans->y->coeff[1][0] = 0.0;
    95         wcsTrans->y->coeff[0][1] = 1.0;
    96 
    97 
    9885
    9986        // construct a header with a simple set of WCS values
     
    128115        // toFPA carries pixel scale (pixels per micron)
    129116        // toTPA carries plate scale (microns per arcsecond)
    130         bool status = pmAstromReadWCS (fpa, chip, header, 25.0*PS_RAD_DEG/3600.0, false);
     117        bool status = pmAstromReadWCS (fpa, chip, header, 25.0*PM_RAD_DEG/3600.0, false);
    131118        ok (status, "converted WCS keywords to FPA astrometry");
    132119        skip_start (!status, 1, "*** WCS Conversion FAILS *** : skipping related tests");
     
    135122
    136123        // make these tests double
    137         ok_float(fpa->toSky->R*PS_DEG_RAD, 0.0, "projection center RA %f", fpa->toSky->R*PS_DEG_RAD);
    138         ok_float(fpa->toSky->R*PS_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PS_DEG_RAD);
     124        ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center RA %f", fpa->toSky->R*PM_DEG_RAD);
     125        ok_float(fpa->toSky->R*PM_DEG_RAD, 0.0, "projection center DEC %f", fpa->toSky->R*PM_DEG_RAD);
    139126
    140         ok_float(fpa->toSky->Xs, 25.0*PS_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Xs);
    141         ok_float(fpa->toSky->Ys, 25.0*PS_RAD_DEG/3600.0, "projection X scale %f", fpa->toSky->Ys);
     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);
    142129
    143130        ok_float(fpa->toTPA->x->coeff[1][0][0][0], 0.04, "TP scale (mm per pixel): %f", fpa->toTPA->x->coeff[1][0][0][0]);
     
    152139        ok_float(chip->toFPA->y->coeff[0][1], 1.0, "CD2_2: %f", chip->toFPA->y->coeff[0][1]);
    153140
    154         // apply both systems to real data:
    155 
    156 
    157141        psFree (fpa);
    158142        psFree (chip);
  • trunk/psModules/test/astrom/tap_pmAstrometryWCS_DVO.c

    r10775 r10786  
    2727int main (void)
    2828{
    29     plan_tests(984);
    30 
    31     // diag("pmAstrometryWCS tests compared with DVO coords routines");
    32     // diag("this file tests pmAstromWCS <-> Header representations");
     29    plan_tests(992);
     30
     31    note("pmAstrometryWCS tests compared with DVO coords routines");
     32    note("this file tests pmAstromWCS <-> Header representations");
    3333
    3434    test1in();
     
    4444void test3in()
    4545{
    46     // diag("test pmAstromWCStoHeader");
     46    note("test pmAstromWCStoHeader");
    4747    psMemId id = psMemGetId();
    4848
     
    7676    pmAstromWCS *wcs2 = pmAstromWCSfromHeader(header2);
    7777
    78     psMetadataConfigWrite (header1, "head1.md");
    79     psMetadataConfigWrite (header2, "head2.md");
    80 
    8178    ok (wcs2 != NULL, "converted WCS keywords to WCS astrometry");
    8279    skip_start (wcs2 == NULL, 1, "*** WCS Conversion FAILS *** : skipping related tests");
     
    122119void test2in()
    123120{
    124     // diag("test pmAstromWCStoHeader");
     121    note("test pmAstromWCStoHeader");
    125122    psMemId id = psMemGetId();
    126123
     
    198195void test1in()
    199196{
    200     // diag("test pmAstromWCStoHeader");
     197    note("test pmAstromWCStoHeader");
    201198    psMemId id = psMemGetId();
    202199
     
    271268void test3 ()
    272269{
    273     // diag("test pmAstromWCSfromHeader ");
     270    note("test pmAstromWCSfromHeader ");
    274271    psMemId id = psMemGetId();
    275272
     
    332329void test2 ()
    333330{
    334     // diag("test pmAstromWCSfromHeader");
     331    note("test pmAstromWCSfromHeader");
    335332    psMemId id = psMemGetId();
    336333
     
    391388void test1()
    392389{
    393     // diag("test pmAstromWCSfromHeader");
     390    note("test pmAstromWCSfromHeader");
    394391    psMemId id = psMemGetId();
    395392
     
    450447void testA()
    451448{
    452     // diag("test coord allocs");
     449    note("test coord allocs");
    453450    psMemId id = psMemGetId();
    454451
     
    460457void testB()
    461458{
    462     // diag("test coord allocs");
     459    note("test coord allocs");
    463460    psMemId id = psMemGetId();
    464461
     
    525522    plan_tests(0);
    526523
    527     // diag("pmAstrometryWCS tests compared with DVO coords routines : SKIPPED (libdvo not available)");
     524    note("pmAstrometryWCS tests compared with DVO coords routines : SKIPPED (libdvo not available)");
    528525
    529526    return exit_status();
  • trunk/psModules/test/astrom/tap_pmAstrometryWCS_DVO2.c

    r10775 r10786  
    2424int main (void)
    2525{
    26     plan_tests(1472);
    27 
    28     diag("pmAstromReadWCS tests compared with DVO coords routines");
     26    plan_tests(1483);
     27
     28    note("pmAstromReadWCS tests compared with DVO coords routines");
    2929
    3030    test1();
     
    4141void test1()
    4242{
    43     diag("test pmAstromReadWCS");
     43    note("test pmAstromReadWCS");
    4444    psMemId id = psMemGetId();
    4545
     
    112112void test2()
    113113{
    114     diag("test pmAstromReadWCS");
     114    note("test pmAstromReadWCS");
    115115    psMemId id = psMemGetId();
    116116
     
    183183void test3()
    184184{
    185     diag("test pmAstromReadWCS");
     185    note("test pmAstromReadWCS");
    186186    psMemId id = psMemGetId();
    187187
     
    257257void test1x()
    258258{
    259     diag("test pmAstromReadWCS");
     259    note("test pmAstromReadWCS");
    260260    psMemId id = psMemGetId();
    261261
     
    328328void test2x()
    329329{
    330     diag("test pmAstromReadWCS");
     330    note("test pmAstromReadWCS");
    331331    psMemId id = psMemGetId();
    332332
     
    399399void test3x()
    400400{
    401     diag("test pmAstromReadWCS");
     401    note("test pmAstromReadWCS");
    402402    psMemId id = psMemGetId();
    403403
     
    473473void test3inv()
    474474{
    475     diag("test the inversion of the non-linear polynomial for toFPA -> fromFPA in pmAstromReadWCS");
    476     diag("note that the tolerance for these tests are rather loose");
    477     diag("a 2nd order polynomial is not a great approximate to 1 over a 2nd order polynomial");
    478     diag("unless the non-linear terms are quite small");
     475    note("test the inversion of the non-linear polynomial for toFPA -> fromFPA in pmAstromReadWCS");
     476    note("note that the tolerance for these tests are rather loose");
     477    note("a 2nd order polynomial is not a great approximate to 1 over a 2nd order polynomial");
     478    note("unless the non-linear terms are quite small");
    479479    psMemId id = psMemGetId();
    480480
     
    621621    plan_tests(0);
    622622
    623     diag("pmAstrometryWCS tests compared with DVO coords routines : SKIPPED (libdvo not available)");
     623    note("pmAstrometryWCS tests compared with DVO coords routines : SKIPPED (libdvo not available)");
    624624
    625625    return exit_status();
  • trunk/psModules/test/astrom/tap_pmAstrometryWCS_DVO3.c

    r10775 r10786  
    2020void test2x(); // small rotation with central offset
    2121void test3x(); // 2nd order term with central offset
    22 void test3inv(); // 2nd order term with central offset
    2322
    2423int main (void)
    2524{
    26     plan_tests(984);
    27 
    28     diag("pmAstromWriteWCS tests compared with DVO coords routines");
    29 
    30     //    test1();
    31     //    test2();
    32     //    test3();
    33     //    test1x();
     25    plan_tests(991);
     26
     27    note("pmAstromWriteWCS tests compared with DVO coords routines");
     28
     29    test1();
     30    test2();
     31    test3();
     32    test1x();
    3433    test2x();
    35     //    test3x();
    36     //    test3inv();
     34    test3x();
    3735
    3836    return exit_status();
     
    4139void test1()
    4240{
    43     diag("test pmAstromReadWCS");
     41    note("test pmAstromReadWCS");
    4442    psMemId id = psMemGetId();
    4543
     
    7371
    7472    psMetadata *header2 = psMetadataAlloc();
    75     status = pmAstromWriteWCS (header2, fpa, chip);
     73    status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
    7674    pmAstromWCS *wcs = pmAstromWCSfromHeader(header2);
    7775
     
    131129void test2()
    132130{
    133     diag("test pmAstromReadWCS");
     131    note("test pmAstromReadWCS");
    134132    psMemId id = psMemGetId();
    135133
     
    165163
    166164    psMetadata *header2 = psMetadataAlloc();
    167     status = pmAstromWriteWCS (header2, fpa, chip);
     165    status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
    168166    psMetadataConfigWrite (header2, "head2.md");
    169167
     
    225223void test3()
    226224{
    227     diag("test pmAstromReadWCS");
     225    note("test pmAstromReadWCS");
    228226    psMemId id = psMemGetId();
    229227
     
    260258
    261259    psMetadata *header2 = psMetadataAlloc();
    262     status = pmAstromWriteWCS (header2, fpa, chip);
     260    status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
    263261    psMetadataConfigWrite (header2, "head2.md");
    264262
     
    320318void test1x()
    321319{
    322     diag("test pmAstromReadWCS");
     320    note("test pmAstromReadWCS");
    323321    psMemId id = psMemGetId();
    324322
     
    352350
    353351    psMetadata *header2 = psMetadataAlloc();
    354     status = pmAstromWriteWCS (header2, fpa, chip);
     352    status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
    355353    pmAstromWCS *wcs = pmAstromWCSfromHeader(header2);
    356354
     
    410408void test2x()
    411409{
    412     diag("test pmAstromReadWCS");
     410    note("test pmAstromReadWCS");
    413411    psMemId id = psMemGetId();
    414412
     
    418416    coords.crval1 = 0.0;
    419417    coords.crval2 = 0.0;
    420     coords.crpix1 = 20.0;
    421     coords.crpix2 = 50.0;
     418    coords.crpix1 = 50.0;
     419    coords.crpix2 = -20.0;
    422420    coords.cdelt1 = 1.0/3600;
    423421    coords.cdelt2 = 1.0/3600;
     
    444442
    445443    psMetadata *header2 = psMetadataAlloc();
    446     status = pmAstromWriteWCS (header2, fpa, chip);
     444    status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
    447445    psMetadataConfigWrite (header2, "head2.md");
    448446
     
    504502void test3x()
    505503{
    506     diag("test pmAstromReadWCS");
     504    note("test pmAstromReadWCS");
    507505    psMemId id = psMemGetId();
    508506
     
    539537
    540538    psMetadata *header2 = psMetadataAlloc();
    541     status = pmAstromWriteWCS (header2, fpa, chip);
     539    status = pmAstromWriteWCS (header2, fpa, chip, 0.001);
    542540    psMetadataConfigWrite (header2, "head2.md");
    543541
     
    654652    plan_tests(0);
    655653
    656     diag("pmAstrometryWCS tests compared with DVO coords routines : SKIPPED (libdvo not available)");
     654    note("pmAstrometryWCS tests compared with DVO coords routines : SKIPPED (libdvo not available)");
    657655
    658656    return exit_status();
Note: See TracChangeset for help on using the changeset viewer.