Skip to content

Commit

Permalink
🥅 Improve error management for hips2fits
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Jul 23, 2024
1 parent 0e520a2 commit 33a9232
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ipyaladin/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 33a9232

Please sign in to comment.