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

Non-repeatable vmin vmax[BUG] #2526

Open
cshanahan1 opened this issue Oct 20, 2023 · 8 comments
Open

Non-repeatable vmin vmax[BUG] #2526

cshanahan1 opened this issue Oct 20, 2023 · 8 comments
Labels
bug Something isn't working Upstream fix required

Comments

@cshanahan1
Copy link
Contributor

cshanahan1 commented Oct 20, 2023

Jdaviz component

Imviz

Description

This is a bug I noticed while reviewing #2513, but seems to have existed before.

If you open a new instance of imviz (after restarting notebook), the initial values of vmin and vmax for display occasionally change. With the imviz example data in the notebook, sometimes they are 0 and 0.56, and sometimes they are 0.11 and 0.62. The screenshots below come from creating an imviz instance, loading data, and opening plot options to view vmin/vmax (refreshing the notebook inbetween). It is non repeatable for some reason.

Screen Shot 2023-10-20 at 1 42 48 PM Screen Shot 2023-10-20 at 1 42 48 PM

How to Reproduce

Using imviz example notebook, load data and look at vmin and vmax in plot options. Refresh and do this again a few times, and youll notice sometimes that the initial values change.

Expected behavior

For a given dataset, the initial values of vmin and vmax sound be the same every time.

Browser

Safari

@cshanahan1 cshanahan1 added bug Something isn't working needs-triage Issue opened via template and needs triaging labels Oct 20, 2023
@astrofrog
Copy link
Collaborator

This is due to the fact that glue will avoid loading all pixels from the data so actually only accesses a sub-sample of the data to determine the min/max. This is important because if you were to load in e.g. a 100Gb mosaic, you definitely wouldn't want to load in all the pixels just to determine the limits.

The question is, is the threshold for data size where this is happening too low? Or would you like to have some way to cache for a given filename what seed is used for the random sub-sampling of the array?

@pllim pllim added Upstream fix required and removed needs-triage Issue opened via template and needs triaging labels Nov 1, 2023
@pllim
Copy link
Contributor

pllim commented Nov 1, 2023

Personally, unless this is causing some analysis problems, I'd say just chuck it under Known Issues and move on. @cshanahan1 , what do you think?

@astrofrog
Copy link
Collaborator

As an aside (but somewhat related) I also wonder whether the limits need to be shown with so much precision? Changing the limits at the 5th significant figure isn't going to change the RGB values of the image in any significant way?

@pllim
Copy link
Contributor

pllim commented Nov 1, 2023

I agree. Maybe a .3e would be more than enough?

@astrofrog
Copy link
Collaborator

Or .3g for more readable numbers when close to 1

@pllim
Copy link
Contributor

pllim commented Nov 2, 2023

@astrofrog , is this something we have to patch in glue-jupyter?

@pllim
Copy link
Contributor

pllim commented Nov 2, 2023

Oh wait, maybe here but I dunno how to set format in the front-end. Maybe @kecnry knows.

<!-- for multiselect, show vmin/max here, otherwise they'll be in the "more stretch options" expandable section -->
<glue-state-sync-wrapper v-if="multiselect" :sync="stretch_vmin_sync" :multiselect="multiselect" @unmix-state="unmix_state('stretch_vmin')">
<v-text-field
ref="stretch_vmin"
label="Stretch VMin"
v-model.number="stretch_vmin_value"
type="number"
:step="stretch_vstep"
></v-text-field>
</glue-state-sync-wrapper>

@kecnry
Copy link
Member

kecnry commented Nov 2, 2023

I don't know of a way with vue, we could either do it with JS/CSS or on the Python side, but we can cross that bridge when we come to it.

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

No branches or pull requests

4 participants