Overplotting the position of the Venus transit

How to accurately plot the position of Venus as it transitted in front of the Sun as observed by SDO/AIA.

import matplotlib.pyplot as plt

import astropy.units as u
from astropy.coordinates import SkyCoord, solar_system_ephemeris

import sunpy.map
from sunpy.coordinates import get_body_heliographic_stonyhurst
from sunpy.net import Fido
from sunpy.net import attrs as a

Let’s download an image of the Venus transit.

result = Fido.search(a.Time('2012/06/06 04:07:25', '2012/06/06 04:07:35'),
                     a.Instrument.aia,
                     a.Wavelength(1600*u.angstrom))
files = Fido.fetch(result)
aiamap = sunpy.map.Map(files[0])

Out:

Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]/home/docs/checkouts/readthedocs.org/user_builds/sunpy/conda/stable/lib/python3.8/site-packages/aiohttp/connector.py:964: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  hosts = await asyncio.shield(self._resolve_host(
/home/docs/checkouts/readthedocs.org/user_builds/sunpy/conda/stable/lib/python3.8/site-packages/aiohttp/locks.py:21: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._event = asyncio.Event(loop=loop)


aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   0%|          | 0.00/7.54M [00:00<?, ?B/s]/home/docs/checkouts/readthedocs.org/user_builds/sunpy/conda/stable/lib/python3.8/site-packages/aiohttp/connector.py:964: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  hosts = await asyncio.shield(self._resolve_host(


aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   0%|          | 100/7.54M [00:01<28:20:36, 73.9B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   0%|          | 29.8k/7.54M [00:01<19:45:54, 106B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   1%|          | 69.8k/7.54M [00:01<13:45:48, 151B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   2%|1         | 121k/7.54M [00:01<9:34:09, 215B/s]  

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   2%|2         | 181k/7.54M [00:01<6:38:43, 307B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   3%|3         | 250k/7.54M [00:01<4:36:33, 439B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   4%|4         | 327k/7.54M [00:02<3:11:35, 627B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   6%|5         | 424k/7.54M [00:02<2:12:21, 896B/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   7%|7         | 535k/7.54M [00:02<1:31:13, 1.28kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:   9%|8         | 658k/7.54M [00:02<1:02:46, 1.83kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  10%|#         | 789k/7.54M [00:02<43:08, 2.61kB/s]  

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  12%|#2        | 932k/7.54M [00:02<29:34, 3.72kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  15%|#4        | 1.10M/7.54M [00:02<20:12, 5.31kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  17%|#6        | 1.28M/7.54M [00:02<13:46, 7.58kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  20%|#9        | 1.47M/7.54M [00:02<09:21, 10.8kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  22%|##2       | 1.68M/7.54M [00:03<06:20, 15.4kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  25%|##5       | 1.91M/7.54M [00:03<04:16, 21.9kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  29%|##8       | 2.15M/7.54M [00:03<02:52, 31.2kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  32%|###2      | 2.41M/7.54M [00:03<01:55, 44.3kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  36%|###5      | 2.70M/7.54M [00:03<01:16, 62.8kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  40%|####      | 3.02M/7.54M [00:03<00:50, 88.9kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  44%|####4     | 3.35M/7.54M [00:03<00:33, 125kB/s] 

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  49%|####9     | 3.70M/7.54M [00:03<00:21, 176kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  54%|#####3    | 4.04M/7.54M [00:03<00:14, 247kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  58%|#####7    | 4.36M/7.54M [00:04<00:09, 341kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  63%|######2   | 4.73M/7.54M [00:04<00:06, 464kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  69%|######8   | 5.20M/7.54M [00:04<00:03, 635kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  75%|#######5  | 5.68M/7.54M [00:04<00:02, 859kB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  82%|########2 | 6.19M/7.54M [00:04<00:01, 1.14MB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  88%|########7 | 6.61M/7.54M [00:04<00:00, 1.46MB/s]

aia_lev1_1600a_2012_06_06t04_07_29_12z_image_lev1.fits:  95%|#########4| 7.16M/7.54M [00:04<00:00, 1.87MB/s]
Files Downloaded: 100%|##########| 1/1 [00:05<00:00,  5.45s/file]
Files Downloaded: 100%|##########| 1/1 [00:05<00:00,  5.45s/file]


                                                                                                            

For this example, we require high-precision ephemeris information. The built-in ephemeris provided by astropy is not accurate enough. This call requires jplephem to be installed. This will also trigger a download of about ~10 MB.

Out:

<ScienceState solar_system_ephemeris: 'de432s'>

Now we get the position of Venus and convert it into the SDO/AIA coordinates. The apparent position of Venus accounts for the time it takes for light to travel from Venus to SDO.

venus = get_body_heliographic_stonyhurst('venus', aiamap.date, observer=aiamap.observer_coordinate)
venus_hpc = venus.transform_to(aiamap.coordinate_frame)

Out:

INFO: Apparent body location accounts for 144.14 seconds of light travel time [sunpy.coordinates.ephemeris]

Let’s crop the image with Venus at its center.

fov = 200 * u.arcsec
bottom_left = SkyCoord(venus_hpc.Tx - fov/2, venus_hpc.Ty - fov/2, frame=aiamap.coordinate_frame)
smap = aiamap.submap(bottom_left, width=fov, height=fov)

Let’s plot the results.

ax = plt.subplot(projection=smap)
smap.plot()
smap.draw_limb()
ax.grid(False)
ax.plot_coord(venus_hpc, 'x', color='deepskyblue', label='Venus')
plt.legend()
plt.show()
AIA $1600 \; \mathrm{\mathring{A}}$ 2012-06-06 04:07:29

Total running time of the script: ( 0 minutes 56.750 seconds)

Gallery generated by Sphinx-Gallery