Skip to content

Commit aeb3106

Browse files
committed
fix lint
1 parent 59e7fb1 commit aeb3106

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

src/hats/inspection/visualize_catalog.py

+26-5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def plot_pixel_list(pixels: List[HealpixPixel], plot_title: str = "", projection
111111

112112
def plot_moc(
113113
moc: MOC,
114+
*,
114115
projection: str = "MOL",
115116
title: str = "",
116117
fov: Quantity | Tuple[Quantity, Quantity] = None,
@@ -161,7 +162,7 @@ def plot_moc(
161162
frame_class=frame_class,
162163
ax=ax,
163164
fig=fig,
164-
fig_size=(9, 5),
165+
figsize=(9, 5),
165166
)
166167

167168
mocpy_args = {"alpha": 0.5, "fill": True, "color": "teal"}
@@ -440,6 +441,7 @@ def plot_healpix_map(
440441
frame_class=frame_class,
441442
ax=ax,
442443
fig=fig,
444+
figsize=(10, 5),
443445
)
444446

445447
_plot_healpix_value_map(ipix, depth, healpix_map, ax, wcs, cmap=cmap, norm=norm, cbar=cbar, **kwargs)
@@ -458,15 +460,34 @@ def initialize_wcs_axes(
458460
frame_class: Type[BaseFrame] | None = None,
459461
ax: WCSAxes | None = None,
460462
fig: Figure | None = None,
461-
fig_size=None,
463+
**kwargs,
462464
):
465+
"""Initializes matplotlib Figure and WCSAxes if they do not exist
466+
467+
Args:
468+
projection (str): The projection to use in the WCS. Available projections listed at
469+
https://docs.astropy.org/en/stable/wcs/supported_projections.html
470+
fov (Quantity or Sequence[Quantity, Quantity] | None): The Field of View of the WCS. Must be an
471+
astropy Quantity with an angular unit, or a tuple of quantities for different longitude and \
472+
latitude FOVs (Default covers the full sky)
473+
center (SkyCoord | None): The center of the projection in the WCS (Default: SkyCoord(0, 0))
474+
wcs (WCS | None): The WCS to specify the projection of the plot. If used, all other WCS parameters
475+
are ignored and the parameters from the WCS object is used.
476+
frame_class (Type[BaseFrame] | None): The class of the frame for the WCSAxes to be initialized with.
477+
if the `ax` kwarg is used, this value is ignored (By Default uses EllipticalFrame for full
478+
sky projection. If FOV is set, RectangularFrame is used)
479+
ax (WCSAxes | None): The matplotlib axes to plot onto. If None, an axes will be created to be used. If
480+
specified, the axes must be an astropy WCSAxes, and the `wcs` parameter must be set with the WCS
481+
object used in the axes. (Default: None)
482+
fig (Figure | None): The matplotlib figure to add the axes to. If None, one will be created, unless
483+
ax is specified (Default: None)
484+
kwargs: additional kwargs to pass to figure initialization
485+
"""
463486
if fig is None:
464487
if ax is not None:
465488
fig = ax.get_figure()
466489
else:
467-
if fig_size is None:
468-
fig_size = (10, 5)
469-
fig = plt.figure(figsize=fig_size)
490+
fig = plt.figure(**kwargs)
470491
if frame_class is None and fov is None and wcs is None:
471492
frame_class = EllipticalFrame
472493
if fov is None:

tests/hats/inspection/test_visualize_catalog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from unittest.mock import Mock, MagicMock
1+
from unittest.mock import MagicMock
22

33
import astropy.units as u
44
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)