Repository navigation
Conversation
|
The name is certainly up for discussion too, particularly since the name |
|
The proper way to do this from ICRS is exactly like For solar system bodies, you already have these in the GCRS frame, so the fastest way to get the astrometric position is to use As a side note, the expression (x ** 2 - y**2) should always be evaluated as (x - y) * (x + y) to avoid round off error. I noticed that in your expression for |
|
Oh, never mind about zeroing |
|
I looked into this more carefully and I see that the function On the other hand, for solar system bodies you are assuming that the given coordinates do not already include light time delay. This is incorrect for the very important case of planets, the Sun and the Moon. The GCRS positions of these returned by For solar system objects other than these, the situation becomes unclear. If given an ICRS frame containing position, distance within the solar system and velocity, you don't a priori know whether or not these already include light time delay to the observer. |
Indeed, I should probably add a giant warning. As you note, people should not combine both |
|
I'll point out that the analogous function to Of course, from the coordinate itself, it's impossible to divine whether light-travel-time delay has been included or not, as you also note. The user presumably has to bear some responsibility here. |
|
For |
I hope the "standard", if there is one, is to have no light-travel-time delay included. The SSB is not a sane choice for the observer location (for solar-system bodies). For what it's worth, JPL Horizons returns the instantaneous positions of bodies when asking for vectors, so it's straightforward to avoid having light-travel-time delay baked in. |
|
Incidentally, it occurred to me to check how inaccurate the linear-motion approximation would be for Parker Solar Probe during a perihelion and an Earth observer. It looks like it's off by ~36 km and ~43 mas. For most purposes, that level of discrepancy may be acceptable. For an Earth observer, I suspect the worst case for something orbiting the Sun may be Sun-grazing comets. The largest discrepancies would presumably be for satellites orbiting other planets. |
|
@ayshih - I think it is down to what you noted before, that we are missing infrastructure. Right now, everything is based around obstime, so I would argue light travel delay is included implicitly (and arguably that is the correct way of thinking about it - there is no absolute time after all). The solution for having an "instantaneous" position would seem to have a way to indicate that the observer is at the object itself (possibly just having Anyway, far from being able to properly wrap my head around this, but the need for "giant warnings" is worrying. |
|
p.s. I'll try to have a more proper look instead of reacting to the discussion! |
|
One further question regarding astrometric star positions. I see that
Well, one major point of my request for an astrometric frame was to be able to compare the positions returned by By the way, considering the rather huge error in position and distance that you report for Venus, I took your tutorial as a lesson on what not to do. Astropy really needs to aim for less than 1 mas accuracy for planets.
Are you sure of this? Horizons vector output includes a light time delay and I've always assumed that this was applied to the position and velocity vectors. |
|
Oh, I do see that there are three choices in Horizons under Optional vector-table settings: |
|
|
|
Actually, have you tried this with the output of |
True. Because Responses to earlier comments, working backwards:
I'd forgotten that options other than "geometric" were even available...
For
I think this perspective would majorly conflict with the current design of the transformation framework. For the most part, despite its name, I think of
I'll point out that |
Why do you say that? The only velocity used in
I'm afraid that I don't understand this. Aren't there just two choices, topocentric or geocentric observer? I suppose other choices would be an orbiting observatory such as Hubble which is really just an extension of topocentric or an observatory in orbit around the Sun which would also experience annual parallax, but that could easily be dealt with as well.
I understand that, so that statement is moot assuming that any catalog star with parallax also has a distance included. The reason for including parallax in star catalogs is so that annual parallax can be computed without distance information as is done by Regarding accuracy, I am entirely focused on getting planetary astrometric positions at full SOFA accuracy, whereas your focus seems to more on comets, asteroids and spacecraft, so we may need to agree to disagree on that. |
The goal in astropy is to do exactly that! But now having looked a bit at the PR, I got a bit confused. In #10230, the Now I think that I understand that in principle, "astrometric" can make sense for other systems, but just so I get things right: in the context of this PR, the one in Fig. 2 of the SOFA tools documentation would be In any case, are there fewer issues with that specific frame? E.g., can one do without the assumptions about distance for solar system vs stars? (Which I'd really rather not have anywhere!) If so, would it make sense to just only define that one for now, since it can be constructed directly from SOFA routines? p.s. Happy to be told that I'm misunderstanding things, but if that happens to a poor astronomer like me who actually has written papers on astrometry (neutron star parallaxes with HST), it is clear that this better all be documented excruciatingly well! |
|
(I've renamed the primary keyword argument to
I was referring specifically to the implementation in this PR, where
This PR currently chooses not to shift the origin of the astrometric version of the base coordinate frame to the observer location. It won't matter for
Yup, understood. I'm primarily interested in supporting seeing solar-system bodies in solar imagery, which means that accuracy typically doesn't need to be better than ~100 mas. It's critical that there be a way to get the highest accuracy, but I feel that it's useful to provide additional tools for use cases where a compromise in accuracy may be acceptable to achieve other benefits. In this case, it's the increase in usability due to integration into the transformation framework. See #6068 for a proposed compromise in accuracy to significantly increase performance.
No. If I understand the SOFA documentation correctly:
The problem is handling the motion of solar-system bodies. The SOFA transformations are really intended for stars, so I don't know if you can "hack in" solar-system bodies by thinking in terms of parallax and proper motion. Edit: As pointed out later (#10372 (comment)), I managed to confuse myself when I wrote parts of the above comment. This PR's |
|
@ayshih - thanks for explaining! I do feel rather at a loss here, and it helps to understand the goals. I should add that I'm rather weary of adding things which are not precise - I think the goal is that we always provide a best-of-class precision - and am super-happy that for Anyway, for the present PR, I guess it does not cover the case I thought it did. The main question would seem to be whether one can do better, and, if not, whether it is better to have a good-enough approximation or whether one should just refer to other packages which do it right. |
The main issue here is that SOFA is only concerned with extra-solar system bodies (i.e. stars). You can see that in Figure 1 of the SOFA Astrometry Tools documentation as there is no mention of light time delay (planetary aberration, if you will). The same difficulty exists when it comes to gravitational light deflection where SOFA assumes that there is no difference in the direction from the target body to an observer on Earth than from the target body to the Sun. (i.e. the target body is at a distance such that the Earth and the Sun are coincident from its point of view, see issue #10291). In order to provide planetary ephemerides, it is necessary for astropy to meld an ephemeris package such as the one provided by JPL onto the SOFA package. An essential part of this melding is to provide the light time delayed BCRS position of the solar system target body as seen from the observer at any given time. The astrometric position of the target body is then calculated by subtracting the BCRS position of the observer from the light time delayed BCRS position of the target body. In an analogous manner, the proper way to provide the astrometric position of a non-planetary solar system body (comet, asteroid, spacecraft) is to provide an ephemeris for this body along with a method for calculating the light time delayed position of the body from the point of view of the observer. This ephemeris could be a simple two body propagator that works from a given set of orbital elements or, as in the case of this PR, simply a position and velocity at a given time that is then time delayed by linearly offsetting the given position by using the velocity. It is important to note here that the act of providing the time delayed position (adding planetary aberration) isn't actually a function of the astrometric frame transformation at all. This is, in fact, analogous to adding space motion in the above referenced Figure 1 and so is, strictly speaking, the step before this where the ICRS catalog position of a star or the ICRS instantaneous ephemeris position of a solar system body is transformed to the BCRS position of the target body at the time of observation from the point of view of the observer. The astrometric frame transformation is then performed by the subtraction of the observer's position in the BCRS from the BCRS position of the target body. This is why the BCRS to astrometric transformation shown in Figure 1 only includes parallax. That said, the ICRS to BCRS step is an important step in the ICRS->BCRS->astrometric frame transformation, so that functionality needs to be provided. I'm just saying that the paradigm for this should be some sort of ephemeris routine like
I assume that you meant Figure 1 here. There is no such thing as "AstrometricGCRS". For a topocentric observer, the position of the observer wrt the Earth's geocenter is expressed in the GCRS frame, but this frame is aligned with the BCRS and, of course, aberration and gravitational light deflection aren't an issue for the observer, so this is actually the BCRS position of the observer since the position of the Earth's geocenter is also expressed in the BCRS.
There seems to be some misunderstanding here. The GCRS coordinates of the target body include stellar and dirunal aberration and gravitational light deflection, so any frame transformation from astrometric to GCRS will include these effects regardless of any velocity present in the target body's BCRS position.
I'm afraid that you lost me here. Space motion is applied during the transformation of the star's ICRS catalog position to the BCRS position at the time of the observation. It is this BCRS position that is subject to gravitational light deflection during the transformation from BCRS to GCRS, so that order is correct. As a side note, it appears to me that the numerical instability in near parabolic elliptical orbits that @astrojuanlu referred to in the discussion of issue #10230 only occurs when the true anomaly is near 180 degrees as seen in this plot from poliastro/poliastro#475 It makes sense that there would be difficulty in closing the orbit at aphelion in very near parabolic situations, but for the most part comets in these types of orbits are well beyond the range of observation near aphelion so there is likely no practical situation that astropy would be presented with that would preclude the use of a simple two body propagator to provide an ephemeris constructed from orbital elements. Sorry for the "wall of text", but some things need a lot of exposition to be as absolutely clear as possible. |
|
One simple way to handle this might be to add some sort of flag attribute to SkyCoord() objects to indicate what type of object (star, planet, non-planetary solar system object) they are so that you can tell what method to use when transforming from ICRS to BCRS. (i.e. apply_space_motion, do nothing, apply linear time delay). |
|
Sorry, I think you got confused by some of the terminology since backticks are easy to miss and get removed by default when quoting:
I'll be explicit in the following responses, including adding qualifiers to quoted excerpts:
Yes, having a routine for a ICRS->BCRS conversion that works on both stars and solar-system bodies is a solution. That's equal to the transformation in this PR from Astropy's
Astropy's
Edit: As pointed out later (#10372 (comment)), I managed to confuse myself when I wrote parts of the above comment. This PR's |
|
@mkbrewer, @ayshih - thanks both for the explanations! @ayshih - astropy's GCRS not being consistent with that of SOFA would seem to be a bug, and quite a bad one at that given that I think we are meant to be consistent with SOFA. If so, it would be good to separate it from this PR (though it sounds like the PR might have to rely on solving it to be viable...). Could you do that? I think copying over the relevant parts of your comment above would do. p.s. My guess is that this may be a bit of a historical accident, since the whole coordinate package was initially written without proper motions, and this may have been simply missed when we added support for those. |
Yes, I noticed that
I still don't understand this. The first thing that you do in this PR is to transform the target body's position to ICRS, so it seems to me that, if given a GCRS position, that would remove aberration and gravitational light deflection before proceeding to apply space motion or light time delay. But, not being an astropy expert, maybe I'm missing something. |
I guess the question is: If a user transforms in Astropy from
Ha! You're absolutely right. I had a total brain misfire earlier. Too many meetings today. I walk all the transformations through ICRS and do the propagation there, so that should unwind all the corrections and reapply them in the correct order. Whew. |
Well, documentation and maybe emitting a warning when trying to transform a coordinate with velocity out of ICRS if it doesn't look like it's been propagated (e.g., if it's not in a |
An obvious way to automate this would be for transforms from ICRS to GCRS, CIRS or observed to pass through the astrometric frame. Of course, this means that the astrometric frame would need to be very robust in knowing what sort of object it was dealing with in order to take the appropriate action. |
|
See #10404 for a suggested approach that implements BCRS (in SOFA's Figure 1) and allows a user to define how the ICRS<->BCRS transformations should behave. |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 1 year, 3 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 1 year, 3 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
|
Ops, sorry for the double bot post. Hopefully I fixed the bug upstream. |
|
I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks! If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here. |

This PR was inspired by discussions in #10230. Ping @mhvk @mkbrewer @astrojuanlu
This PR introduces
AstrometricFramefor creating an astrometric version of a coordinate frame, relative to a specified observer location. (It does so in a similar manner toSkyOffsetFrame.) These astrometric frames integrate astrometric calculations directly into the transformation framework.SkyCoord.apply_space_motion()).There's a tutorial in the PR, and here are some excerpts:
Venus
A star
This PR needs tests and even more documentation, but it's more than ready for feedback.