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

raster image is not re-rendered #103

Closed
kswang1029 opened this issue Apr 14, 2023 · 1 comment · Fixed by CARTAvis/carta-frontend#2206
Closed

raster image is not re-rendered #103

kswang1029 opened this issue Apr 14, 2023 · 1 comment · Fixed by CARTAvis/carta-frontend#2206
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kswang1029
Copy link
Contributor

with the following snippet there are two image re-rendering issues

img0 = session.open_image(image_file_7)
img1 = session.append_image(image_file_1)

img0.make_active() # issue1
img0.set_channel(20)
img0.set_polarization(Polarization.Q)

time.sleep(5) # issue2

img1.make_active()
img1.set_channel(20)

Issue1
In this case, img1 will be the active image. Then if I do img0.set_channel(20) and/or img0.set_polarization(Polarization.Q) without img0.make_active(), we will see indeed in the image list widget, the channel index and polarization string are updated. However, the rendered image is not. We need to do img0.make_active() first to re-render the raster image. I suggest in set_channel and set_polarization we internally make the target image as "active" before setting channel/polarization. In the scripting interface when there are multiple image loaded, it is non-trivial which one is currently "active" I suppose.

Issue2
In the above snippet, if I comment out time.sleep(5), even if we do img0.make_active() first before setting channel and polarization, we do not see img0 got re-rendered. I suspect this is an sync/async issue.

@kswang1029 kswang1029 added the bug Something isn't working label Apr 14, 2023
@kswang1029 kswang1029 changed the title raster image is not rendered raster image is not re-rendered Apr 14, 2023
@confluence confluence self-assigned this Apr 14, 2023
@confluence
Copy link
Collaborator

I'm concerned that making an inactive image active as a side effect of changing the channel / polarization is unexpected behaviour, and I would rather not do it by default.

I wonder if there's a way to force re-rendering in the frontend without making the image active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants