Skip to content

Fix computing the number of unmasked pixels assigned to island#294

Open
AlexKurek wants to merge 1 commit into
lofar-astron:masterfrom
AlexKurek:Fix-computing-the-number-of-unmasked-pixels
Open

Fix computing the number of unmasked pixels assigned to island#294
AlexKurek wants to merge 1 commit into
lofar-astron:masterfrom
AlexKurek:Fix-computing-the-number-of-unmasked-pixels

Conversation

@AlexKurek
Copy link
Copy Markdown
Contributor

In the constuctor there is
copy=False
So if not copy: block will always be executed. Within this block:
isl_mask = (labels[tuple(bbox)] == idx)
so True means pixels within the island.
This mask is inverted below:
N.logical_not(isl_mask, isl_mask)
Since the mask is inverted, currently this line:
pixels_in_isl = N.sum(~N.isnan(self.image[self.mask_active]))
seems to count not-NaN pixels outside the island. To fix it:
pixels_in_isl = N.sum(~N.isnan(self.image[~self.mask_active]))

Am I right? This produces chenges in I think every line in the .gaul file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant