Skip to content

Commit a8a595e

Browse files
committed
Add image label to stretch/cuts in interface
1 parent ec18ed7 commit a8a595e

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/astro_image_display_api/interface_definition.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def load_image(self, data: Any, image_label: str | None = None) -> None:
5858

5959
# Setting and getting image properties
6060
@abstractmethod
61-
def set_cuts(self, cuts: tuple | BaseInterval) -> None:
61+
def set_cuts(self, cuts: tuple | BaseInterval, image_label: str | None = None) -> None:
6262
"""
6363
Set the cuts for the image.
6464
@@ -68,14 +68,25 @@ def set_cuts(self, cuts: tuple | BaseInterval) -> None:
6868
The cuts to set. If a tuple, it should be of the form
6969
``(min, max)`` and will be interpreted as a
7070
`~astropy.visualization.ManualInterval`.
71+
72+
image_label : str, optional
73+
The label of the image to set the cuts for. If not given and there is
74+
only one image loaded, the cuts for that image are set.
7175
"""
7276
raise NotImplementedError
7377

7478
@abstractmethod
75-
def get_cuts(self) -> BaseInterval:
79+
def get_cuts(self, image_label: str | None = None) -> BaseInterval:
7680
"""
7781
Get the current cuts for the image.
7882
83+
Parameters
84+
----------
85+
image_label : str, optional
86+
The label of the image to get the cuts for. If not given and there is
87+
only one image loaded, the cuts for that image are returned. If there are
88+
multiple images and no label is provided, an error is raised.
89+
7990
Returns
8091
-------
8192
cuts : `~astropy.visualization.BaseInterval`
@@ -84,7 +95,7 @@ def get_cuts(self) -> BaseInterval:
8495
raise NotImplementedError
8596

8697
@abstractmethod
87-
def set_stretch(self, stretch: BaseStretch) -> None:
98+
def set_stretch(self, stretch: BaseStretch, image_label: str | None = None) -> None:
8899
"""
89100
Set the stretch for the image.
90101
@@ -93,14 +104,25 @@ def set_stretch(self, stretch: BaseStretch) -> None:
93104
stretch : Any stretch from `~astropy.visualization`
94105
The stretch to set. This can be any subclass of
95106
`~astropy.visualization.BaseStretch`.
107+
108+
image_label : str, optional
109+
The label of the image to set the cuts for. If not given and there is
110+
only one image loaded, the cuts for that image are set.
96111
"""
97112
raise NotImplementedError
98113

99114
@abstractmethod
100-
def get_stretch(self) -> BaseStretch:
115+
def get_stretch(self, image_label: str | None = None) -> BaseStretch:
101116
"""
102117
Get the current stretch for the image.
103118
119+
Parameters
120+
----------
121+
image_label : str, optional
122+
The label of the image to get the cuts for. If not given and there is
123+
only one image loaded, the cuts for that image are returned. If there are
124+
multiple images and no label is provided, an error is raised.
125+
104126
Returns
105127
-------
106128
stretch : `~astropy.visualization.BaseStretch`

0 commit comments

Comments
 (0)