How to use the jplephem.daf.DAF function in jplephem

To help you get started, we’ve selected a few jplephem 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 skyfielders / python-skyfield / skyfield / contrib / iosurvey.py View on Github external
def get_summary(url, spk=True):
    ''' simple function to retrieve the header of a BSP file and return SPK object'''
    # connect to file at URL
    bspurl = urllib2.urlopen(url)
    # retrieve the "tip" of a file at URL
    bsptip = bspurl.read(10**5) # first 100kB
    # save data in fake file object (in-memory)
    bspstr = StringIO(bsptip)
    # load into DAF object
    daf = DAF(bspstr)
    # return either SPK or DAF object
    if spk:
      # make a SPK object
      spk = SPK(daf)
      # return representation 
      return spk
    else:
      # return representation 
      return daf