photutils
photutils copied to clipboard
StarFinder combine roundlo & roundhi with an OR instead of an AND
The docs say that the roundlo, roundhi parameters in the StarFinder classes are
applied to both measures of roundness
For what I can tell this is applied with a logical AND to combine results from roundness1 and roundness2. I've found this to rather restrictive, and combining them with an OR produces more reasonable results.
Am I correct that these parameters are combined with an AND? Could an option to combine them with an OR be added?
@Gabriel-p Yes, the sources reported in the table must meet all of the roundness (and sharpness) constraints. This mirrors the behavior of the original DAOFind task.
Note that these criteria are simply used to filter the output table as the last step of DAOStarFind. You could easily perform an OR operation on the roundness parameters in the output table, e.g.
daofind = DAOStarFinder(..., roundlo=-1000, roundhi=1000) # no constraints on roundness
sources = daofind(data)
# now apply your custom roundness constraints
roundlo = -1
roundhi = 1.
mask = ((sources['roundness1'] > roundlo) & (sources['roundness1'] < roundhi) |
(sources['roundness2'] > roundlo) & (sources['roundness2'] < roundhi))
sources_filtered = sources[mask] # table of constrained sources
Thank you for the confirmation @larrybradley, yes that's exactly what I currently do. Just thought others could find the OR option useful. Feel free to close the issue if it doesn't sound reasonable.