@@ -354,109 +354,6 @@ def test__trimmed_after_convolution_from():
354354 ).all ()
355355 assert new_arr .mask .pixel_scales == (1.0 , 1.0 )
356356
357-
358- def test__zoomed_around_mask ():
359- array_2d = [
360- [1.0 , 2.0 , 3.0 , 4.0 ],
361- [5.0 , 6.0 , 7.0 , 8.0 ],
362- [9.0 , 10.0 , 11.0 , 12.0 ],
363- [13.0 , 14.0 , 15.0 , 16.0 ],
364- ]
365-
366- mask = aa .Mask2D (
367- mask = [
368- [True , True , True , True ],
369- [True , False , False , True ],
370- [True , False , False , True ],
371- [True , True , True , True ],
372- ],
373- pixel_scales = (1.0 , 1.0 ),
374- )
375-
376- arr_masked = aa .Array2D (values = array_2d , mask = mask )
377-
378- arr_zoomed = arr_masked .zoomed_around_mask (buffer = 0 )
379-
380- assert (arr_zoomed .native == np .array ([[6.0 , 7.0 ], [10.0 , 11.0 ]])).all ()
381-
382- mask = aa .Mask2D (
383- mask = np .array (
384- [
385- [True , True , True , True ],
386- [True , False , False , True ],
387- [False , False , False , True ],
388- [True , True , True , True ],
389- ]
390- ),
391- pixel_scales = (1.0 , 1.0 ),
392- )
393-
394- arr_masked = aa .Array2D (values = array_2d , mask = mask )
395- arr_zoomed = arr_masked .zoomed_around_mask (buffer = 0 )
396-
397- assert (arr_zoomed .native == np .array ([[0.0 , 6.0 , 7.0 ], [9.0 , 10.0 , 11.0 ]])).all ()
398-
399- mask = aa .Mask2D (
400- mask = np .array (
401- [
402- [True , False , True , True ],
403- [True , False , False , True ],
404- [True , False , False , True ],
405- [True , True , True , True ],
406- ]
407- ),
408- pixel_scales = (1.0 , 1.0 ),
409- )
410-
411- arr_masked = aa .Array2D (values = array_2d , mask = mask )
412- arr_zoomed = arr_masked .zoomed_around_mask (buffer = 0 )
413- assert (arr_zoomed .native == np .array ([[2.0 , 0.0 ], [6.0 , 7.0 ], [10.0 , 11.0 ]])).all ()
414-
415-
416- def test__zoomed_around_mask__origin_updated ():
417- array_2d = np .ones (shape = (4 , 4 ))
418-
419- mask = aa .Mask2D (
420- mask = np .array (
421- [
422- [True , True , True , True ],
423- [True , False , False , True ],
424- [True , False , False , True ],
425- [True , True , True , True ],
426- ]
427- ),
428- pixel_scales = (1.0 , 1.0 ),
429- )
430-
431- arr_masked = aa .Array2D (values = array_2d , mask = mask )
432-
433- arr_zoomed = arr_masked .zoomed_around_mask (buffer = 0 )
434-
435- assert arr_zoomed .mask .origin == (0.0 , 0.0 )
436-
437- array_2d = np .ones (shape = (6 , 6 ))
438-
439- mask = aa .Mask2D (
440- mask = np .array (
441- [
442- [True , True , True , True , True , True ],
443- [True , True , True , True , True , True ],
444- [True , True , True , False , False , True ],
445- [True , True , True , False , False , True ],
446- [True , True , True , True , True , True ],
447- [True , True , True , True , True , True ],
448- ]
449- ),
450- pixel_scales = (1.0 , 1.0 ),
451- )
452-
453- arr_masked = aa .Array2D (values = array_2d , mask = mask )
454-
455- arr_zoomed = arr_masked .zoomed_around_mask (buffer = 0 )
456-
457- assert arr_zoomed .mask .origin == (0.0 , 1.0 )
458-
459-
460357def test__binned_across_rows ():
461358 array = aa .Array2D .no_mask (values = np .ones ((4 , 3 )), pixel_scales = 1.0 )
462359
0 commit comments