From 4628a78825c5ee59ce03f88dc5c4666658e2d094 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 29 Dec 2023 22:19:21 -0800 Subject: [PATCH 1/3] Add text from an email from Albert - Lazy edition --- examples/plotting/plotting_blank_map.py | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/examples/plotting/plotting_blank_map.py b/examples/plotting/plotting_blank_map.py index 2e16b705b90..3070958dc24 100644 --- a/examples/plotting/plotting_blank_map.py +++ b/examples/plotting/plotting_blank_map.py @@ -53,12 +53,35 @@ xc = [0, 50, 400] * u.arcsec yc = [0, 100, 400] * u.arcsec +################################################################################ +# Note that the blue dot corresponding to (0, 0) in helioprojective coordinates is +# not at the intersection of the heliographic equator and the heliographic prime +# meridian. (0, 0) in helioprojective coordinates *is* at the center of the solar +# disk, and at the center of the overall image. The reason that the intersection of +# the two heliographic grid lines is not also at disk center is because the observer +# (specified as Earth in this example) is at non-zero heliographic latitude (because +# the Sun's equatorial plane is tilted relative to the ecliptic plane that contains +# Earth's orbit). Disk center as seen by an observer has the same heliographic +# latitude as the heliographic latitude of the observer, and this value is known as +# the B0 angle, and varies over the year. +# +# To have no no offset (i.e., the heliographic equator is a horizontal line), you +# can specify an observer on the Sun's equatorial plane instead of using Earth as +# the observer. + +# sphinx_gallery_defer_figures + +observer_sun = SkyCoord(0*u.deg, 0*u.deg, 1*u.AU, obstime='2013-10-28', + frame=frames.HeliographicStonyhurst) +skycoord_sun = SkyCoord(0*u.arcsec, 0*u.arcsec, obstime='2013-10-28', + observer=observer_sun, frame=frames.Helioprojective) + ################################################################################ # Place and mark coordinates on the plot. coords = SkyCoord(xc, yc, frame=blank_map.coordinate_frame) -p = ax.plot_coord(coords, 'o') -# Set title. +ax.plot_coord(coords, 'o') +ax.plot_coord(skycoord_sun, 'o') ax.set_title('Plotting fixed points on a blank map') plt.show() From 2bc04a17c7bab3037eb7a8cbef2f07215e8636f8 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Thu, 4 Jan 2024 14:57:18 -0800 Subject: [PATCH 2/3] Changelog --- changelog/7352.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/7352.doc.rst diff --git a/changelog/7352.doc.rst b/changelog/7352.doc.rst new file mode 100644 index 00000000000..7006c8695e6 --- /dev/null +++ b/changelog/7352.doc.rst @@ -0,0 +1 @@ +Added explanation text to :ref:`sphx_glr_generated_gallery_plotting_plotting_blank_map.py` about the offset between "(0, 0)" in helioprojective coordinates and the heliographic equator. From e1302c9f4fe2fe33dbdbd097c7c9d5f560302e51 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 5 Jan 2024 11:20:57 -0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Albert Y. Shih --- examples/plotting/plotting_blank_map.py | 33 ++++++------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/examples/plotting/plotting_blank_map.py b/examples/plotting/plotting_blank_map.py index 3070958dc24..93f2fe42bad 100644 --- a/examples/plotting/plotting_blank_map.py +++ b/examples/plotting/plotting_blank_map.py @@ -54,34 +54,17 @@ yc = [0, 100, 400] * u.arcsec ################################################################################ -# Note that the blue dot corresponding to (0, 0) in helioprojective coordinates is -# not at the intersection of the heliographic equator and the heliographic prime -# meridian. (0, 0) in helioprojective coordinates *is* at the center of the solar -# disk, and at the center of the overall image. The reason that the intersection of -# the two heliographic grid lines is not also at disk center is because the observer -# (specified as Earth in this example) is at non-zero heliographic latitude (because -# the Sun's equatorial plane is tilted relative to the ecliptic plane that contains -# Earth's orbit). Disk center as seen by an observer has the same heliographic -# latitude as the heliographic latitude of the observer, and this value is known as -# the B0 angle, and varies over the year. -# -# To have no no offset (i.e., the heliographic equator is a horizontal line), you -# can specify an observer on the Sun's equatorial plane instead of using Earth as -# the observer. - -# sphinx_gallery_defer_figures - -observer_sun = SkyCoord(0*u.deg, 0*u.deg, 1*u.AU, obstime='2013-10-28', - frame=frames.HeliographicStonyhurst) -skycoord_sun = SkyCoord(0*u.arcsec, 0*u.arcsec, obstime='2013-10-28', - observer=observer_sun, frame=frames.Helioprojective) - -################################################################################ -# Place and mark coordinates on the plot. +# Plot the blank map with the specified coordinates. Note that the marker for +# (0, 0) in helioprojective coordinates is at the center of the solar disk, yet +# the heliographic equator (zero degrees latitude) does not go through the disk +# center and instead curves below it. The reason for that is the observer, +# specified as Earth in this example, is almost always at non-zero heliographic +# latitude, and disk center as seen by such an observer will have that same +# heliographic latitude. The :func:`~sunpy.coordinates.sun.B0` function returns +# Earth's heliographic latitude at a specified time. coords = SkyCoord(xc, yc, frame=blank_map.coordinate_frame) ax.plot_coord(coords, 'o') -ax.plot_coord(skycoord_sun, 'o') ax.set_title('Plotting fixed points on a blank map') plt.show()