TwiceAsNice  2019-02-18
Functions | Variables
LN_Angles Namespace Reference

Functions

def CalcAllSlit (PS, sep, km)
 
def Sky2Slit (P, sep, par)
 
def CalcAllSky (P, sep, par, km)
 
def Slit2Sky (PS, sep, par)
 
def Slit2Input (PS, sep)
 
def Input2Slit (IA, sMM)
 
def Input2PCam (IA, sMM, km)
 
def PCam2Input (PCA, sPC, km)
 
def PSsep2ElAz (PS, sep)
 
def Polar2XY (ang, sep)
 
def XY2Polar (dX, dY)
 

Variables

float offAng = 71.5
 
 pCamAsPerPix = numpy.array([0.1444,0.1450])
 
 pCamPixPerMM = numpy.array([11.310,11.199])
 
float d2r = math.pi/180.0
 
float r2d = 1.0 / d2r
 
float r2s = 3600.0 / d2r
 
 mmPerArcsecLBT = np.array([0.613,0.613])
 
 pCamArcecPerPix = np.array([0.1444,0.1450])
 
float stpmmG = 29.5
 
float maxstpG = stpmmG*100.0
 

Detailed Description

# $Header: https://svn.mpia.de/gulli/TwiceAsNice/branch/unstable/ln/lics/src/tom/guider/LN_Angles.py 15038 2018-01-23 22:57:12Z mathar $
#
#   LN ANGLES - Gathers standard constants and transformations in one place.
#
#   You can use these routines by using an absolute address input in python:
#
#     import imp
#     LNA = imp.load_source('LN_Angles','/Users/herbst/Dropbox/LINC-NIRVANA/Python/LN_Angles.py')
#
#
#   The COORDINATE TRANSFORMATIONS are:
#
#     CalcAllSky - Calculate all transformations based on input sky vector
#
#     CalcAllSlit - Calculates all transformations post-slit coordinates based on ElAz
#
#     Sky2SLit - Transforms from Sky to Slit coordinates and vice versa
#     Slit2Sky
#
#     Slit2Input - Transforms from Slit to Input coordinates and vice versa
#     Input2Slit
#
#     Input2PCam - Transforms from Input to PCam coordinates and vice versa
#     PCam2Input
#
#
#   GENERAL UTILITIES
#
#     PSsep2ElAz  - Returns the Elevation - Azimuth offsets for supplied Slit angle PS and sep
#
#     Polar2XY    - Returns the XY location of the supplied PA and sep
#
#     XY2Polar    - Returns the position angle (Cartesian) and separation for dx,dy
#
#   * NOTE: Not all of these are currently implemented (28.2.17) !
#
################################################################################
################################################################################
#
#   LN ANGLES - Gathers standard constants and transformations in one place.
#
#   You can use these routines by using an absolute address input in python:
#
#     import imp
#     LNA = imp.load_source('LN_Angles','/Users/herbst/Dropbox/LINC-NIRVANA/Python/LN_Angles.py')
#
#
#   The COORDINATE TRANSFORMATIONS are:
#
#     CalcAllSky - Calculate all transformations based on input sky vector
#
#     CalcAllSlit - Calculates all transformations post-slit coordinates based on ElAz
#
#     Sky2SLit - Transforms from Sky to Slit coordinates and vice versa
#     Slit2Sky
#
#     Slit2Input - Transforms from Slit to Input coordinates and vice versa
#     Input2Slit
#
#     Input2PCam - Transforms from Input to PCam coordinates and vice versa
#     PCam2Input
#
#
#     Input2GWST* - Transforms Input to GWS coordinates and vice versa
#     GWS2Input
#
#     Input2HWS*  - Transforms Input to HWS coordinates and vice versa
#     HWS2Input
#
#     Input2SC*   - Transforms Input to Science Channel coordinates and vice versa
#     SC2Input
#
#   GENERAL UTILITIES
#
#     PSsep2ElAz  - Returns the Elevation - Azimuth offsets for supplied Slit angle PS and sep
#
#     Polar2XY    - Returns the XY location of the supplied PA and sep
#
#     XY2Polar    - Returns the position angle (Cartesian) and separation for dx,dy
#
#   * NOTE: Not all of these are currently implemented (28.2.17) !
#
################################################################################

Function Documentation

◆ CalcAllSky()

def LN_Angles.CalcAllSky (   P,
  sep,
  par,
  km 
)
    This routine calculates from Sky coordinates forward by calling
    the utility routines below.

    Input:

        P    - Position Angle on sky (East of North in degrees)
        sep  - Separation in arcsec
        par  - Parallactic angle
        km   - K-mirror angles numpy [SX,DX]

    Output:

        PS,sep      - Slit angle PS and separation in arcsec
        IA,sMM      - Input Angle and separation mm [SX,DX]
        PCA,sPC     - PCam Angle and separation pixels [SX,DX]
        pcX,pcY     - PCam pixel wrt center

◆ CalcAllSlit()

def LN_Angles.CalcAllSlit (   PS,
  sep,
  km 
)
    This routine calculates from horizontal/slit coordinates forward, calling a subset
    of the routines below

    Input:

        PS    - Slit angle CCW from Up in degrees
        sep   - Separation in arcsec
        km    - K-mirror angles numpy [SX,DX]

    Output:

        IA,sMM      - Input Angle and separation mm [SX,DX]
        PCA,sPC     - PCam Angle and separation pixels [SX,DX]
        pcX,pcY     - PCam pixel wrt center

    A glance will tell you that this is very similar to CalAllSky
    This routine calculates from Slit coordinates forward, calling a subset
    of the routines below

    Input:

        PS    - Slit angle CCW from Up in degrees
        sep   - Separation in arcsec
        km    - K-mirror angles numpy [SX,DX]

    Output:

        IA,sMM      - Input Angle and separation mm [SX,DX]
        PCA,sPC     - PCam Angle and separation pixels [SX,DX]
        pcX,pcY     - PCam pixel wrt center

    A glance will tell you that this is very similar to CalAllSky

◆ Input2PCam()

def LN_Angles.Input2PCam (   IA,
  sMM,
  km 
)
    Returns the Patrol Camera Angle (PCA) and separation (pixels) for the
    supplied Input Angles IA and separation in mm sMM.

    Due to peculiarities in assembly, the transformation is different for SX and DX.

    Inputs:     IA  - 2-element numpy array of Input Angles [SX,DX]
                sMM - Separation in mm numpy [SX,DX]
                km  - Current K-Mirror angles numpy [SX,DX]

    Outputs:    PCA     - 2-element numpy array of Patrol Camera Angles [SX,DX]
                sPC     - Separation in pixels numpy [SX,DX]
                pcX,pcY - Actual pixel location, assuming vector from center
                          NOT YET IMPLEMENTED !!

◆ Input2Slit()

def LN_Angles.Input2Slit (   IA,
  sMM 
)
    Returns the slit position angle (PS) and separation (sep in arcsec) for
    the supplied Input coordinate vector IA,sMM. Due to the geometry of the
    LBT, the transformation is different for SX and DX.

    Note also that, unlike Slit2Input (the forward transformation), there are
    two sets of PS and sep returned! The calling routine must keep track!

    Inputs:     IA   - 2-element numpy array of Input Angles [SX,DX]
                sMM  - 2-element numpy array of separation in mm [SX,DX]

    Outputs:    PSa  - 2-element numpy array of Position angle in slit CCW from zenith direction
                sepa - 2-element numpy array of Separation in arcsec

◆ PCam2Input()

def LN_Angles.PCam2Input (   PCA,
  sPC,
  km 
)
    Returns the Input Angle (IA) and separation (mm) for the
    supplied Patrol Camera Angles PCA and separation in pixels sPC.

    Due to peculiarities in assembly, the transformation is different for SX and DX.

    Inputs:     PCA - 2-element numpy array of Patrol Camera Angles [SX,DX]
                sPC - 2-element numpy array of Separation in pixels numpy [SX,DX]
                km  - 2-element numpy array of Current K-Mirror angles numpy [SX,DX]

    Outputs:    IA  - 2-element numpy array of Input Angles [SX,DX]
                sMM - 2-element numpy array of Separation in mm numpy [SX,DX]

    The pcX,pcY stuff is not used and NOT YET IMPLEMENTED !!

◆ Polar2XY()

def LN_Angles.Polar2XY (   ang,
  sep 
)
    Returns the dX,dY offsets corresponding to angle ang (CCW from +X) and
    separation sep.

    Inputs:     ang    - Angle CCW of +X-axis in degrees
                sep    - Separation (arbitrary units)

    Returns:    dX,dY  - Offset converted to Cartesian

◆ PSsep2ElAz()

def LN_Angles.PSsep2ElAz (   PS,
  sep 
)
    Returns the Elevation and Azimuth offsets in arcsec corresponding to the
    supplied Slit coordinate position angle (PS degrees) and separation (sep arcsec)
    Note that the azimuth offset is computed with the same linear scale as
    the elevation offset; so actually the second coordinate is delta(Az)*cos(el)!

    Note that this is not a normal polar to Cartesian conversion, since Slit
    coordinate angles are measured CCW from "up", not the +X axis!

    Inputs:     PS       - Slit coordinates position angle (degrees CCW from up)
                sep      - Separation (arcsec)

    Returns:    dEl,dAz  - Offset converted to Elevation and Azimuth arcsec
    Returns the Elevation and Azimuth offsets in arcsec corresponding to the
    supplied Slit coordinate position angle (PS degrees) and separation (sep arcsec)

    Note that this is not a normal polar to Cartesian conversion, since Slit
    coordinate angles are measured CCW from "up", not the +X axis!

    Inputs:     PS       - Slit coordinates position angle (degrees CCW from up)
                sep      - Separation (arcsec)

    Returns:    dEl,dAz  - Offset converted to Elevation and Azimuth arcsec

◆ Sky2Slit()

def LN_Angles.Sky2Slit (   P,
  sep,
  par 
)
    Returns the Slit coordinate angle PS corresponding to the supplied
    Sky position angle P and parallactic angle par.
    This is just PS = P - par, the parallactic angle.

    Inputs:     P   - Position angle East of North in degrees
                sep - Separation in arcsec
                par - The parallactic angle

    Returns:    PS  - Position angle CCW from zenith direction
                sep - Separation in arcsec

◆ Slit2Input()

def LN_Angles.Slit2Input (   PS,
  sep 
)
    Returns the Input Angle (IA) and separation (mm) for the supplied slit
    vector PS, sep. Due to the geometry of the LBT, the IA transformation is
    different for SX and DX.

    Inputs:     PS  - Position angle in slit CCW from zenith direction
                sep - Separation in arcsec

    Outputs:    IA  - 2-element numpy array of Input Angles [SX,DX]
                sMM - Separation in mm numpy [SX,DX]

◆ Slit2Sky()

def LN_Angles.Slit2Sky (   PS,
  sep,
  par 
)
    Returns the sky coordinate angle P corresponding to the supplied 
    Slit angle PS and parallactic angle par.
    This is just P = PS + par, the parallactic angle.

    Inputs:     PS  - Position angle CCW from zenith direction
                sep - Separation in arcsec
                par  - Parallactic angle

    Returns:    P   - Position angle East of North in degrees
                sep - Separation in arcsec

◆ XY2Polar()

def LN_Angles.XY2Polar (   dX,
  dY 
)
    Returns the position angle and separation corresponding to
    the supplied offsets dX,dY. Note that this is the Cartesian
    position angle, increasing CCW from the +X-axis!

    Inputs:     dX,dY  - Offsets in X,Y directions

    Returns:    ang    - Angle CCW of +X-axis in degrees
                sep    - Separation (arbitrary units)

Variable Documentation

◆ d2r

float LN_Angles.d2r = math.pi/180.0

◆ maxstpG

float LN_Angles.maxstpG = stpmmG*100.0

◆ mmPerArcsecLBT

LN_Angles.mmPerArcsecLBT = np.array([0.613,0.613])

◆ offAng

float LN_Angles.offAng = 71.5

◆ pCamArcecPerPix

LN_Angles.pCamArcecPerPix = np.array([0.1444,0.1450])

◆ pCamAsPerPix

LN_Angles.pCamAsPerPix = numpy.array([0.1444,0.1450])

◆ pCamPixPerMM

LN_Angles.pCamPixPerMM = numpy.array([11.310,11.199])

◆ r2d

float LN_Angles.r2d = 1.0 / d2r

◆ r2s

float LN_Angles.r2s = 3600.0 / d2r

◆ stpmmG

float LN_Angles.stpmmG = 29.5