@@ -292,12 +292,6 @@ def test__from_as_gaussian_via_alma_fits_header_parameters__identical_to_astropy
292292 assert kernel_astropy == pytest .approx (kernel_2d .native ._array , abs = 1e-4 )
293293
294294
295- def test__not_odd_x_odd_kernel__raises_error ():
296-
297- with pytest .raises (exc .KernelException ):
298- aa .Kernel2D .no_mask (values = [[0.0 , 1.0 ], [1.0 , 2.0 ]], pixel_scales = 1.0 )
299-
300-
301295def test__convolved_array_from ():
302296
303297 array_2d = aa .Array2D .no_mask (
@@ -430,13 +424,13 @@ def test__convolve_image_no_blurring():
430424
431425 masked_image = aa .Array2D (values = image .native , mask = mask )
432426
433- blurred_masked_im_1 = kernel .convolve_image_no_blurring (image = masked_image )
427+ blurred_masked_im_1 = kernel .convolve_image_no_blurring (image = masked_image , mask = mask )
434428
435429 assert blurred_masked_image_via_scipy == pytest .approx (blurred_masked_im_1 .array , 1e-4 )
436430
437431
438432def test__convolve_mapping_matrix ():
439- mask = np .array (
433+ mask = aa . Mask2D ( mask = np .array (
440434 [
441435 [True , True , True , True , True , True ],
442436 [True , False , False , False , False , True ],
@@ -445,7 +439,7 @@ def test__convolve_mapping_matrix():
445439 [True , False , False , False , False , True ],
446440 [True , True , True , True , True , True ],
447441 ]
448- )
442+ ), pixel_scales = 1.0 )
449443
450444 kernel = aa .Kernel2D .no_mask (
451445 values = [[0 , 0.0 , 0 ], [0.4 , 0.2 , 0.3 ], [0 , 0.1 , 0 ]], pixel_scales = 1.0
@@ -476,11 +470,11 @@ def test__convolve_mapping_matrix():
476470 ]
477471 )
478472
479- blurred_mapping = kernel .convolve_mapping_matrix (mapping )
473+ blurred_mapping = kernel .convolve_mapping_matrix (mapping , mask )
480474
481475 assert (
482476 blurred_mapping
483- == np .array (
477+ == pytest . approx ( np .array (
484478 [
485479 [0 , 0 , 0 ],
486480 [0 , 0 , 0 ],
@@ -500,7 +494,7 @@ def test__convolve_mapping_matrix():
500494 [0 , 0 , 0 ],
501495 ]
502496 )
503- ). all ( )
497+ ), 1.0e-4 )
504498
505499 kernel = aa .Kernel2D .no_mask (
506500 values = [[0 , 0.0 , 0 ], [0.4 , 0.2 , 0.3 ], [0 , 0.1 , 0 ]], pixel_scales = 1.0
@@ -531,7 +525,9 @@ def test__convolve_mapping_matrix():
531525 ]
532526 )
533527
534- blurred_mapping = kernel .convolve_mapping_matrix (mapping )
528+ blurred_mapping = kernel .convolve_mapping_matrix (mapping , mask )
529+
530+ print (blurred_mapping )
535531
536532 assert blurred_mapping == pytest .approx (
537533 np .array (
@@ -554,5 +550,5 @@ def test__convolve_mapping_matrix():
554550 [0 , 0 , 0 ],
555551 ]
556552 ),
557- 1e-4 ,
553+ abs = 1e-4 ,
558554 )
0 commit comments