Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masking #157

Merged
merged 4 commits into from
Nov 8, 2021
Merged

Masking #157

merged 4 commits into from
Nov 8, 2021

Conversation

tjgalvin
Copy link
Contributor

As separately discussed, this is to fix the same set of pixels being fit be different components across different islands, leading to the doubling up of sources. This is a WIP and should be discussed a little further.

PaulHancock and others added 2 commits October 8, 2021 16:54
* add markdown docs from github wiki

* allow markdown docs and new theme

* ignore vscode dir

* update index to include scripts

* remove api docs

* remove link to api

* include myst-parser in requirements

* add documentation build and comments

* include myst-parser in requirements

* add documentation build and comments

* remove classes page, resolve build warnings

* remove classes from TOC

* update index to include scripts

* pep8 changes

* add job matrix with osx

* use install --user

* remove osx 

* arcsecond to arcmin, regroup_eps added as aegean option

Co-authored-by: tim <tim.galvin@curtin.edu.au>
@coveralls
Copy link

coveralls commented Oct 26, 2021

Coverage Status

Coverage increased (+0.02%) to 82.501% when pulling a57277b on tjgalvin:masking into 21c6b0a on PaulHancock:dev-aegean.

@tjgalvin
Copy link
Contributor Author

I also noticed that instances where diagonal pixels were not being grouped together into a single island, and instead two separate islands were being created for later fitting. This was happening a lot for the lower signal to noise islands, where two diagonally adjacent pixels were being identified in the flood fill procedure. The default behavior of the scipy.ndimage.label function is to not connect these pixels in an island. I have added a structure argument to fix this.

from scipy.ndimage import label
import numpy as np
import matplotlib.pyplot as plt

a = np.zeros((4,4), dtype=bool)
a[1,2] = 1 
a[2,1] = 1 

l, n = label(a)
ll, nn = label(a, structure=np.ones((3,3)))

fig, (ax1, ax2, ax3) = plt.subplots(1,3, figsize=(10, 3))

ax1.imshow(
    a
)
ax1.set_title('Input image')

ax2.imshow(
    l
)
ax2.set_title('Label Islands (default)')

ax3.imshow(
    ll
)
ax3.set_title('Label Islands (structure)')

image

@PaulHancock
Copy link
Owner

I'm now wondering if this is related to #136 / #114

@tjgalvin
Copy link
Contributor Author

tjgalvin commented Nov 2, 2021

I don't think it is. From my reading of that pull request, it is concerned with ensuring a region file is considered when doing the initial island characterisation. Although the current flood fill may be ignoring the --region option (there are some differences between the method and the newer function), I don't think it is related to these duplicate island issues.

@PaulHancock PaulHancock merged commit 732b2ba into PaulHancock:dev-aegean Nov 8, 2021
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.

3 participants