Skip to content

Use solar_system_ephemeris for barycentric corrections and coordinate transforms? #4942

Closed

Description

@mhvk

Currently, Time.light_travel_time uses coordinate transforms to calculate the barycentric corrections, essentially by getting the location-barycentre vector by transforming location to ITRS and using the coordinate framework. With #4890, we now in principle have the ability to do more accurate corrections (by combining the ITRS position with the barycentric position of the Earth), and I think this could even be made automatic by relying on solar_system_ephemeris for a default ephemeris (see #4920).

This issue is mostly to remind us to actually do this.

Furthermore, we should think whether to do this in light_travel_time (probably adding an ephemeris argument, defaulting to solar_system_ephemeris), or rather inside the coordinate frame transform graph. I'm slightly wary of the latter, as many conversions would become dependent on this state, which may lead to hard-to-track inconsistencies. On the other hand, it would be great to have the ultimate in precision available if needed.

Activity

  1. StuartLittlefair commented on Aug 25, 2016

    @StuartLittlefair
    Contributor

    Following the work done by @mhvk in #5231, this wouldn't actually be too much of a challenge. Most of the transformation code base between co-ordinate systems can remain in place, but we would replace the calls to erfa.apcs13 and erfa.apci13 with calls to erfa.apcs and erfa.apci. The former use erfa.epv00 to calculate the heliocentric and barycentric position and velocity; the latter ask the user to supply their own.

    I'm thinking we should allow the transform_to method to accept an ephemeris argument which defaults to None, in which case the solar_system_ephemeris is used.

  2. StuartLittlefair commented on Aug 27, 2016

    @StuartLittlefair
    Contributor

    OK I could do with some guidance on this from wiser heads; @eteq, @mhvk.

    We can do as I describe above but at the moment all the co-ordinate transforms have a hard-wired signature of (fromcoord, toframe). So there are two options:

    1. Change the signature of all transforms to (fromcoord, toframe, **kwargs). This allows us to add an ephemeris argument to transform_to which would work exactly as we have in get_body.
    2. Have the coordinate transforms "silently" respect the ephemeris context manager, e.g
    In [1]: ippeg = coord.SkyCoord.from_name('IP Peg')
    
    In [2]: ippeg.transform_to(coord.GCRS(obstime="J2000")) # use the builtin ephemeris by default
    Out[2]: 
    <SkyCoord (GCRS: obstime=J2000.000, obsgeoloc=[ 0.  0.  0.] m, obsgeovel=[ 0.  0.  0.] m / s): (ra, dec) in deg
        (350.78366528, 18.4178038)>
    
    In [3]: with coord.solar_system_ephemeris.set('jpl'):
       ...:     gcrs = ippeg.transform_to(coord.GCRS(obstime="J2000"))
       ...:     
    
    In [4]: gcrs
    Out[4]: 
    <SkyCoord (GCRS: obstime=J2000.000, obsgeoloc=[ 0.  0.  0.] m, obsgeovel=[ 0.  0.  0.] m / s): (ra, dec) in deg
        (350.78366528, 18.4178038)>
    

    Those two results are different by the way, at the 0.2 microarcecond level!

    Despite the former being more explicit, I am leaning towards the latter since, for many transforms, the "ephemeris" argument makes no sense, and so it seems odd to add it to transform_to.

  3. StuartLittlefair commented on Aug 27, 2016

    @StuartLittlefair
    Contributor

    To help discussion, I have a branch which fully implements option 2 here

  4. mhvk commented on Aug 27, 2016

    @mhvk
    ContributorAuthor

    @StuartLittlefair - I haven't looked at your branch yet, but like the idea of using the science state (although for items like light_travel_time, where one might not immediately think of coordinate transforms, I think an ephemeris element is still appropriate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions