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

Add capability for light-travel-time correction #3055

Merged
merged 5 commits into from May 8, 2019

Conversation

Projects
5 participants
@ayshih
Copy link
Contributor

commented Apr 17, 2019

Addresses #3039 by adding functionality to get_body_heliographic_stonyhurst(). When one specifies an observer through the keyword observer, an iterative loop determines the emission time in the past that results in photons arriving at the observation time. In the following example, Venus's apparent HGS coordinates have been corrected by the 5 Mm that the planet moves in the 144 seconds of light travel time:

>>> from sunpy.coordinates import get_body_heliographic_stonyhurst, get_earth
>>> t = '2012-06-05 22:34:48.350'

>>> without_correction = get_body_heliographic_stonyhurst('venus', t)
>>> print(without_correction)
<HeliographicStonyhurst Coordinate (obstime=2012-06-05T22:34:48.350): (lon, lat, radius) in (deg, deg, AU)
    (359.92620234, 0.02752007, 0.72602872)>

>>> with_correction = get_body_heliographic_stonyhurst('venus', t, observer=get_earth(t))
Apparent location factors in 144.063097622999 seconds of light travel time
>>> print(with_correction)
<HeliographicStonyhurst Coordinate (obstime=2012-06-05T22:34:48.350): (lon, lat, radius) in (deg, deg, AU)
    (359.92355609, 0.02734159, 0.72602853)>

>>> distance_traveled = (with_correction.cartesian - without_correction.cartesian).norm().to('km')
>>> print(distance_traveled)
<Quantity 5027.81720838 km>

Only get_body_heliographic_stonyhurst() has been modified because corrections for light travel time are usually significant only for planetary bodies, where the transverse angular motion of the body is appreciable relative to the light travel time. In principle, our coordinate transformations need to take into account the motion of the Sun in barycenter coordinates, but the Sun moves only ~5 km in the ~8 minutes that it takes light to traverse 1 AU, which is a negligible correction (i.e., <0.01 arcseconds in helioprojective coordinates).

Needs a test.

@pep8speaks

This comment has been minimized.

Copy link

commented Apr 17, 2019

Hello @ayshih! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 68:19: E127 continuation line over-indented for visual indent

Comment last updated at 2019-05-07 12:49:04 UTC
@sunpy-bot

This comment has been minimized.

Copy link

commented Apr 17, 2019

Thanks for the pull request @ayshih! Everything looks great!

@ayshih ayshih added the coordinates label Apr 17, 2019

@ayshih ayshih requested a review from Cadair Apr 17, 2019

@nabobalis nabobalis added this to the 1.0 milestone Apr 18, 2019

@Cadair

Cadair approved these changes Apr 24, 2019

Copy link
Member

left a comment

Looks good but needs a test and a changelog

Show resolved Hide resolved sunpy/coordinates/ephemeris.py
Show resolved Hide resolved sunpy/coordinates/ephemeris.py Outdated
Show resolved Hide resolved sunpy/coordinates/ephemeris.py Outdated
Show resolved Hide resolved sunpy/coordinates/ephemeris.py
@ehsteve

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

Tested this and it works!

@Cadair Cadair added this to Release Blocking Items in SunPy 1.0 May 1, 2019

@Cadair Cadair moved this from Release Blocking Items to High Priority Features in SunPy 1.0 May 1, 2019

@Cadair Cadair moved this from Post-Feature Freeze to Pre-Feature Freeze (2019-05-08) in SunPy 1.0 May 2, 2019

@ayshih

This comment has been minimized.

Copy link
Contributor Author

commented May 6, 2019

I added a test.

@Cadair

Cadair approved these changes May 7, 2019

@Cadair Cadair merged commit 8aa10a3 into sunpy:master May 8, 2019

16 checks passed

ci/circleci: 32bit Your tests passed on CircleCI!
Details
ci/circleci: egg-info-36 Your tests passed on CircleCI!
Details
ci/circleci: egg-info-37 Your tests passed on CircleCI!
Details
ci/circleci: figure-tests-36 Your tests passed on CircleCI!
Details
ci/circleci: html-docs Your tests passed on CircleCI!
Details
ci/circleci: pip-install Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 89.89%)
Details
codecov/project 89.91% (+0.01%) compared to 69a3e49
Details
giles Click details to preview the documentation build
Details
sunpy-bot All checks passed
sunpy.sunpy Build #20190507.1 succeeded
Details
sunpy.sunpy (Linux_36_Conda_offline) Linux_36_Conda_offline succeeded
Details
sunpy.sunpy (Linux_36_offline) Linux_36_offline succeeded
Details
sunpy.sunpy (Linux_37_online) Linux_37_online succeeded
Details
sunpy.sunpy (Windows_36_offline) Windows_36_offline succeeded
Details
sunpy.sunpy (macOS_37_offline) macOS_37_offline succeeded
Details

@Cadair Cadair moved this from Pre-Feature Freeze (2019-05-08) to Finished in SunPy 1.0 May 8, 2019

@ayshih ayshih deleted the ayshih:light_travel_time branch May 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.