Description
When calling plot_finder_image(), astroplan internally passes a grid keyword argument to astroquery.skyview.SkyView.get_images(). This argument is no longer accepted by the current version of astroquery, causing a TypeError.
Environment
astroplan version: 0.10.1
astroquery version: 0.4.11
astropy version: 6.x
Python version: 3.12
OS: Linux (Raspberry Pi OS / Ubuntu)
Steps to reproduce
from astroplan import FixedTarget
from astroplan.plots import plot_finder_image
from astropy.coordinates import SkyCoord
import astropy.units as u
coord = SkyCoord(ra=16.52 * u.deg, dec=47.78 * u.deg, frame='icrs')
target = FixedTarget(name='Test', coord=coord)
ax, hdu = plot_finder_image(target, fov_radius=30 * u.arcmin, survey="DSS")
Error
TypeError: SkyViewClass.get_images() got an unexpected keyword argument 'grid'
Root cause
In astroplan/plots/finder.py, the function plot_finder_image calls SkyView.get_images() with a grid=grid keyword argument:
images = SkyView.get_images(..., grid=grid, ...)
The grid parameter has been removed from SkyView.get_images() in recent versions of astroquery and is no longer a valid argument.
Workaround
Removing grid=grid from the SkyView.get_images() call in astroplan/plots/finder.py resolves the issue.
Alternatively, pinning astroquery to a version that still accepts the grid parameter works around the problem, but is not a sustainable solution.
Suggested fix
Remove the grid parameter from the SkyView.get_images() call in astroplan/plots/finder.py, or check for its availability before passing it:
# Option 1 — simply remove it
images = SkyView.get_images(...)
# Option 2 — check availability
import inspect
skyview_params = inspect.signature(SkyView.get_images).parameters
if 'grid' in skyview_params:
images = SkyView.get_images(..., grid=grid, ...)
else:
images = SkyView.get_images(...)
Description
When calling
plot_finder_image(), astroplan internally passes agridkeyword argument toastroquery.skyview.SkyView.get_images(). This argument is no longer accepted by the current version of astroquery, causing aTypeError.Environment
astroplan version: 0.10.1
astroquery version: 0.4.11
astropy version: 6.x
Python version: 3.12
OS: Linux (Raspberry Pi OS / Ubuntu)
Steps to reproduce
Error
Root cause
In
astroplan/plots/finder.py, the functionplot_finder_imagecallsSkyView.get_images()with agrid=gridkeyword argument:The
gridparameter has been removed fromSkyView.get_images()in recent versions of astroquery and is no longer a valid argument.Workaround
Removing
grid=gridfrom theSkyView.get_images()call inastroplan/plots/finder.pyresolves the issue.Alternatively, pinning astroquery to a version that still accepts the
gridparameter works around the problem, but is not a sustainable solution.Suggested fix
Remove the
gridparameter from theSkyView.get_images()call inastroplan/plots/finder.py, or check for its availability before passing it: