Beispiel #1
0
def hor2gal(azimuth, elevation, time, date_obs=QubicSampling.DEFAULT_DATE_OBS,
            latitude=DOMECLAT, longitude=DOMECLON):
    """
    hor2gal(az, el, time, [date_obs, [latitude, [longitude]]]) -> l, b
    Horizontal to galactic spherical conversion. Angles are in degrees.

    Parameters
    ----------
    time : array-like
        Elapsed time in seconds since date_obs.
    date_obs : string
        The starting date, UTC.
    latitude : float
        The observer's latitude geolocation. Default is Dome C.
    longitude : float
        The observer's longitude geolocation. Default is Dome C.

    Example
    -------
    >>> hor2gal(50.35837815921487, 39.212362279976155, 0)
    (array(4.452776554048925e-14), array(-7.63333123551244e-14))

    """
    incoords, time = _format_sphconv(azimuth, elevation, date_obs, time)
    h2e = SphericalHorizontal2EquatorialOperator(
        'NE', time, latitude, longitude, degrees=True)
    e2g = SphericalEquatorial2GalacticOperator(degrees=True)
    outcoords = e2g(h2e(incoords))
    return outcoords[..., 0], outcoords[..., 1]
Beispiel #2
0
def hor2equ(azimuth, elevation, time, date_obs=QubicSampling.DEFAULT_DATE_OBS,
            latitude=DOMECLAT, longitude=DOMECLON):
    """
    hor2equ(az, el, time, [date_obs, [latitude, [longitude]]]) -> ra, dec
    Horizontal to equatorial spherical conversion. Angles are in degrees.


    Parameters
    ----------
    time : array-like
        Elapsed time in seconds since date_obs.
    date_obs : string
        The starting date, UTC.
    latitude : float
        The observer's latitude geolocation. Default is Dome C.
    longitude : float
        The observer's longitude geolocation. Default is Dome C.

    Example
    -------
    >>> hor2equ(135.71997181016644, -10.785386358099927, 0,
    ...         date_obs='2000-01-01 00:00:00')
    (array(1.1927080055488187e-14), array(-1.2722218725854067e-14))

    """
    incoords, time = _format_sphconv(azimuth, elevation, date_obs, time)
    outcoords = SphericalHorizontal2EquatorialOperator(
        'NE', time, latitude, longitude, degrees=True)(incoords)
    return outcoords[..., 0], outcoords[..., 1]