diff --git a/src/bitmap.c b/src/bitmap.c index 6373aca..094bcda 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -201,7 +201,7 @@ hpix_bmp_projection_trace(const hpix_bmp_projection_t * proj, } hpix_pixel_num_t pixel_idx = - angles_to_pixel_fn(nside, theta, phi); + angles_to_pixel_fn(hpix_map_resolution(map), theta, phi); if(pixels[pixel_idx] > -1.6e+30) *line_ptr = pixels[pixel_idx]; else @@ -214,14 +214,17 @@ hpix_bmp_projection_trace(const hpix_bmp_projection_t * proj, if(min_value || max_value) { if(min_value) - *min_value = FLT_MAX; + *min_value = DBL_MAX; if(max_value) - *max_value = FLT_MIN; + *max_value = -DBL_MAX; double * bitmap_ptr = bitmap; for(size_t idx = 0; idx < num_of_pixels; ++idx, ++bitmap_ptr) { + if(isnan(*bitmap_ptr) || isinf(*bitmap_ptr)) + continue; + if(min_value && *min_value > *bitmap_ptr) *min_value = *bitmap_ptr; if(max_value && *max_value < *bitmap_ptr) diff --git a/src/hpixlib/hpix.h b/src/hpixlib/hpix.h index ee73176..fe93c8b 100644 --- a/src/hpixlib/hpix.h +++ b/src/hpixlib/hpix.h @@ -147,6 +147,9 @@ double * hpix_map_pixels(const hpix_map_t * map); size_t hpix_map_num_of_pixels(const hpix_map_t * map); +void hpix_init_resolution_from_nside(hpix_nside_t nside, + hpix_resolution_t * resolution); + const hpix_resolution_t * hpix_map_resolution(const hpix_map_t * map); /* Functions implemented in integer_functions.c */ @@ -225,16 +228,16 @@ hpix_save_fits_pol_map(const char * file_name, void hpix_angles_to_vector(double theta, double phi, hpix_vector_t * vector); -typedef hpix_pixel_num_t hpix_angles_to_pixel_fn_t(hpix_nside_t, - double, double); +typedef hpix_pixel_num_t hpix_angles_to_pixel_fn_t(const hpix_resolution_t *, + double, double); -hpix_pixel_num_t hpix_angles_to_ring_pixel(hpix_nside_t nside, - double theta, - double phi); +hpix_pixel_num_t hpix_angles_to_ring_pixel(const hpix_resolution_t * resolution, + double theta, + double phi); -hpix_pixel_num_t hpix_angles_to_nest_pixel(hpix_nside_t nside, - double theta, - double phi); +hpix_pixel_num_t hpix_angles_to_nest_pixel(const hpix_resolution_t * resolution, + double theta, + double phi); void hpix_vector_to_angles(const hpix_vector_t * vector, double * theta, double * phi); @@ -242,31 +245,33 @@ void hpix_vector_to_angles(const hpix_vector_t * vector, typedef hpix_pixel_num_t hpix_vector_to_pixel_fn_t(hpix_nside_t, const hpix_vector_t *); -hpix_pixel_num_t hpix_vector_to_ring_pixel(hpix_nside_t nside, +hpix_pixel_num_t hpix_vector_to_ring_pixel(const hpix_resolution_t * resolution, const hpix_vector_t * vector); -hpix_pixel_num_t hpix_vector_to_nest_pixel(hpix_nside_t nside, +hpix_pixel_num_t hpix_vector_to_nest_pixel(const hpix_resolution_t * resolution, const hpix_vector_t * vector); typedef void hpix_pixel_to_angles(hpix_nside_t, hpix_pixel_num_t, double *, double *); -void hpix_ring_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, - double * theta, double * phi); +void hpix_ring_pixel_to_angles(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel, + double * theta, double * phi); -void hpix_nest_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, - double * theta, double * phi); +void hpix_nest_pixel_to_angles(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel, + double * theta, double * phi); typedef void hpix_pixel_to_vector(hpix_nside_t, hpix_pixel_num_t, hpix_vector_t * vector); -void hpix_ring_pixel_to_vector(hpix_nside_t nside, - hpix_pixel_num_t pixel_index, - hpix_vector_t * vector); +void hpix_ring_pixel_to_vector(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel_index, + hpix_vector_t * vector); -void hpix_nest_pixel_to_vector(hpix_nside_t nside, - hpix_pixel_num_t pixel_index, - hpix_vector_t * vector); +void hpix_nest_pixel_to_vector(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel_index, + hpix_vector_t * vector); /* Functions implemented in bitmap.c */ diff --git a/src/positions.c b/src/positions.c index 11e4250..84504f7 100644 --- a/src/positions.c +++ b/src/positions.c @@ -37,7 +37,7 @@ void hpix_angles_to_vector(double theta, double phi, - hpix_vector_t * vector) + hpix_vector_t * vector) { assert(vector); @@ -51,16 +51,19 @@ hpix_angles_to_vector(double theta, double phi, hpix_pixel_num_t -hpix_angles_to_ring_pixel(hpix_nside_t nside, +hpix_angles_to_ring_pixel(const hpix_resolution_t * resolution, double theta, double phi) { + assert(resolution != NULL); + int jp, jm, ipix1; int ir, ip; - int nl2 = 2*nside; - int nl4 = 4*nside; - int ncap = nl2*(nside-1); + hpix_nside_t nside = resolution->nside; + hpix_nside_t nl2 = resolution->nside_times_two; + hpix_nside_t nl4 = resolution->nside_times_four; + unsigned int ncap = resolution->ncap; double z = cos(theta); double z_abs = fabs(z); @@ -97,7 +100,7 @@ hpix_angles_to_ring_pixel(hpix_nside_t nside, ipix1 = 2 * ir * (ir - 1) + ip; if (z <= 0.) { - ipix1 = 12 * nside * nside - 2 * ir * (ir + 1) + ip; + ipix1 = resolution->num_of_pixels - 2 * ir * (ir + 1) + ip; } } return ipix1 - 1; @@ -107,10 +110,13 @@ hpix_angles_to_ring_pixel(hpix_nside_t nside, hpix_pixel_num_t -hpix_angles_to_nest_pixel(hpix_nside_t nside, +hpix_angles_to_nest_pixel(const hpix_resolution_t * resolution, double theta, double phi) { + assert(resolution != NULL); + + hpix_nside_t nside = resolution->nside; double z, z_abs, tt, tp, tmp; int face_num,jp,jm; long ifp, ifm; @@ -193,44 +199,47 @@ hpix_vector_to_angles(const hpix_vector_t * vector, hpix_pixel_num_t -hpix_vector_to_ring_pixel(hpix_nside_t nside, - const hpix_vector_t * vector) +hpix_vector_to_ring_pixel(const hpix_resolution_t * resolution, + const hpix_vector_t * vector) { double theta, phi; hpix_vector_to_angles(vector, &theta, &phi); - return hpix_angles_to_ring_pixel(nside, theta, phi); + return hpix_angles_to_ring_pixel(resolution, theta, phi); } /**********************************************************************/ hpix_pixel_num_t -hpix_vector_to_nest_pixel(hpix_nside_t nside, - const hpix_vector_t * vector) +hpix_vector_to_nest_pixel(const hpix_resolution_t * resolution, + const hpix_vector_t * vector) { double theta, phi; hpix_vector_to_angles(vector, &theta, &phi); - return hpix_angles_to_nest_pixel(nside, theta, phi); + return hpix_angles_to_nest_pixel(resolution, theta, phi); } /**********************************************************************/ void -hpix_ring_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, +hpix_ring_pixel_to_angles(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel, double * theta, double * phi) { + assert(resolution); assert(theta && phi); - int nl2, nl4, ncap, iring, iphi, ip, ipix1; - double fact1, fact2, fodd, hip, fihip; + hpix_nside_t nside = resolution->nside; + hpix_nside_t nl2 = resolution->nside_times_two; + hpix_nside_t nl4 = resolution->nside_times_four; + unsigned int ncap = resolution->ncap; + int iring, iphi, ip, ipix1; + double fact1, fact2, fodd, hip, fihip; ipix1 = pixel + 1; // in {1, npix} - nl2 = 2*nside; - nl4 = 4*nside; - ncap = 2*nside*(nside-1); - fact1 = 1.5*nside; - fact2 = 3.0*nside*nside; + fact1 = 1.5 * nside; + fact2 = 3.0 * resolution->pixels_per_face; if(ipix1 <= ncap) { @@ -257,7 +266,7 @@ hpix_ring_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, } else {//! South Polar cap ----------------------------------- - ip = 12 * nside * nside - ipix1 + 1; + ip = resolution->num_of_pixels - ipix1 + 1; hip = ip / 2.; /* bug corrige floor instead of 1.* */ fihip = floor(hip); @@ -273,9 +282,11 @@ hpix_ring_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, void -hpix_nest_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, +hpix_nest_pixel_to_angles(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel, double * theta, double * phi) { + assert(resolution); assert(theta && phi); int ix, iy, jrt, jr, nr, jpt, jp, kshift; @@ -285,12 +296,13 @@ hpix_nest_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, int jrll[12] = { 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4 }; int jpll[12] = { 1, 3, 5, 7, 0, 2, 4, 6, 1, 3, 5, 7 }; + hpix_nside_t nside = resolution->nside; double fn = 1.*nside; double fact1 = 1./(3.*fn*fn); double fact2 = 2./(3.*fn); - int nl4 = 4*nside; + hpix_nside_t nl4 = resolution->nside_times_four; - int npface = nside*nside; + unsigned int npface = resolution->pixels_per_face; int face_num = pixel/npface; // face number in {0,11} int ipf = (int)fmod(pixel,npface); // pixel number in the face {0,npface-1} @@ -337,14 +349,14 @@ hpix_nest_pixel_to_angles(hpix_nside_t nside, hpix_pixel_num_t pixel, void -hpix_ring_pixel_to_vector(hpix_nside_t nside, - hpix_pixel_num_t pixel_index, - hpix_vector_t * vector) +hpix_ring_pixel_to_vector(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel_index, + hpix_vector_t * vector) { assert(vector); double theta, phi; - hpix_ring_pixel_to_angles(nside, pixel_index, &theta, &phi); + hpix_ring_pixel_to_angles(resolution, pixel_index, &theta, &phi); hpix_angles_to_vector(theta, phi, vector); } @@ -352,13 +364,13 @@ hpix_ring_pixel_to_vector(hpix_nside_t nside, void -hpix_nest_pixel_to_vector(hpix_nside_t nside, - hpix_pixel_num_t pixel_index, - hpix_vector_t * vector) +hpix_nest_pixel_to_vector(const hpix_resolution_t * resolution, + hpix_pixel_num_t pixel_index, + hpix_vector_t * vector) { assert(vector); double theta, phi; - hpix_nest_pixel_to_angles(nside, pixel_index, &theta, &phi); + hpix_nest_pixel_to_angles(resolution, pixel_index, &theta, &phi); hpix_angles_to_vector(theta, phi, vector); } diff --git a/test/test_bmp_projection.c b/test/test_bmp_projection.c index 912a5a0..c3120f7 100644 --- a/test/test_bmp_projection.c +++ b/test/test_bmp_projection.c @@ -79,6 +79,7 @@ START_TEST(mollweide_projection) { fail_unless(mollweide_proj_min == 0.0, "hpix_bmp_to_mollweide_proj failed to set the minimum value"); + fprintf(stderr, "***************** maximum = %f\n", mollweide_proj_max); fail_unless(mollweide_proj_max == 767.0, "hpix_bmp_to_mollweide_proj failed to set the maximum value"); diff --git a/test/test_pixel_functions.c b/test/test_pixel_functions.c index 4aee856..f3c5460 100644 --- a/test/test_pixel_functions.c +++ b/test/test_pixel_functions.c @@ -112,31 +112,34 @@ END_TEST START_TEST(angles_to_pixels) { + hpix_resolution_t resol; + hpix_init_resolution_from_nside(256, &resol); + /* Check for the conversion to the RING scheme */ - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.1, 0.1), 1861); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.2, 0.1), 7567); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.3, 0.1), 17117); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.1, 0.1), 1861); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.2, 0.1), 7567); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.3, 0.1), 17117); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.1, 0.2), 1863); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.2, 0.2), 7571); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.3, 0.2), 17123); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.1, 0.2), 1863); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.2, 0.2), 7571); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.3, 0.2), 17123); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.1, 0.3), 1865); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.2, 0.3), 7575); - ck_assert_int_eq(hpix_angles_to_ring_pixel(256, 0.3, 0.3), 17129); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.1, 0.3), 1865); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.2, 0.3), 7575); + ck_assert_int_eq(hpix_angles_to_ring_pixel(&resol, 0.3, 0.3), 17129); /* Check for the conversion to the NEST scheme */ - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.1, 0.1), 65196); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.2, 0.1), 64177); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.3, 0.1), 61128); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.1, 0.1), 65196); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.2, 0.1), 64177); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.3, 0.1), 61128); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.1, 0.2), 65200); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.2, 0.2), 64193); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.3, 0.2), 61044); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.1, 0.2), 65200); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.2, 0.2), 64193); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.3, 0.2), 61044); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.1, 0.3), 65180); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.2, 0.3), 64113); - ck_assert_int_eq(hpix_angles_to_nest_pixel(256, 0.3, 0.3), 60856); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.1, 0.3), 65180); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.2, 0.3), 64113); + ck_assert_int_eq(hpix_angles_to_nest_pixel(&resol, 0.3, 0.3), 60856); } END_TEST @@ -146,34 +149,37 @@ START_TEST(pixels_to_angles) { double theta, phi; + hpix_resolution_t resol; + hpix_init_resolution_from_nside(256, &resol); + #define CHECK_ANGLE(nside, schema, pixel, target_theta, target_phi) \ hpix_ ## schema ## _pixel_to_angles(nside, pixel, &theta, &phi); \ TEST_FOR_CLOSENESS(theta, target_theta); \ TEST_FOR_CLOSENESS(phi, target_phi); - CHECK_ANGLE(256, ring, 1861, 0.09891295, 0.07600627); - CHECK_ANGLE(256, ring, 7567, 0.19806888, 0.08867399); - CHECK_ANGLE(256, ring, 17117, 0.29771618, 0.09289656); + CHECK_ANGLE(&resol, ring, 1861, 0.09891295, 0.07600627); + CHECK_ANGLE(&resol, ring, 7567, 0.19806888, 0.08867399); + CHECK_ANGLE(&resol, ring, 17117, 0.29771618, 0.09289656); - CHECK_ANGLE(256, ring, 1863, 0.09891295, 0.17734797); - CHECK_ANGLE(256, ring, 7571, 0.19806888, 0.19001568); - CHECK_ANGLE(256, ring, 17123, 0.29771618, 0.19423826); + CHECK_ANGLE(&resol, ring, 1863, 0.09891295, 0.17734797); + CHECK_ANGLE(&resol, ring, 7571, 0.19806888, 0.19001568); + CHECK_ANGLE(&resol, ring, 17123, 0.29771618, 0.19423826); - CHECK_ANGLE(256, ring, 1865, 0.09891295, 0.27868967); - CHECK_ANGLE(256, ring, 7575, 0.19806888, 0.29135738); - CHECK_ANGLE(256, ring, 17129, 0.29771618, 0.29557995); + CHECK_ANGLE(&resol, ring, 1865, 0.09891295, 0.27868967); + CHECK_ANGLE(&resol, ring, 7575, 0.19806888, 0.29135738); + CHECK_ANGLE(&resol, ring, 17129, 0.29771618, 0.29557995); - CHECK_ANGLE(256, nest, 65196, 0.09891295, 0.07600627); - CHECK_ANGLE(256, nest, 64177, 0.19806888, 0.08867399); - CHECK_ANGLE(256, nest, 61128, 0.29771618, 0.09289656); + CHECK_ANGLE(&resol, nest, 65196, 0.09891295, 0.07600627); + CHECK_ANGLE(&resol, nest, 64177, 0.19806888, 0.08867399); + CHECK_ANGLE(&resol, nest, 61128, 0.29771618, 0.09289656); - CHECK_ANGLE(256, nest, 65200, 0.09891295, 0.17734797); - CHECK_ANGLE(256, nest, 64193, 0.19806888, 0.19001568); - CHECK_ANGLE(256, nest, 61044, 0.29771618, 0.19423826); + CHECK_ANGLE(&resol, nest, 65200, 0.09891295, 0.17734797); + CHECK_ANGLE(&resol, nest, 64193, 0.19806888, 0.19001568); + CHECK_ANGLE(&resol, nest, 61044, 0.29771618, 0.19423826); - CHECK_ANGLE(256, nest, 65180, 0.09891295, 0.27868967); - CHECK_ANGLE(256, nest, 64113, 0.19806888, 0.29135738); - CHECK_ANGLE(256, nest, 60856, 0.29771618, 0.29557995); + CHECK_ANGLE(&resol, nest, 65180, 0.09891295, 0.27868967); + CHECK_ANGLE(&resol, nest, 64113, 0.19806888, 0.29135738); + CHECK_ANGLE(&resol, nest, 60856, 0.29771618, 0.29557995); } END_TEST @@ -221,23 +227,28 @@ END_TEST START_TEST(vectors_to_pixels) { -#define CHECK_INDEX(nside, scheme, input_x, input_y, input_z, ref_index) \ + hpix_resolution_t resol256, resol512, resol1024; + hpix_init_resolution_from_nside( 256, &resol256); + hpix_init_resolution_from_nside( 512, &resol512); + hpix_init_resolution_from_nside(1024, &resol1024); + +#define CHECK_INDEX(resol, scheme, input_x, input_y, input_z, ref_index) \ { \ hpix_vector_t input_vector = \ (hpix_vector_t) { .x = input_x, \ .y = input_y, \ .z = input_z }; \ - ck_assert_int_eq(hpix_vector_to_ ## scheme ## _pixel(nside, &input_vector), \ + ck_assert_int_eq(hpix_vector_to_ ## scheme ## _pixel(&resol, &input_vector), \ ref_index); \ } - CHECK_INDEX( 256, ring, 0.1, 0.2, 0.3, 78151); - CHECK_INDEX( 512, ring, 0.1, 0.2, 0.3, 311538); - CHECK_INDEX(1024, ring, 0.1, 0.2, 0.3, 1247176); + CHECK_INDEX(resol256, ring, 0.1, 0.2, 0.3, 78151); + CHECK_INDEX(resol512, ring, 0.1, 0.2, 0.3, 311538); + CHECK_INDEX(resol1024, ring, 0.1, 0.2, 0.3, 1247176); - CHECK_INDEX( 256, nest, 0.1, 0.2, 0.3, 31281); - CHECK_INDEX( 512, nest, 0.1, 0.2, 0.3, 125127); - CHECK_INDEX(1024, nest, 0.1, 0.2, 0.3, 500510); + CHECK_INDEX(resol256, nest, 0.1, 0.2, 0.3, 31281); + CHECK_INDEX(resol512, nest, 0.1, 0.2, 0.3, 125127); + CHECK_INDEX(resol1024, nest, 0.1, 0.2, 0.3, 500510); #undef CHECK_INDEX } @@ -247,31 +258,34 @@ END_TEST START_TEST(pixels_to_vectors) { -#define CHECK_PIXEL(nside, schema, index, ref_x, ref_y, ref_z) \ + hpix_resolution_t resol; + hpix_init_resolution_from_nside(256, &resol); + +#define CHECK_PIXEL(resol, schema, index, ref_x, ref_y, ref_z) \ { \ hpix_vector_t result_vec; \ - hpix_ ## schema ## _pixel_to_vector(nside, index, &result_vec); \ + hpix_ ## schema ## _pixel_to_vector(&resol, index, &result_vec); \ TEST_FOR_CLOSENESS(result_vec.x, ref_x); \ TEST_FOR_CLOSENESS(result_vec.y, ref_y); \ TEST_FOR_CLOSENESS(result_vec.z, ref_z); \ } - CHECK_PIXEL(256, ring, 0, + CHECK_PIXEL(resol, ring, 0, 0.0022552716212903439, 0.0022552716212903435, 0.99999491373697913); - CHECK_PIXEL(256, ring, 1653, + CHECK_PIXEL(resol, ring, 1653, -0.0025019940270464042, 0.092360906323387754, 0.99572245279947913); - CHECK_PIXEL(256, ring, 37644, + CHECK_PIXEL(resol, ring, 37644, -0.14609170150719039, -0.40058952463088032, 0.90453592936197913); - CHECK_PIXEL(256, ring, 588412, + CHECK_PIXEL(resol, ring, 588412, 0.62830151534459699, 0.59819277060018217, -0.49739583333333331); - CHECK_PIXEL(256, nest, 0, + CHECK_PIXEL(resol, nest, 0, 0.70710438349510052, 0.70710438349510041, 0.0026041666666666665); - CHECK_PIXEL(256, nest, 1653, + CHECK_PIXEL(resol, nest, 1653, 0.6359637575364262, 0.75112688152914975, 0.17708333333333331); - CHECK_PIXEL(256, nest, 37644, + CHECK_PIXEL(resol, nest, 37644, 0.66743848329372024, 0.44596813666212065, 0.59635416666666663); - CHECK_PIXEL(256, nest, 588412, + CHECK_PIXEL(resol, nest, 588412, 0.77898558859132916, 0.60792632009670888, -0.15364583333333331); #undef CHECK_PIXEL