astrowidgets icon indicating copy to clipboard operation
astrowidgets copied to clipboard

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

Open mwcraig opened this issue 7 years ago • 4 comments

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.

mwcraig avatar Aug 01 '18 17:08 mwcraig

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?

pllim avatar Aug 01 '18 17:08 pllim

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

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

mwcraig avatar Aug 02 '18 00:08 mwcraig

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.

pllim avatar Aug 02 '18 00:08 pllim

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).

ejeschke avatar Aug 06 '18 20:08 ejeschke