While setting the stretch using a string (e.g. viewer.stretch = 'sqrt') is very convenient, saome stretches require parameters (e.g. PowerStretch) and many have optional parameters (e.g. AsinhStretch).
I don't see a way to handle that without one of these:
- add some more public properties that correspond to the settings for these stretches
- make a method
set_stretch instead that allows optional parameters, and a get_stretch
- Allow
stretch to be set to either a string or an astropy stretch object.
Of these, 1 seems confusing, 2 is straightforward, 3 is maybe more convenient in many cases.