Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intru function to calculate the pointing correction #49

Open
louisbondonneau opened this issue Jun 25, 2021 · 0 comments
Open

intru function to calculate the pointing correction #49

louisbondonneau opened this issue Jun 25, 2021 · 0 comments

Comments

@louisbondonneau
Copy link

louisbondonneau commented Jun 25, 2021

def pointing_correction(beam_coord):
    """ Pointing correction from a given SkyCoord in altaz.
        :param beam_coord:
            SkyCoord object of the pointing in altaz.
        :type beam_coord: :class: ~astropy.coordinates.sky_coordinate.SkyCoord
        :returns: delta_az and delta_alt in deg
        :rtype: :array of float
    """

    if not (beam_coord.name == 'altaz'):
            print("ERROR: this coord need to be in altaz")

    sav_data = readsav('cor_azel.sav')
    delta_alt_data = sav_data['del_cor']
    delta_az_data = sav_data['daz_cor']
    alt_vevctor = np.linspace(15, 90, 76)
    az_vevctor = np.linspace(0, 360, 361)
    delta_alt_func = interpolate.interp2d(az_vevctor, alt_vevctor, delta_alt_data, kind='cubic')
    delta_az_func = interpolate.interp2d(az_vevctor, alt_vevctor, delta_az_data, kind='cubic')
    delta_alt = delta_alt_func(beam_coord.az.deg, beam_coord.alt.deg)
    delta_az = delta_az_func(beam_coord.az.deg, beam_coord.alt.deg)
    return (delta_alt*u.deg/60., delta_az*u.deg/60.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant