Skip to content

Commit c3ea888

Browse files
committed
Fix bug in setting catalog style in dummy viewer
1 parent 3a739a3 commit c3ea888

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

src/astro_image_display_api/dummy_viewer.py

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -288,30 +288,6 @@ def load_catalog(self, table: Table, x_colname: str = 'x', y_colname: str = 'y',
288288
skycoord_colname: str = 'coord', use_skycoord: bool = True,
289289
catalog_label: str | None = None,
290290
catalog_style: dict | None = None) -> None:
291-
"""
292-
Add markers to the image.
293-
294-
Parameters
295-
----------
296-
table : `astropy.table.Table`
297-
The table containing the marker positions.
298-
x_colname : str, optional
299-
The name of the column containing the x positions. Default
300-
is ``'x'``.
301-
y_colname : str, optional
302-
The name of the column containing the y positions. Default
303-
is ``'y'``.
304-
skycoord_colname : str, optional
305-
The name of the column containing the sky coordinates. If
306-
given, the ``use_skycoord`` parameter is ignored. Default
307-
is ``'coord'``.
308-
use_skycoord : bool, optional
309-
If `True`, the ``skycoord_colname`` column will be used to
310-
get the marker positions.
311-
catalog_label : str, optional
312-
The name of the marker set to use. If not given, a unique
313-
name will be generated.
314-
"""
315291
try:
316292
coords = table[skycoord_colname]
317293
except KeyError:
@@ -342,6 +318,7 @@ def load_catalog(self, table: Table, x_colname: str = 'x', y_colname: str = 'y',
342318
to_add[skycoord_colname] = None
343319

344320
catalog_label = self._resolve_catalog_label(catalog_label)
321+
345322
if (
346323
catalog_label in self._catalogs
347324
and self._catalogs[catalog_label].data is not None
@@ -351,6 +328,13 @@ def load_catalog(self, table: Table, x_colname: str = 'x', y_colname: str = 'y',
351328
else:
352329
self._catalogs[catalog_label].data = to_add
353330

331+
if catalog_style is None:
332+
catalog_style = self._default_marker_style.copy()
333+
334+
self._catalogs[catalog_label].style = catalog_style
335+
336+
load_catalog.__doc__ = ImageViewerInterface.load_catalog.__doc__
337+
354338
def remove_catalog(self, catalog_label: str | None = None) -> None:
355339
"""
356340
Remove markers from the image.

0 commit comments

Comments
 (0)