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

Can not read INPOP ephemeris #784

Open
luojing1211 opened this issue Oct 1, 2020 · 4 comments
Open

Can not read INPOP ephemeris #784

luojing1211 opened this issue Oct 1, 2020 · 4 comments
Assignees

Comments

@luojing1211
Copy link
Member

PINT currently can not read the ephemeris other than the JPL DExxx format. Our load kernel code assumes the file name would end with ".bsp", which is not true for French INPOP ephemeris. This should be a small fix, but needs more careful design.

@luojing1211 luojing1211 self-assigned this Oct 7, 2020
@abhisrkckl
Copy link
Contributor

TODO: Check this with the detection WG.

@abhisrkckl
Copy link
Contributor

I have tried this with the latest latest dev version of PINT. When I "EPHEM INPOP21a", I get a HTTPError code 404 because "inpop21a.bsp" was not found in any of the websites PINT knows about.

In the INPOP web page, they say that they provide INPOP ephemerides in the JPL format (see https://www.imcce.fr/recherche/equipes/asd/inpop/download21a).
The ephemerides are provided in both big endian and little endian formats.

If we are lucky, the solution to this may be as simple as renaming the files to .bsp and uploading them to data.nanograv.org/ .

@dlakaplan
Copy link
Contributor

I don't think that will work. I downloaded the JPL-formatted little-endian version. I put it in a local directory and appended file:///... to the ephemeris_mirrors list in solar_system_ephemerides.py. It found the file but says:

...
  File "/Users/kaplan/pythonpackages/PINT_dlakaplan/src/pint/solar_system_ephemerides.py", line 53, in _load_kernel_link
    astropy.coordinates.solar_system_ephemeris.set(
  File "/Users/kaplan/opt/anaconda3/envs/pintdev/lib/python3.9/site-packages/astropy/utils/state.py", line 68, in set
    value = cls.validate(value)
  File "/Users/kaplan/opt/anaconda3/envs/pintdev/lib/python3.9/site-packages/astropy/coordinates/solar_system.py", line 120, in validate
    cls.get_kernel(value)
  File "/Users/kaplan/opt/anaconda3/envs/pintdev/lib/python3.9/site-packages/astropy/coordinates/solar_system.py", line 131, in get_kernel
    kernel = _get_kernel(value)
  File "/Users/kaplan/opt/anaconda3/envs/pintdev/lib/python3.9/site-packages/astropy/coordinates/solar_system.py", line 176, in _get_kernel
    return SPK.open(value)
  File "/Users/kaplan/opt/anaconda3/envs/pintdev/lib/python3.9/site-packages/jplephem/spk.py", line 47, in open
    return cls(DAF(open(path, 'rb')))
  File "/Users/kaplan/opt/anaconda3/envs/pintdev/lib/python3.9/site-packages/jplephem/daf.py", line 61, in __init__
    raise ValueError('file starts with {0!r}, not "NAIF/DAF" or "DAF/"'
ValueError: file starts with b'INPOP21A', not "NAIF/DAF" or "DAF/"

Indeed, the JPL files start with NAIF/DAF but the INPOP file does not. This error is thrown by the jplephem package, so it may not be trivial to fix. I can see if a quick update to jplephem fixes this, and if not file an issue.

@dlakaplan
Copy link
Contributor

OK, it's complicated. I don't know if people will look at it, but I filed an issue:
brandon-rhodes/python-jplephem#55

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

3 participants