Skip to content

Add capability for light-travel-time correction#3055

Merged
Cadair merged 5 commits intosunpy:masterfrom
ayshih:light_travel_time
May 8, 2019
Merged

Add capability for light-travel-time correction#3055
Cadair merged 5 commits intosunpy:masterfrom
ayshih:light_travel_time

Conversation

@ayshih
Copy link
Copy Markdown
Member

@ayshih ayshih 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
Copy link
Copy Markdown

pep8speaks 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

@ghost
Copy link
Copy Markdown

ghost commented Apr 17, 2019

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

@ayshih ayshih added the coordinates Affects the coordinates submodule label Apr 17, 2019
@ayshih ayshih requested a review from Cadair April 17, 2019 21:51
@nabobalis nabobalis added this to the 1.0 milestone Apr 18, 2019
Copy link
Copy Markdown
Member

@Cadair Cadair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but needs a test and a changelog

@ehsteve
Copy link
Copy Markdown
Member

ehsteve commented Apr 25, 2019

Tested this and it works!

@ayshih
Copy link
Copy Markdown
Member Author

ayshih commented May 6, 2019

I added a test.

@Cadair Cadair merged commit 8aa10a3 into sunpy:master May 8, 2019
@ayshih ayshih deleted the light_travel_time branch May 21, 2019 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coordinates Affects the coordinates submodule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants