processing_library/util/coordinate_support.py
def skycoord_to_lmn(pos: SkyCoord, phasecentre: SkyCoord):
    """
    Convert astropy sky coordinates into the l,m,n coordinate system
    relative to a phase centre.

    The l,m,n is a RHS coordinate system with
    * its origin on the sky sphere
    * m,n and the celestial north on the same plane
    * l,m a tangential plane of the sky sphere

    Note that this means that l increases east-wards
    """
    
    # Determine relative sky position
    todc = pos.transform_to(phasecentre.skyoffset_frame())
    dc = todc.represent_as(CartesianRepresentation)
    
    # Do coordinate transformation - astropy's relative coordinates do
    # not quite follow imaging conventions
    return dc.y.value, dc.z.value, dc.x.value - 1

    Convert astropy sky coordinates into the l,m,n coordinate system
    relative to a phase centre.

    The l,m,n is a RHS coordinate system with
    * its origin on the sky sphere
    * m,n and the celestial north on the same plane
    * l,m a tangential plane of the sky sphere

    Note that this means that l increases east-wards
    
Convert astropy sky coordinates into the l,m,n coordinate system
relative to a phase centre.

The l,m,n is a RHS coordinate system with
its origin on the sky sphere
m,n and the celestial north on the same plane
l,m a tangential plane of the sky sphere

Note that this means that l increases east-wards
Convert astropy sky coordinates into the l m n coordinate system relative to a phase centre . The l m n is a RHS coordinate system with its origin on the sky sphere m n and the celestial north on the same plane l m a tangential plane of the sky sphere Note that this means that l increases east - wards
def skycoord_to_lmn(pos: SkyCoord, phasecentre: SkyCoord):
    todc = pos.transform_to(phasecentre.skyoffset_frame())
    dc = todc.represent_as(CartesianRepresentation)
    return dc.y.value, dc.z.value, dc.x.value - 1
def skycoord_to_lmn ( pos : SkyCoord , phasecentre : SkyCoord ) : todc = pos . transform_to ( phasecentre . skyoffset_frame ( ) ) dc = todc . represent_as ( CartesianRepresentation ) return dc . y . value , dc . z . value , dc . x . value - 1
Convert astropy sky coordinates into the l,m,n coordinate system
relative to a phase centre.
Convert astropy sky coordinates into the l m n coordinate system relative to a phase centre .
"""
    Convert astropy sky coordinates into the l,m,n coordinate system
    relative to a phase centre.

    The l,m,n is a RHS coordinate system with
    * its origin on the sky sphere
    * m,n and the celestial north on the same plane
    * l,m a tangential plane of the sky sphere

    Note that this means that l increases east-wards
    """ # Determine relative sky position # Do coordinate transformation - astropy's relative coordinates do # not quite follow imaging conventions
pos
SkyCoord
phasecentre
SkyCoord