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

Include offline data to emulate PyEphem's readtle #89

Closed
ckuethe opened this issue May 11, 2016 · 7 comments
Closed

Include offline data to emulate PyEphem's readtle #89

ckuethe opened this issue May 11, 2016 · 7 comments
Assignees

Comments

@ckuethe
Copy link

ckuethe commented May 11, 2016

Inspired by #74, it would be nice if a base data package could be provided - ideally in a way that would emulate ephem.EarthSatellite.readtle. I've been spending a lot of time lately in places without good network connectivity, so having some geocentric defaults available would be very handy.

@brandon-rhodes brandon-rhodes self-assigned this May 11, 2016
@brandon-rhodes
Copy link
Member

Satellite coordinates are only good for about a week or two before they become too inaccurate to be useful. A data package would have to be released every week, and have a way to auto-update probably since it would be useless so quickly.

Could we maybe instead add a function that makes it easy for a user to pull down a data file from one of the official sources, so their release schedule would also serve for Skyfield users? Would a TLE file in your local directory, like Skyfield already puts .bsp files in the local directory for planets, solve your being-offline problem?

@ckuethe
Copy link
Author

ckuethe commented May 11, 2016

I accept responsibility for maintaining the freshness of my TLEs, that's not the problem. The BSP files don't change very often and are valid for decades or more.

My particular pain point comes from:

  • being surprised that downloads are required in order to operate on earth satellites from a geocentric perspective, unlike pyephem.
  • Unreliable network connectivity. Lately I've been on a couple of networks from which ftp was not allowed, or places that had no useful connectivity.

Ideally I'd like something resembling the offline friendly behavior of pyephem.EarthSatellite.readtle

@ckuethe
Copy link
Author

ckuethe commented May 11, 2016

#85 also seems relevant here, since my application is all about earth satellites rather than astronomy.

@brandon-rhodes
Copy link
Member

I should add documentation on offline use, for people who need to sacrifice accuracy in return for being able to use Skyfield offline! Furthermore, I should probably, if possible, have the error that Skyfield prints when offline go ahead and describe how to use Skyfield without network connectivity.

Do you know which file Skyfield was trying to download when you ran into the problem? A traceback would help me know which use case / problem to tackle first!

@ckuethe
Copy link
Author

ckuethe commented May 12, 2016

I can get the exact error later but I was getting connection reset (firewall blocking me) while fetching de421.bsp. You can reproduce that by adding a hosts file entry to make jpl resolve to localhost. Because the traceback contained the URL that the loader was requesting, it was a simple matter able to fetch the files manually on a different machine and drop them into the data directory.

I'd very much like to see documentation of offline use, then I can do some testing to compare online and offline performance.

@ckuethe
Copy link
Author

ckuethe commented May 12, 2016

IOError Traceback (most recent call
last) in () 1 ts =
load.timescale()----> 2 eph = load('de432s.bsp') #
https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/>
3 earth = eph['EARTH'] 4 sat = earth.satellite(txt)
/usr/local/lib/python2.7/dist-packages/skyfield/iokit.pyc in
call(self, filename) 69
verbose=self.verbose)) 70 return data--->
71 return load(filename, self.directory, verbose=self.verbose)
72 73 def timescale(self, delta_t=None):
/usr/local/lib/python2.7/dist-packages/skyfield/iokit.pyc in
load(filename, directory, autodownload, verbose) 174
raise IOError('you specified autodownload=False but the file' 175
' does not exist: {0}'.format(path))--> 176
download(url, path, verbose=verbose) 177 return open(path,
'rb') if (cls is None) else cls(path) 178
/usr/local/lib/python2.7/dist-packages/skyfield/iokit.pyc in
download(url, path, verbose, blocksize) 205 connection =
urlopen(url) 206 except Exception as e:--> 207 raise
IOError('cannot get {0} because {1}'.format(url, e)) 208 if
verbose is None: 209 verbose = sys.stderr.isatty()
IOError: cannot get
https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/%3C/spanftp://ssd.jpl.nasa.gov/pub/eph/planets/bsp/de432s.bsp
because <urlopen error ftp error: [Errno 111] Connection refused>

On Thu, May 12, 2016 at 1:40 AM, Brandon Rhodes [email protected]
wrote:

I should add documentation on offline use, for people who need to
sacrifice accuracy in return for being able to use Skyfield offline!
Furthermore, I should probably, if possible, have the error that Skyfield
prints when offline go ahead and describe how to use Skyfield without
network connectivity.

Do you know which file Skyfield was trying to download when you ran into
the problem? A traceback would help me know which use case / problem to
tackle first!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#89 (comment)

GDB has a 'break' feature; why doesn't it have 'fix' too?

@brandon-rhodes
Copy link
Member

Thank you for spurring me to add explicit support for offline use! I plan to make a new Skyfield release this evening — look for a new “Downloading and Using Data Files” chapter in the docs that will explain a new, clean mechanism for preventing surprise downloads if you already have the data files you need on disk.

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

2 participants