diff --git a/src/ipyaladin/widget.py b/src/ipyaladin/widget.py index c909d655..5468b34c 100644 --- a/src/ipyaladin/widget.py +++ b/src/ipyaladin/widget.py @@ -308,12 +308,16 @@ def hips2fits(self, hips: str, output_file: Optional[str] = None) -> None: The name of the output FITS file. If None, the FITS file is not saved. """ - from astroquery.hips2fits import hips2fits + try: + from astroquery.hips2fits import hips2fits + except ImportError as imp: + raise ValueError( + "To use the hips2fits method, you need to install the astroquery " + "library with 'pip install astroquery'." + ) from imp fits = hips2fits.query_with_wcs( hips=hips, - format="fits", - get_query_payload=False, wcs=self.wcs, ) if output_file is not None: