Cube visualisation and axes

Skip to first unread message

Clément Hottier

Feb 25, 2020, 6:22:47 AM2/25/20
to Glue users

Hi everyone,

I just begin using glue, so sorry if it is a dummy question, but I do not find the answer in the doc.

I work with a 3D cube (dimension (a,b,c,)) on regular grid. It is basically in galactic coordinates (l,b,d).and I also have 3 unidimensional array which contain the physical values of each direction of the grid.

I manage to link world0, world1 and world2 to my unidemsionnal array, but when I use the 2Dimage view, to see a slice of (l,b) at different distances, it is working perfectly but axis are in pixels instead being in degree with actual values of l and b.

How set the axis labels and ticks to be in the right coordinate ? I know it is possible because it is shown on documentation :; slices are in ra/dec. should I need wcs transformation ?


Thomas Robitaille

Jun 1, 2020, 6:49:35 AM6/1/20
Hi Cment,

Apologies for my late reply - indeed for the labels to show up correctly it is not sufficient to link the axes to 1-d arrays. You will instead need to make sure the dataset has a WCS defined (for astronomy data). So the easiest way to achieve what you need is to write the data as a FITS file with a WCS transformation defined then load that into glue. If you already have the data in glue you can also set Data.coords to be a WCS object.

Alternatively, if you are not familiar with the astropy WCS class or if your case is too tricky to represent by a WCS transformation, you can also define your own custom coordinate transformation object as shown here:


You received this message because you are subscribed to the Google Groups "Glue users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages