-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
WCS world_to_pixel dependent on SkyCoord distance #16430
Comments
Thanks for picking this up! I still have my notebook server running and can verify that |
I think this is unrelated to WCS - one also gets different results if converted to FK5 which is one of the steps of putting it in the WCS: I need a coordinates expert to chime in, but I think what is happening is that FK5 (and ICRS etc) are barycentric coordinate frames, so if you convert a 3D SkyCoord (including finite distance) into barycentric coordinates you won't get the RA/Dec that you would see the object at from Earth, but from the barycenter. This is equivalent to RA/Dec you would see from Earth if the object was at an infinite distance. This is why I think the coordinates without distance work fine (because the barycentric/topocentric difference doesn't matter then since distance is assumed to be infinite) and coordinates with distance don't. |
Your explanation is correct @astrofrog . One way of thinking about this is that for an observer at the barycenter the Sun would indeed be in the image at pixel (440, 1323). I’m not sure this is independent of WCS though. This behaviour is surprising enough that there should be a warning if coordinates in a non-barycentric frame of reference is passed to This is reminiscent of the feature that caused so much confusion is |
Thanks for looking into this. I'm a little confused. Am I interpreting what is being said correctly? When transforming a SkyCoord into a WCS, it always transforms through a barycentric coordinate frame and as a result, all locations in WCS are apparent ra/dec relative the sun-earth barycenter? |
@mkolopanis - no it won't always transform to barycentric, but your WCS is in FK5 which is a barycentric system, and RA/Dec will be relative to the Sun/Earth barycenter (which is how RA and Dec are defined in FK5) - you see the same effect if you just convert your positions to RA/Dec without even a WCS (see #16430 (comment)) |
Thanks for the reply, appreciate it. Yeah that makes a lot of sense. I did
some more digging into the fits header after reading through all your
messages earlier. Made me think if wsclean wrote out in another frame it
out be different. Thanks for confirming.
…On Fri, May 10, 2024, 16:53 Thomas Robitaille ***@***.***> wrote:
@mkolopanis <https://github.com/mkolopanis> - no it won't always
transform to barycentric, but your WCS is in FK5 which *is* a barycentric
system, and RA/Dec will be relative to the Sun/Earth barycenter (which is
how RA and Dec are defined in FK5) - you see the same effect if you just
convert your positions to RA/Dec without even a WCS (see #16430 (comment)
<#16430 (comment)>)
—
Reply to this email directly, view it on GitHub
<#16430 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACB7BLO3YXTULRJHD2FOBWTZBVMXPAVCNFSM6AAAAABHPI3N32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGM4TANJRGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi humans 👋 - this issue was labeled as Close? approximately 11 hours ago. If you think this issue should not be closed, a maintainer should remove the Close? label - otherwise, I will close this issue in 7 days. If you believe I commented on this issue incorrectly, please report this here |
I'm going to close this issue as per my previous message, but if you feel that this issue should stay open, then feel free to re-open and remove the Close? label. 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 |
Description
I have been using WCS to add celestial objects to radio astronomy observations and noticed discrepancy between the orthographic projected coordinates of solar system bodies depending on if the distance to the observer is included in their SkyCoord or not.
The AltAz frame azimuth and altitude information for a given body (e.g. the moon) is the same whether the distance is included or not, but when projected into the WCS frame the body will be in significantly different parts of the image.
Moreover, I believe there may be a bug in the coordinate transformation when distance is included because for an observation at night (0400 UTC) for the Owen's Valley Radio Observatory Long Wavelength Array (OVRO-LWA), the projected image coordinates for the Sun exist when the body distance is included which is unphysical as the Sun has set by this point in the night.
Below is the FITS header in string form, I have also uploaded the FITS image to this google drive to be more easily accessible.
Attached below is the MWE pulled from a notebook where I produced this calculation.
FITS Header information
Expected behavior
Position of the Sun on projected into a ortho-slant image should be
(nan, nan)
at the observation time2024-04-11T04:02:25.000 UTC
at the locationGeodeticLocation(lon=<Longitude -118.28166669 deg>, lat=<Latitude 37.23977727 deg>, height=<Quantity 1183.48 m>)
. Instead usingastropy.coordinates.get_body
and projecting to wcs coordinates results in pixel values of the sun being up.How to Reproduce
Versions
The text was updated successfully, but these errors were encountered: