[AstroPy] Conversion from a Cartesian representation to SkyCoord

Tim Cornwell realtimcornwell at gmail.com
Sun Feb 11 12:47:39 EST 2018


I'm working with some radio data in astropy. I need to convert to and from the l, m, n. Given a position on the sky, pos, I can calculate l, m, n as follows:

todc = pos.transform_to(phasecentre.skyoffset_frame())
dc = todc.represent_as(CartesianRepresentation)
l, m, n = dc.y.value, dc.z.value, dc.x.value - 1
How do I do the reverse operation? i.e. given a set of l, m, n defined with respect to phase centre how to get the SkyCoord? The easy part is the conversion between direction cosines and l, m, n:

dc = lm[2] + 1, lmn[0], lmn[1]
Thanks, Tim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20180211/3c45f400/attachment.html>


More information about the AstroPy mailing list