Aladin commands#

[1]:
from astropy.coordinates import Angle, SkyCoord
from ipyaladin import Aladin, Marker
from pathlib import Path

ipyaladin’s full list of methods can be found in the documentation here. A few of them are illustrated in the next cells. Let’s first, create the widget with a few initial parameters:

[2]:
aladin = Aladin(fov=20, reticle_size=64, reticle_color="#ff89ff")
aladin
[2]:

They can also be modified in the next cells with an interactive effect on the generated view.

[3]:
aladin.target = "sgr a*"
[4]:
aladin.target
[4]:
<SkyCoord (ICRS): (ra, dec) in deg
    (266.41681663, -29.00782497)>

The x-axis field of view (fov) can be set

[5]:
aladin.fov = 2
[6]:
aladin.fov
[6]:
$2^\circ00{}^\prime00{}^{\prime\prime}$

The overlay survey is always on top of the base layer

[7]:
aladin.overlay_survey = "P/allWISE/color"
aladin.overlay_survey_opacity = 0.5

We can change the coordinate frame (the choices are ICRS, ICRSd or Galactic).

[8]:
aladin.coo_frame = "ICRSd"  # ICRS, and angles expressed in degrees
[9]:
aladin.coo_frame
[9]:
'ICRSd'

The target and field of view can be set with astropy objects

[10]:
aladin.target = SkyCoord("12h00m00s", "-30d00m00s", frame="icrs")
[11]:
aladin.fov = Angle(5, "deg")

You can add a FITS image to the view of the widget, either as a path (string of pathlib.Path object) or as an astropy HDU object.

[12]:
aladin.add_fits(Path("images/m31.fits"), name="M31", opacity=0.5)

You can add markers to the view of the widget with custom popup title and description. Here we will add markers for Messier objects M1 to M10.

[13]:
markers = []
for i in range(1, 11):
    name = f"M{i}"
    markers.append(
        Marker(
            position=name,
            title=name,
            # the title and description can be written as plain text or as html elements
            description=(
                '<a href="https://simbad.cds.unistra.fr/simbad/'
                f'sim-basic?Ident={name}&submit=SIMBAD+search"> '
                "Read more on SIMBAD</a>"
            ),
        )
    )
aladin.add_markers(markers, name="M1-M10", color="pink", shape="cross", source_size=15)
aladin.target = "M1"
aladin.fov = 0.2