Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Error while reading Halley's comet from DASTCOM5 #902

Closed
astrojuanlu opened this issue Apr 11, 2020 · 2 comments
Closed

Error while reading Halley's comet from DASTCOM5 #902

astrojuanlu opened this issue Apr 11, 2020 · 2 comments

Comments

@astrojuanlu
Copy link
Member

While trying to follow https://docs.poliastro.space/en/stable/examples/Using%20NEOS%20package.html#DASTCOM5-module, I found this error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-9-3bb5fa7c99be> in <module>
----> 1 halleys = dastcom5.orbit_from_name("1P")
      2 
      3 frame = StaticOrbitPlotter()
      4 frame.plot(halleys[0], label="Halley")
      5 frame.plot(halleys[5], label="Halley")

~/.pyenv/versions/3.8.0/envs/poliastro38/lib/python3.8/site-packages/poliastro/neos/dastcom5.py in orbit_from_name(name)
    339     orbits = []
    340     for record in records:
--> 341         orbits.append(orbit_from_record(record))
    342     return orbits
    343 

~/.pyenv/versions/3.8.0/envs/poliastro38/lib/python3.8/site-packages/poliastro/neos/dastcom5.py in orbit_from_record(record)
    359 
    360         """
--> 361     body_data = read_record(record)
    362     a = body_data["A"].item() * u.au
    363     ecc = body_data["EC"].item() * u.one

~/.pyenv/versions/3.8.0/envs/poliastro38/lib/python3.8/site-packages/poliastro/neos/dastcom5.py in read_record(record)
    508 
    509         with open(ast_path, "rb") as f:
--> 510             f.seek(phis_rec, os.SEEK_SET)
    511             body_data = np.fromfile(f, dtype=AST_DTYPE, count=1)
    512     else:

OSError: [Errno 22] Invalid argument

I tried downloading dastcom5.zip twice to check that it was correct:

juanlu@ephyra:~$ sha256sum ~/.poliastro/dastcom5.zip 
64ea3f5753a877797be217840bf6582c85e948c31daaf3e6635bcf9e3b8c392c  /home/juanlu/.poliastro/dastcom5.zip
juanlu@ephyra:~$ sha256sum ~/Downloads/dastcom5.zip
64ea3f5753a877797be217840bf6582c85e948c31daaf3e6635bcf9e3b8c392c  /home/juanlu/Downloads/dastcom5.zip

This is relevant to the work @shreyasbapat is doing. @anhiga might want to take a look at this :)

@astrojuanlu
Copy link
Member Author

Some more relevant information:

$ python -c "import sys; print(sys.version)"
3.8.0 (default, Dec 16 2019, 15:17:05) \n[GCC 7.4.0]

@astrojuanlu
Copy link
Member Author

Fixed in #910.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant