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

Display sky coordinates in subset plugin when WCS linked #2553

Closed

Conversation

cshanahan1
Copy link
Contributor

Draft PR to add sky coordinates in subset plugin when wcs linked

@pllim pllim added this to the 3.8 milestone Nov 6, 2023
@javerbukh
Copy link
Contributor

Working with a regular circle and switching between link types seems to work. I say "seems" because I can't remember all the conversations that took place over the image rotation PR about what we expect to happen when the link type changes like that.

I tried to use an annulus and when I tried to update one of the values, the subset disappeared.

Otherwise I think this is on the right track! I'll look through the code next. Also, it would be good to get the code style checks fixed so we can see if this breaks CI anywhere.

Comment on lines +106 to +107
if self.subset_selected != self.subset_select.default_text:
self._get_subset_definition(*args)
Copy link
Contributor

Choose a reason for hiding this comment

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

self.subset_selected can be a list in multiselect mode, so this may need some more checks.

@@ -139,13 +160,18 @@ def _unpack_get_subsets_for_ui(self):
Convert what app.get_subsets returns into something the UI of this plugin
can display.
"""

self.hub.broadcast(SnackbarMessage(f'in _unpack_subsets_for_ui', color='error', sender=self))
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder to remove this when you take this PR out of draft mode.

x, y = subset_state.roi.center()
r = subset_state.roi.radius
if self.display_sky_coordinates:
sky_region = spec['sky_region']
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe sky_region does not know how to handle annulus types?

@pllim
Copy link
Contributor

pllim commented Nov 13, 2023

Note to self: When we get back to this after #2179 is merged, need to see if imviz.get_interactive_regions() still makes sense when WCS linked.

Might also have to rewrite these lines in the Imviz example notebooks so that they work in WCS linking mode (they still work when pixel linked):

mask = regions['Subset 1'].to_mask(mode='subpixels')
data = imviz.get_data('acs_47tuc_1[SCI,1]')
plt.imshow(mask.to_image(data.shape), origin='lower')

@pllim pllim mentioned this pull request Nov 13, 2023
11 tasks
@rosteen
Copy link
Collaborator

rosteen commented Nov 14, 2023

@cshanahan1 remind me, what was the holdup/problem with the rectangular subsets? Everything else seems to be working so far in my testing.

@cshanahan1
Copy link
Contributor Author

@cshanahan1 remind me, what was the holdup/problem with the rectangular subsets? Everything else seems to be working so far in my testing.

i fixed that. theres some very strange, low level issue with updating theta on elliptical subsets but that shouldn't hold up this pr.

I am trying to find a few mins (just kidding, probably an hour :( ) to rebase this, thanks for testing and I will do that as soon as i can!!

@rosteen
Copy link
Collaborator

rosteen commented Nov 14, 2023

Ah, gotcha, alright I'll hold off on testing more then until you update the PR (the rectangle handling is stuff you haven't pushed up yet, right?).

@cshanahan1
Copy link
Contributor Author

nope thats in there already!

@rosteen
Copy link
Collaborator

rosteen commented Nov 14, 2023

Oh, well, in that case it doesn't seem to be working for me. I'll grab a screen recording in a minute.

@rosteen
Copy link
Collaborator

rosteen commented Nov 14, 2023

There's no if self.display_sky_coordinates case for rectangular in the diff here like there is for the other subsets, and I don't see WCS coords when testing:

Screen.Recording.2023-11-09.at.1.31.03.PM.mov

@cshanahan1
Copy link
Contributor Author

@rosteen im so sorry i think the wrong PR is linked in the jira ticket! The one I've been updating is on Brett's PR bmorris3#19. I'll close this one and update the jira ticket

@cshanahan1
Copy link
Contributor Author

Closing, bmorris3#19 contains this work

@cshanahan1 cshanahan1 closed this Nov 15, 2023
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.

4 participants