Displaying HiPS Images#
This notebook shows how to display HiPS (Hierarchical Progressive Survey) images in Firefly and how to add MOC layer to them.
Setup#
First, we create a FireflyClient instance and open a Firefly viewer. See Initializing a FireflyClient instance for more details.
[1]:
from firefly_client import FireflyClient
# Initialize a FireflyClient instance
fc = FireflyClient.make_client(url="https://irsa.ipac.caltech.edu/irsaviewer")
Show HiPS image#
HiPS images are fetched and rendered progressively from a HiPS survey endpoint. To display a HiPS image, use show_hips method of the FireflyClient object and provide:
hips_root_url: the HiPS survey endpointWorldPt: the target position as a serialized string:'<ra>;<dec>;EQ_J2000'SizeInDeg: (optional) the field of view size in degrees
[2]:
hips_url = 'https://irsa.ipac.caltech.edu/data/hips/CDS/2MASS/Color/'
# hips_url = 'http://alasky.u-strasbg.fr/DSS/DSSColor'
ra = 202.4841667
dec = 47.23055556
size_in_deg = 1.6
target = f'{ra};{dec};EQ_J2000'
hips_plot_id = 'hips-img-id' # to identify this particular image display for later operations
fc.show_hips(plot_id=hips_plot_id,
hips_root_url=hips_url,
Title='HiPS image',
WorldPt=target,
SizeInDeg=size_in_deg # can be omitted
)
[2]:
{'success': True}
Modify displayed HiPS#
You can modify this image display similar to how you would modify a FITS image display.
[3]:
fc.set_pan(plot_id=hips_plot_id, # note we use the plot id we defined above
x=ra+0.25, y=dec-0.25, coord='j2000')
[3]:
{'success': True}
It’s often more convinient to modify image display through UI controls in the image toolbar instead.
Overlay MOC (sky coverage map)#
You can overlay a MOC (Multi-Order Coverage map) on the HiPS image to visually compare the sky coverage. A MOC is typically a single-column table in FITS format, so we can display it using the show_table method. It is recommended to set the visible parameter to False so as not to show a table display in Firefly after fetching the table data for the provided MOC file.
[ ]:
moc_url = 'https://irsa.ipac.caltech.edu/data/MOC/spitzer_seip.moc.fits'
fc.show_table(file_input=moc_url, visible=False)
{'success': True}
Note
It may take some time to load the MOC file, and since there’s no feedback from the table display, look for the spinner on the top left of the HiPS image display.