示例#1
0
    def radec2azel(self, mjd, ra, dec):
        """
        Given RA/Dec and time returns Az/El.

        Parameters
        ----------
        mjd : float
            Date in MJD.
        ra : float
            Right ascension in radian.
        dec : float
            Declination in radian.

        Returns
        ----------
        az : float
            Azimuth in radian.
        el : float
            Elevation in radian.
        """
        amprms = slalib.sla_mappa(self.epequi, mjd)
        self.aoprms = slalib.sla_aoppat(mjd, self.aoprms)
        ra_app, dec_app = slalib.sla_mapqkz(ra, dec, amprms)
        az, zd, a, b, c = slalib.sla_aopqk(ra_app, dec_app, self.aoprms)
        el = np.pi / 2 - zd
        return az, el
示例#2
0
def apparent_to_altzd(ra, dec, aop_params):
    '''
        Perform apparent->observed place transformation on a targets apparent ra and dec, given aop_params which
        are generated from slalibs sla_aoppa call.
    :param ra: apparent ra
    :param dec: apparent dec
    :param aop_params: slalibs aop params structure
    :return: azimuth and zenith angles
    '''
    (obs_az, obs_zd, obs_ha, obs_dec,
     obs_ra) = sla.sla_aopqk(ra.in_radians(), dec.in_radians(), aop_params)

    return Angle(radians=obs_az), Angle(radians=obs_zd)