Open livi099 opened 1 year ago
I should really update that error message to display dates rather than just the raw numbers.
Are you perhaps running into issue #691? Could you show what prints out when you run the command to list the segments in an ephemeris? The command is shown here:
https://github.com/skyfielders/python-skyfield/issues/691#issuecomment-1017675291
I found out, that the binary file (moon_pa_de440_200625.bpc) consists of two segments. So in planetarylib.py (line 70,71) only the second segment (starts at some point in year 2400) will be saved and used for calculations. I adapted the planetarylib.py so that segment one (longer date range than segment two) will be used. But in case you have an idea to connect both segments to use the whole time range, I'm I am very open to it.
I just had the chance to sit down and try your sample code. I get this error (once I fix the slight syntax error caused by the double tick characters on line 11):
Traceback (most recent call last):
File "tmp837.py", line 14, in <module>
frame = pc.build_frame_named('MOON_ME_DE421')
File "/home/brandon/skyfield/skyfield/planetarylib.py", line 84, in build_frame_named
integer = self._get_assignment('FRAME_{0}'.format(name))
File "/home/brandon/skyfield/skyfield/planetarylib.py", line 80, in _get_assignment
raise e
ValueError: unknown planetary constant 'FRAME_MOON_ME_DE421'
You should either use this object's `.read_text()` method to load an
additional "*.tf" PCK text file that defines the missing name, or
manually provide a value by adding the name and value to the this
object's `.variables` dictionary.
--------------------
Do you know what I can do to move past this error, and see the expected output of your script.
from skyfield.api import PlanetaryConstants, load
ts = load.timescale()
t = ts.utc(2019, 12, 20, 11, 5)
eph = load('de440.bsp')
earth, moon = eph['earth'], eph['moon']
pc = PlanetaryConstants()
pc.read_text(load('https://naif.jpl.nasa.gov/pub/naif/generic_kernels/fk/satellites/moon_de440_220930.tf'))
pc.read_text(load('https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc'))
pc.read_binary(load('https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/moon_pa_de440_200625.bpc'))
frame = pc.build_frame_named('MOON_ME_DE440_ME421')
aristarchus = moon + pc.build_latlon_degrees(frame, 26.3, -46.8)
apparent = earth.at(t).observe(aristarchus).apparent()
ra, dec, distance = apparent.radec(epoch='date')
print(ra)
print(dec)
This code generates my error.
Thank you, I now see the same error message! I'm not sure what's going on, but when I have the chance I'll dig in and try to find out.
Hi, I try to run the code from the skyfield documentation (Observing a Moon location) but with the tf, tpc and bpc files for the DE440. The code with the files for DE421 as it is in the documentation works, but when I use the files for DE440 I get an error.
Code:
Error message:
Thank you!