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

Sources that match sharplo(hi) and roundlo(hi) limits should be included #1977

Closed
mcara opened this issue Dec 29, 2024 · 1 comment · Fixed by #1978
Closed

Sources that match sharplo(hi) and roundlo(hi) limits should be included #1977

mcara opened this issue Dec 29, 2024 · 1 comment · Fixed by #1978

Comments

@mcara
Copy link
Contributor

mcara commented Dec 29, 2024

Currently star finding code filters out sources that have sharpness or roundness match one of the limits for these parameter, see

mask = ((newcat.sharpness > newcat.sharplo)
& (newcat.sharpness < newcat.sharphi)
& (newcat.roundness > newcat.roundlo)
& (newcat.roundness < newcat.roundhi))

I believe the strict inequalities in the code above should be replaced with >= and <=.

Here is an example of a source that should be detected:

In [1]: import numpy as np

In [2]: from photutils import detection

In [3]: d = np.zeros((200, 200))

In [4]: x = 121
   ...: y = 98
   ...: d[y-1:y+2, x-1:x+2] = [
   ...:     [0.1, 0.6, 0.1],
   ...:     [0.6, 0.8, 0.6],
   ...:     [0.1, 0.6, 0.1],
   ...: ]

In [5]: f = detection.IRAFStarFinder(0, 2.5, roundlo=0)

In [6]: f.find_stars(d)
WARNING: NoDetectionsWarning: Sources were found, but none pass the sharpness, roundness, or peakmax criteria [photutils.detection.irafstarfinder]

In [7]: f = detection.IRAFStarFinder(0, 2.5, roundlo=-1e-12)

In [8]: f.find_stars(d)
Out[8]:
<QTable length=1>
  id  xcentroid ycentroid        fwhm            sharpness      roundness    pa    npix   peak         flux                mag
int64  float64   float64       float64            float64        float64  float64 int64 float64      float64             float64
----- --------- --------- ------------------ ------------------ --------- ------- ----- ------- ------------------ -------------------
    1     121.0      98.0 1.5698800300206328 0.6279520120082531       0.0     0.0     9     0.8 3.5999999999999996 -1.3907562519182182

That is, perfectly round stars are excluded by default.

@mcara
Copy link
Contributor Author

mcara commented Jan 3, 2025

The original code in IRAF includes interval ends as it chooses not to add the star to the list of detected objects if ellipticity < roundlo or elipticity > roundhi (same for sharpness). That is, if a star has, i.e., ellipticity == roundlo, it would be selected.

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 a pull request may close this issue.

1 participant