seeing-things/track

Make tool to help plan pass

Closed this issue · 2 comments

Need a tool that generates a plot after alignment that:

  • Shows what regions of the sky are reachable for each meridian side
  • Can plot the trajectory of a satellite across the sky given a TLE for an upcoming pass

Why?

  • Hard to tell exactly which direction the mount pole is oriented when setting up
  • Picking the wrong meridian side can have disastrous effects

Some starter code, borrowing heavily from Astroplan to make the sky plot:

#!/usr/bin/env python3

"""Some of the code here was copied from Astroplan's sky_plot()
https://github.com/astropy/astroplan/blob/master/astroplan/plots/sky.py
which is published with the following license:

Copyright (c) 2015-2017, Astroplan Developers
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.
* Neither the name of the Astropy Team nor the names of its contributors may be
  used to endorse or promote products derived from this software without
  specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

import matplotlib.pyplot as plt
import numpy as np


def make_sky_plot(az, alt):

    ax = plt.gca(projection='polar')
    ax.set_theta_offset(np.pi/2)
    ax.set_theta_direction(-1)
    ax.plot(np.radians(az), alt)
    ax.set_rlim(1, 91)
    ax.grid(True, which='major')

    degree_sign = u'\N{DEGREE SIGN}'

    # For positively-increasing range (e.g., range(1, 90, 15)),
    # labels go from middle to outside.
    r_labels = [
        '90' + degree_sign,
        '',
        '60' + degree_sign,
        '',
        '30' + degree_sign,
        '',
        '0' + degree_sign + ' Alt.',
    ]

    theta_labels = []
    for chunk in range(0, 7):
        label_angle = chunk*45.0
        while label_angle >= 360.0:
            label_angle -= 360.0
        if chunk == 0:
            theta_labels.append('N ' + '\n' + str(label_angle) + degree_sign
                                + ' Az')
        elif chunk == 2:
            theta_labels.append('E' + '\n' + str(label_angle) + degree_sign)
        elif chunk == 4:
            theta_labels.append('S' + '\n' + str(label_angle) + degree_sign)
        elif chunk == 6:
            theta_labels.append('W' + '\n' + str(label_angle) + degree_sign)
        else:
            theta_labels.append(str(label_angle) + degree_sign)

    # Set ticks and labels.
    ax.set_rgrids(range(1, 106, 15), r_labels, angle=-45)
    ax.set_thetagrids(range(0, 360, 45), theta_labels)

    plt.show()

Added skyplot.py in aecc70 which addresses this need. Current features include:

  • Display of which regions of sky are reachable by the mount on each side of mount meridian, using the stored alignment model
  • Plot satellite pass from TLE
  • Plot mount position during the same time period from telemetry

Additional work needed:

  • Ability to generate a custom mount model rather than using a stored one. In particular, need to be able to customize the mount pole location (both azimuth and altitude) and the axis limits.

It might also be possible to write code to predict the optimum location of the mount pole for a given pass based on some criteria but this is out of scope for now.