Skip to content
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

apply_space_motion without distance emits ErfaWarning #11747

Open
orionlee opened this issue May 17, 2021 · 3 comments
Open

apply_space_motion without distance emits ErfaWarning #11747

orionlee opened this issue May 17, 2021 · 3 comments

Comments

@orionlee
Copy link
Contributor

orionlee commented May 17, 2021

Description

When SkyCoord.apply_space_motion() for a coordinate without distance specified, astropy emits the following warning:

WARNING: ErfaWarning: ERFA function "pmsafe" yielded 1 of "distance overridden (Note 6)" [astropy._erfa.core]
WARNING: ErfaWarning: ERFA function "pmsafe" yielded 1077 of "distance overridden (Note 6)" [astropy._erfa.core]
WARNING:astropy:ErfaWarning: ERFA function "pmsafe" yielded 1077 of "distance overridden (Note 6)"

Expected behavior

The warning should not be there.

Steps to Reproduce

import astropy
from astropy import units as u
from astropy.coordinates import SkyCoord, Distance
from astropy.time import Time

c = SkyCoord(90 * u.deg, 45 * u.deg, pm_ra_cosdec=100 * u.mas / u.year, pm_dec= 1000 * u.mas / u.year,
             # uncomment distance to avoid
             #  WARNING: ErfaWarning: ERFA function "pmsafe" yielded 1 of "distance overridden (Note 6)" [astropy._erfa.core]
             # distance=Distance(parallax=768.5004 * u.mas),
             frame='icrs', obstime=Time("2000", format="decimalyear", scale="tt") + 0.5)
print(c.ra, c.dec)
new_c = c.apply_space_motion(new_obstime=Time(2021, format="decimalyear"))
print(new_c.ra, new_c.dec)

Running it will yield the following warning in apply_space_motion() call:

...\site-packages\erfa\core.py:155:  ErfaWarning: ERFA function "pmsafe" yielded 1 of "distance overridden (Note 6)"  ErfaWarning)

System Details

Windows-10-10.0.19041-SP0
Python 3.7.10 (default, Feb 26 2021, 13:06:18) [MSC v.1916 64 bit (AMD64)]
Numpy 1.20.2
astropy 4.3.dev1543+ga371a5903
Scipy 1.6.3
Matplotlib 3.4.1
erfa 1.7.3

@pllim
Copy link
Member

pllim commented May 17, 2021

What's your pyerfa version? cc @mhvk

@orionlee
Copy link
Contributor Author

orionlee commented May 17, 2021

pyerfa version: on 1.7.3 (with main) and 1.7.2 (astropy 4.1 release)

I also tested with astropy main with erfa 2.0.0 : the same warning happened.

@rebekah9969
Copy link

rebekah9969 commented Nov 2, 2023

  • macOS Ventura Version 13.5.1
  • Python 3.10.13
  • numpy 1.23.5
  • astropy 5.1
from astropy.coordinates import SkyCoord, Angle, Distance
import astropy.units as u
from astropy.time import Time
import lightkurve as lk
from lightkurve import *

epoch = Time(1569.4424277786259, scale="tdb", format="btjd")
equinox = Time(2000, format="jyear", scale="tt")

c = SkyCoord(
    ra=194.10778581007 * u.deg,
    dec=-27.41053258397 * u.deg,
    pm_ra_cosdec=-16.908 * u.mas/u.year,
    pm_dec=3.894* u.mas/u.year,
    frame="icrs",
    obstime=equinox,
) 

c1 = c.apply_space_motion(new_obstime=epoch)

I am finding the same behavior.
ErfaWarning: ERFA function "pmsafe" yielded 1 of "distance overridden (Note 6)" warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg),

Is there a solution to this please?

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

No branches or pull requests

3 participants