Skip to content

Commit

Permalink
✨ Implement hips2fits function
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Jul 23, 2024
1 parent 75330ed commit 0e520a2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/ipyaladin/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,30 @@ def target(self, target: Union[str, SkyCoord]) -> None:
}
)

def hips2fits(self, hips: str, output_file: Optional[str] = None) -> None:
"""Convert a HiPS image to a FITS file.
Parameters
----------
hips: str
The HiPS to convert. See here for a list of available HiPS:
https://aladin.cds.unistra.fr/hips/list
output_file: str, optional
The name of the output FITS file. If None, the FITS file is not saved.
"""
from astroquery.hips2fits import hips2fits

fits = hips2fits.query_with_wcs(
hips=hips,
format="fits",
get_query_payload=False,
wcs=self.wcs,
)
if output_file is not None:
fits.writeto(output_file)
return fits

def add_catalog_from_URL(
self, votable_URL: str, votable_options: Optional[dict] = None
) -> None:
Expand Down

0 comments on commit 0e520a2

Please sign in to comment.