astropy / astrowidgets

*PRE-ALPHA*/heavy dev. Jupyter widgets leveraging the Astropy ecosystem
https://astrowidgets.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
31 stars 14 forks source link

Decide how to handle setting `cuts` before data is set #8

Open mwcraig opened 6 years ago

mwcraig commented 6 years ago

Right now if cuts is set to a string before the data has been set, then cuts has value (0, 0).

It seems like the user will expect that, once the user sets the data, the autocuts they wanted will be applied.

Alternatively, we could make it an error to set the value to a string before the data has been set.

pllim commented 6 years ago

Specific to Ginga, if you are using auto-cut algorithm (and didn't lock it down w.r.t. one particular image), cuts are recalculated when new image is loaded. Is this not what you are experiencing?

mwcraig commented 6 years ago

oops, should have checked that that was the case :).

Should we expose what choice the user made as a string?

pllim commented 6 years ago

Ginga stores autocut and manual choices somewhat separately. That is the last chosen autocut algorithm isn't changed when manual cut (lo/hi) is applied. In that sense, it can be confusing. What I'm trying to say is, user choice as string is possible but requires extra tracking on widget side. All that said, @ejeschke , feels free to correct me if I missed something.

ejeschke commented 6 years ago

The autocut algorithm is not changed when the user sets cuts manually with cut_levels(). Auto cuts will be applied when new data is loaded if enable_autocuts('on') is set on the viewer. Other options are off (leave cuts set where they are), once only apply autocuts to the first image loaded, and override (apply autocuts until the user overrides manually).