Skip to content

Commit

Permalink
Merge pull request #656 from busstoptaktik/selftest-removal-hijk
Browse files Browse the repository at this point in the history
Remove selftests from projection files starting with h, i, j, k
  • Loading branch information
busstoptaktik committed Nov 12, 2017
2 parents 451dec5 + 5b0b6cb commit d332eb7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 369 deletions.
44 changes: 1 addition & 43 deletions src/PJ_hammer.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,46 +72,4 @@ PJ *PROJECTION(hammer) {
}


#ifndef PJ_SELFTEST
int pj_hammer_selftest (void) {return 0;}
#else

int pj_hammer_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char s_args[] = {"+proj=hammer +a=6400000 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY s_fwd_expect[] = {
{ 223373.78870324057, 111703.90739776699},
{ 223373.78870324057, -111703.90739776699},
{-223373.78870324057, 111703.90739776699},
{-223373.78870324057, -111703.90739776699},
};

XY inv_in[] = {
{ 200, 100},
{ 200,-100},
{-200, 100},
{-200,-100}
};

LP s_inv_expect[] = {
{ 0.001790493109965961, 0.00089524655487369749},
{ 0.001790493109965961, -0.00089524655487369749},
{-0.001790493109965961, 0.00089524655487369749},
{-0.001790493109965961, -0.00089524655487369749},
};

return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}


#endif
int pj_hammer_selftest (void) {return 10000;}
52 changes: 1 addition & 51 deletions src/PJ_hatano.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,54 +79,4 @@ PJ *PROJECTION(hatano) {
return P;
}

#ifndef PJ_SELFTEST
int pj_hatano_selftest (void) {return 0;}
#else

int pj_hatano_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char s_args[] = {"+proj=hatano +a=6400000 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY s_fwd_expect[] = {
{ 189878.87894652804, 131409.8024406255
},
{ 189881.08195244463, -131409.14227607418
},
{-189878.87894652804, 131409.8024406255
},
{-189881.08195244463, -131409.14227607418
},
};

XY inv_in[] = {
{ 200, 100},
{ 200,-100},
{-200, 100},
{-200,-100}
};

LP s_inv_expect[] = {
{ 0.0021064624821817597, 0.00076095689425791926
},
{ 0.0021064624821676096, -0.00076095777439265377
},
{-0.0021064624821817597, 0.00076095689425791926
},
{-0.0021064624821676096, -0.00076095777439265377
},
};

return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}


#endif
int pj_hatano_selftest (void) {return 10000;}
119 changes: 2 additions & 117 deletions src/PJ_healpix.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,120 +669,5 @@ PJ *PROJECTION(rhealpix) {
}


#ifndef PJ_SELFTEST
int pj_healpix_selftest (void) {return 0;}
#else

int pj_healpix_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char e_args[] = {"+proj=healpix +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
char s_args[] = {"+proj=healpix +R=6400000 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY e_fwd_expect[] = {
{ 222390.10394923863, 130406.58866448226},
{ 222390.10394923863, -130406.58866448054},
{-222390.10394923863, 130406.58866448226},
{-222390.10394923863, -130406.58866448054},
};

XY s_fwd_expect[] = {
{ 223402.14425527418, 131588.04444199943},
{ 223402.14425527418, -131588.04444199943},
{-223402.14425527418, 131588.04444199943},
{-223402.14425527418, -131588.04444199943},
};

XY inv_in[] = {
{ 200, 100},
{ 200,-100},
{-200, 100},
{-200,-100}
};

LP e_inv_expect[] = {
{ 0.0017986411845524453, 0.00076679453057823619},
{ 0.0017986411845524453, -0.00076679453057823619},
{-0.0017986411845524453, 0.00076679453057823619},
{-0.0017986411845524453, -0.00076679453057823619},
};

LP s_inv_expect[] = {
{ 0.0017904931097838226, 0.00075990887733981202},
{ 0.0017904931097838226, -0.00075990887733981202},
{-0.0017904931097838226, 0.00075990887733981202},
{-0.0017904931097838226, -0.00075990887733981202},
};

return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}


#endif

#ifndef PJ_SELFTEST
int pj_rhealpix_selftest (void) {return 0;}
#else

int pj_rhealpix_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char e_args[] = {"+proj=rhealpix +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
char s_args[] = {"+proj=rhealpix +R=6400000 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY e_fwd_expect[] = {
{ 222390.10394923863, 130406.58866448226},
{ 222390.10394923863, -130406.58866448054},
{-222390.10394923863, 130406.58866448226},
{-222390.10394923863, -130406.58866448054},
};

XY s_fwd_expect[] = {
{ 223402.14425527418, 131588.04444199943},
{ 223402.14425527418, -131588.04444199943},
{-223402.14425527418, 131588.04444199943},
{-223402.14425527418, -131588.04444199943},
};

XY inv_in[] = {
{ 200, 100},
{ 200,-100},
{-200, 100},
{-200,-100}
};

LP e_inv_expect[] = {
{ 0.0017986411845524453, 0.00076679453057823619},
{ 0.0017986411845524453, -0.00076679453057823619},
{-0.0017986411845524453, 0.00076679453057823619},
{-0.0017986411845524453, -0.00076679453057823619},
};

LP s_inv_expect[] = {
{ 0.0017904931097838226, 0.00075990887733981202},
{ 0.0017904931097838226, -0.00075990887733981202},
{-0.0017904931097838226, 0.00075990887733981202},
{-0.0017904931097838226, -0.00075990887733981202},
};

return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
}


#endif
int pj_healpix_selftest (void) {return 10000;}
int pj_rhealpix_selftest (void) {return 10000;}
44 changes: 1 addition & 43 deletions src/PJ_igh.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,46 +222,4 @@ PJ *PROJECTION(igh) {
}


#ifndef PJ_SELFTEST
int pj_igh_selftest (void) {return 0;}
#else

int pj_igh_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char s_args[] = {"+proj=igh +a=6400000 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY s_fwd_expect[] = {
{ 223878.49745627123, 111701.07212763709},
{ 223708.37131305804, -111701.07212763709},
{-222857.74059699223, 111701.07212763709},
{-223027.86674020503, -111701.07212763709},
};

XY inv_in[] = {
{ 200, 100},
{ 200,-100},
{-200, 100},
{-200,-100}
};

LP s_inv_expect[] = {
{ 0.001790489447892545, 0.00089524655489191132},
{ 0.0017904906685957927, -0.00089524655489191132},
{-0.001790496772112032, 0.00089524655489191132},
{-0.0017904955514087843, -0.00089524655489191132},
};

return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
}


#endif
int pj_igh_selftest (void) {return 10000;}
44 changes: 1 addition & 43 deletions src/PJ_imw_p.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,46 +212,4 @@ PJ *PROJECTION(imw_p) {
}


#ifndef PJ_SELFTEST
int pj_imw_p_selftest (void) {return 0;}
#else

int pj_imw_p_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char e_args[] = {"+proj=imw_p +ellps=GRS80 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY e_fwd_expect[] = {
{ 222588.4411393762, 55321.128653809537},
{ 222756.90637768712, -165827.58428832365},
{-222588.4411393762, 55321.128653809537},
{-222756.90637768712, -165827.58428832365},
};

XY inv_in[] = {
{ 200, 100},
{ 200,-100},
{-200, 100},
{-200,-100}
};

LP e_inv_expect[] = {
{ 0.0017966991379592214, 0.50090492361427374},
{ 0.0017966979081574697, 0.49909507588689922},
{-0.0017966991379592214, 0.50090492361427374},
{-0.0017966979081574697, 0.49909507588689922},
};

return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
}


#endif
int pj_imw_p_selftest (void) {return 10000;}
30 changes: 1 addition & 29 deletions src/PJ_isea.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,32 +1148,4 @@ PJ *PROJECTION(isea) {
}


#ifndef PJ_SELFTEST
int pj_isea_selftest (void) {return 0;}
#else

int pj_isea_selftest (void) {
double tolerance_lp = 1e-10;
double tolerance_xy = 1e-7;

char s_args[] = {"+proj=isea +a=6400000 +lat_1=0.5 +lat_2=2"};

LP fwd_in[] = {
{ 2, 1},
{ 2,-1},
{-2, 1},
{-2,-1}
};

XY s_fwd_expect[] = {
{-1097074.9480224741, 3442909.3090371834},
{-1097074.9482647954, 3233611.7285857084},
{-1575486.3536415542, 3442168.3420281881},
{-1575486.353880283, 3234352.6955947056},
};

return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
}


#endif
int pj_isea_selftest (void) {return 10000;}
Loading

0 comments on commit d332eb7

Please sign in to comment.