How to use the pyephem.Observer function in pyephem

To help you get started, we’ve selected a few pyephem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HERA-Team / aipy / ant.py View on Github external
__radd__ = __add__
    def __neg__(self):
        return -self.pos
    def __sub__(self, a):
        return self.pos - a.pos
    def __rsub__(self, a):
        return a.pos - self.pos

#     _                         _                    _   _             
#    / \   _ __ _ __ __ _ _   _| |    ___   ___ __ _| |_(_) ___  _ __  
#   / _ \ | '__| '__/ _` | | | | |   / _ \ / __/ _` | __| |/ _ \| '_ \ 
#  / ___ \| |  | | | (_| | |_| | |__| (_) | (_| (_| | |_| | (_) | | | |
# /_/   \_\_|  |_|  \__,_|\__, |_____\___/ \___\__,_|\__|_|\___/|_| |_|
#                         |___/                                        

class ArrayLocation(ephem.Observer):
    """Collected information about where and when an array is."""
    def __init__(self, location=None, uv=None):
        """location:   location of the array in (lat, long, [elev])
        uv:         Miriad UV file"""
        ephem.Observer.__init__(self)
        self.cache = 0
        if not uv is None: self.from_uv(uv)
        else:
            if location is None:
                raise ValueError('Must provide either uv or location.')
            self.update_location(location)
    def update_location(self, location):
        """Initialize the antenna array for the provided location.  Locations
        may be (lat, long) or (lat, long, elev)."""
        if len(location) == 2: self.lat, self.long = location
        else: self.lat, self.long, self.elev = location

pyephem

Empty package that depends on "ephem"

LGPL-3.0
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis