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

Translator for regions and photutils #1138

Merged
merged 11 commits into from
Mar 28, 2022

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Mar 1, 2022

Description

This pull request is to implement translators to convert certain regions shapes to photutils apertures, primarily to support new features for Simple Aperture Photometry plugin that Imviz uses (e.g., centroid and FWHM).

This PR also follows up on #1131 by changing plot color to gray (original request) and making the profile plot marker size a little smaller.

https://jdaviz--1138.org.readthedocs.build/en/1138/imviz/plugins.html#simple-aperture-photometry

References:

Blocked by:

This is required for:

Related PRs/issues:

TODO

  • Add milestone after 2.3 release on Mar 2.
  • Add change log, including a mention that photutils now a required dependency.
  • Update photutils dependency in docs/dev/jdaviz.svg.
  • Implement translators.
  • Write new translator tests.
  • Drop Python 3.7, see Translator for regions and photutils #1138 (comment) . This is now MNT: Drop Python 3.7 support #1145
  • Make sure the translator only do copies of parameters, not by reference. (No need due to descriptor magicks.)
  • Refactor Simple Aperture Photometry plugin to use the new translators, maybe.
  • Update existing tests of affected code.
  • Update code to use new ApertureStats class in photutils.
  • See if we can also fix big mosaic performance issues here? Yes, fixed upstream in photutils.
  • Pin regions to a stable release that is >0.5 in setup.cfg after that release happens. Now it pins to dev to make tests pass.
  • Pin glue-astronomy to a stable release that is >=0.3.3.
  • Pin photutils to a stable release with that feature branch. Also update interphinx URL.
  • ???
  • Profit!

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set? Milestone is only currently required for PRs related to Imviz MVP.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)? 🐱 🐱 🐱 🐱

@github-actions github-actions bot added documentation Explanation of code and concepts imviz testing labels Mar 1, 2022
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #1138 (dbb2bb7) into main (56fcebf) will increase coverage by 0.14%.
The diff coverage is 99.15%.

@@            Coverage Diff             @@
##             main    #1138      +/-   ##
==========================================
+ Coverage   77.29%   77.44%   +0.14%     
==========================================
  Files          89       90       +1     
  Lines        7028     7079      +51     
==========================================
+ Hits         5432     5482      +50     
- Misses       1596     1597       +1     
Impacted Files Coverage Δ
jdaviz/core/region_translators.py 98.50% <98.50%> (ø)
...imviz/plugins/aper_phot_simple/aper_phot_simple.py 94.80% <100.00%> (-0.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56fcebf...dbb2bb7. Read the comment docs.

@pllim pllim added this to the 2.4 milestone Mar 2, 2022
@pllim pllim force-pushed the lost-in-translation branch 3 times, most recently from 763a47a to 43eef77 Compare March 3, 2022 19:28
@pllim pllim force-pushed the lost-in-translation branch from 43eef77 to bfe3912 Compare March 3, 2022 22:45
@pllim

This comment was marked as resolved.

@pllim pllim mentioned this pull request Mar 4, 2022
9 tasks
@pllim pllim force-pushed the lost-in-translation branch 2 times, most recently from ea009d8 to b1e4ae0 Compare March 9, 2022 00:10
@pllim pllim force-pushed the lost-in-translation branch from 6f24f69 to b1edd9b Compare March 9, 2022 15:24
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@pllim pllim added the 🔥 Critical label Mar 15, 2022
@pllim pllim force-pushed the lost-in-translation branch from 9464089 to dcdc560 Compare March 25, 2022 01:07
Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a vague sense that it would be useful for these translators to live somewhere other than Jdaviz, I think this looks good. The bug that I found is also present on main so it doesn't block this.

@pllim
Copy link
Contributor Author

pllim commented Mar 25, 2022

it would be useful for these translators to live somewhere other than Jdaviz

Yes. @larrybradley and I cannot agree between photutils and regions. But I think the end goal is they would move upstream some day.

docs/imviz/plugins.rst Outdated Show resolved Hide resolved
Co-authored-by: Ricky O'Steen <[email protected]>
@pllim pllim force-pushed the lost-in-translation branch 2 times, most recently from d1944b7 to 9f4fdde Compare March 26, 2022 02:49
TST: Test against dev photutils

DOC: Point photutils intersphinx to stable
@pllim pllim force-pushed the lost-in-translation branch from 3fca646 to dbb2bb7 Compare March 26, 2022 02:56
@pllim pllim marked this pull request as ready for review March 26, 2022 03:14
Copy link
Collaborator

@duytnguyendtn duytnguyendtn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran through a simple aperture photometry example in Imviz and everything seems to be extracted as I would expect! Thanks for the increment!

@duytnguyendtn duytnguyendtn merged commit 752a0fb into spacetelescope:main Mar 28, 2022
@duytnguyendtn
Copy link
Collaborator

I will note I agree with @rosteen's comment:

it would be useful for these translators to live somewhere other than Jdaviz

Not sure if glue-astronomy would be the most appropriate place since this isn't exactly related to the glue stuff that's already in there?

@pllim pllim deleted the lost-in-translation branch March 28, 2022 15:39
@pllim
Copy link
Contributor Author

pllim commented Mar 28, 2022

No, no one really uses glue-astronomy but us. It would be wasted to get the translation in there. Some day, either Larry will convince me that it should go into regions or I will him that it should be in photutils... 😆

@pllim
Copy link
Contributor Author

pllim commented Mar 28, 2022

Thanks for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize aperture photometry for big data [FEAT] Imviz: add fwhm to the aperture photometry plugin
4 participants