def tan2fp(xtan, ytan): """ Convert tangent plane coordinates to focal plane mm Args: xtan: sin(theta)*cos(phi) ytan: sin(theta)*sin(phi) Returns xfp, yfp in CS5 coordinates on the focal plane """ phi = np.arctan2(ytan, xtan) rtan = np.hypot(xtan, ytan) theta = arcsind(rtan) r = theta2radius(theta) x = r * np.cos(phi) y = r * np.sin(phi) return x, y
def altaz2hadec(alt,az) : """ Convert Altitude, Azimuth to HA, Dec at Kitt Peak elevation Args: alt: float or 1D np.array altitude in degrees az: float or 1D np.array azimuth in degrees Returns: ha, dec ha: float or 1D np.array Hour Angle in degrees dec: float or 1D np.array Hour Angle in degrees """ salt,calt = sincosd(alt) saz,caz = sincosd(az) slat,clat = sincosd(LATITUDE) ha = arctan2d( -saz*calt, -caz*slat*calt+salt*clat) dec = arcsind(slat*salt+clat*calt*caz) return ha,dec
def getLONLAT(xyz): """Convert xyz into its spherical angles""" xyz = getNormalized(xyz) # usually unnecessary return arctan2d(xyz[1],xyz[0]) , arcsind(xyz[2]) # degrees