question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Separation between moon and target not reversible

See original GitHub issue

Description

When I want to compute the distance between the moon and an object I get two different value based on which reference I use (the moon of the object)

Expected behavior

It should be exactly the same

Actual behavior

The separation between the moon and the target is different.

Steps to Reproduce

import astropy.units as u
from astropy import coordinates as c
import astropy.time as TIME

##get a position on earth
obs = c.EarthLocation.of_site('Keck Observatory')

##and a time
start_time = '2018-01-23T01:01:05.813'
starttime = TIME.Time(start_time, format='isot', scale='utc')

##get the moon information
moon = c.get_moon(starttime, location=obs)

##and get a target
RA = 97.00
DEC = 4.9
c1 = c.SkyCoord(RA, DEC, frame='fk5', unit='deg')

##and compute the separation
moon_sep = moon.separation(c1)
moon_sep2 = c1.separation(moon)

if you print moon_sep and moon_sep2 you will get 86.05756420797839 and 30.615793847554087.

By the way, if I create a SkyCoord object manually from the moon coordinates:

c2 = c.SkyCoord(moon.ra.value, moon.dec.value, frame='fk5', unit='deg')
sep = c1.separation(c2)
sep2 = c2.separation(c1)

I get: sep = sep2 = 86.05242730221599 which is slightly different from one of the previous value but this time the reference does not matter.

System Details

Linux-5.9.16-1-MANJARO-x86_64-with-glibc2.33 Python 3.9.2 (default, Mar 3 2021, 20:02:32) [GCC 7.3.0] Numpy 1.21.2 astropy 4.3.1 Scipy 1.7.1 Matplotlib 3.4.3

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
astrom-tomcommented, Sep 23, 2021

I did not really find anything so I allowed myself to post it there. In any case, if this is a known behavior I guess it would be useful to mention it in the webpage about separation here

1reaction
pllimcommented, Sep 23, 2021

I feel like similar questions have been asked several times. I vaguely remember the explanation being something about frame of reference. Either that, or that is no moon! Maybe @adrn could clarify for real.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Determining The Proximity Of The Moon To Any Target and ...
In this tutorial you gained an understanding of how the Moon affects SNR, you learned the minimum separation between the Moon and your...
Read more >
Oceanography Chapter 9 Flashcards | Quizlet
During one Earth rotation, the Moon has continued orbiting Earth. A) Grunion spawn on the three or four nights prior to the highest...
Read more >
Reversible & Irreversible Processes - Definition, Examples ...
Learn about the reversible and irreversible process, the factors on which the irreversibility of an equation depends and the ideal case of reversibility....
Read more >
SJ4.pdf
In this situation, a membrane separating the gas from an evacu- ated region is broken and the gas expands to a volume Vf...
Read more >
ACCRETION PROCESSES - arXiv
explain not only how planets form but also why the outcomes of the accretion ... distance from the central star, the sedimentation time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found