vrodgom / statmorph

Python code for calculating non-parametric morphological diagnostics of galaxy images.
BSD 3-Clause "New" or "Revised" License
42 stars 15 forks source link

M statistic of 0 triggers a flag #1

Closed kdpenner closed 7 years ago

kdpenner commented 7 years ago

Hello, I'm using the package to determine morphological parameters of sometimes "single clump" sources. For these sources, the code sets the M statistic to 0 and triggers a flag. This behavior is problematic for inspecting the quality of the other statistics.

vrodgom commented 7 years ago

I agree. This is something I considered before.

I just modified the code accordingly, so I'm closing this issue. If necessary, the user can still discard M=0 cases in postprocessing.

kdpenner commented 7 years ago

Thanks for addressing this quickly. I still have a problem---perhaps unrelated---in _segmap_mid. The same object for which M=0 has a MID segmap that is equal to the input segmap, which triggers a flag.

vrodgom commented 7 years ago

Just to make sure, are you getting a warning that says "[segmap_mid] Using original segmap"?

kdpenner commented 7 years ago

Yes.

vrodgom commented 7 years ago

Yes, the MID segmap is sometimes technically undefined, but I agree that perhaps this should not trigger the "bad measurement" flag. I just made a change that reflects this. In those cases the code now uses the Gini segmap for the MID calculations. Thanks for the feedback.