ebachelet / pyLIMA

GNU General Public License v3.0
31 stars 8 forks source link

Ephermides interpolation fails when JPL Horizon returns timestamps not covering the entire light curve #92

Closed ketozhang closed 2 weeks ago

ketozhang commented 2 weeks ago

The function to interpolate the ephemerides given spacecraft positions will fail if any extrapolation is necessary. This makes sense to me and it is up to the user to pass in spacecraft ephemeris that spans the range of the light curve.

However, the case for extrapolation also happens without the user's control. In particular, if the light curve is too old, then JPL Horizon may not return ephemerides that spans the light curve.


The failure happens in line 198 here

https://github.com/ebachelet/pyLIMA/blob/ac9f76ab47d39a64885c80f5fd79327c5a6a180d/pyLIMA/parallax/parallax.py#L183-L204


For example, I pass in a light curve ranging from 2458234.5 to 2459946.5 JD without specifying spacecraft positions. Running a parallax fit, JPL Horizon was downloaded but its timestamps does not span this light curve (see figure).

Figure_1

ketozhang commented 2 weeks ago

Nevermind, I had some magic happening where I forced JPL Horizon to return a specific ephemerides. I wasn't actually downloading from JPL Horizon