@@ -518,19 +518,17 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
518
518
if isinstance (self .norm , mcolors .NoNorm ):
519
519
A_resampled = A_resampled .astype (A .dtype )
520
520
521
+ # Compute out_mask (what screen pixels include "bad" data
522
+ # pixels) and out_alpha (to what extent screen pixels are
523
+ # covered by data pixels: 0 outside the data extent, 1 inside
524
+ # (even for bad data), and intermediate values at the edges).
521
525
mask = (np .where (A .mask , np .float32 (np .nan ), np .float32 (1 ))
522
526
if A .mask .shape == A .shape # nontrivial mask
523
527
else np .ones_like (A , np .float32 ))
524
528
# we always have to interpolate the mask to account for
525
529
# non-affine transformations
526
530
out_alpha = _resample (self , mask , out_shape , t , resample = True )
527
531
del mask # Make sure we don't use mask anymore!
528
- # Agg updates out_alpha in place. If the pixel has no image
529
- # data it will not be updated (and still be 0 as we initialized
530
- # it), if input data that would go into that output pixel than
531
- # it will be `nan`, if all the input data for a pixel is good
532
- # it will be 1, and if there is _some_ good data in that output
533
- # pixel it will be between [0, 1] (such as a rotated image).
534
532
out_mask = np .isnan (out_alpha )
535
533
out_alpha [out_mask ] = 1
536
534
# Apply the pixel-by-pixel alpha values if present
0 commit comments