Repository: sunpy/sunpy

Issue:
Unskip gallery examples before 2.0
A couple of examples are skipped, including the reproject one, we should unskip them before release


Discussion:
Are these skipped just to avoid running them over and over again between releases, or because they're broken?
We normally skip them if they are broken. 

Resolving patch:
diff --git a/examples/map_transformations/skip_reprojection_aia_euvi_mosaic.py b/examples/map_transformations/reprojection_aia_euvi_mosaic.py
similarity index 100%
rename from examples/map_transformations/skip_reprojection_aia_euvi_mosaic.py
rename to examples/map_transformations/reprojection_aia_euvi_mosaic.py
diff --git a/examples/map_transformations/skip_reprojection_different_observers.py b/examples/map_transformations/reprojection_different_observers.py
similarity index 60%
rename from examples/map_transformations/skip_reprojection_different_observers.py
rename to examples/map_transformations/reprojection_different_observers.py
--- a/examples/map_transformations/skip_reprojection_different_observers.py
+++ b/examples/map_transformations/reprojection_different_observers.py
@@ -4,7 +4,10 @@
 ==========================================
 
 This example demonstrates how you can reproject images to the view from
-different observers, we use both AIA and STEREO A data to demonstrate this.
+different observers.  We use data from these two instruments:
+
+* AIA on SDO, which is in orbit around Earth
+* EUVI on STEREO A, which is in orbit around the Sun away from the Earth
 
 You will need `reproject <https://reproject.readthedocs.io/en/stable/>`__ v0.6 or higher installed.
 """
@@ -29,52 +32,55 @@
 plt.rcParams['figure.figsize'] = (16, 8)
 
 ######################################################################
-# Let’s download an EUV image from both AIA and STEREO A, when their
-# separation was around 90 degrees.
+# Let’s download an EUV image from both AIA and EUVI A, when the
+# two spacecraft were separated by approximately 120 degrees.
+
+euvi = (a.vso.Source('STEREO_A')&
+        a.Instrument('EUVI') &
+        a.Time('2011-11-01', '2011-11-01T00:10:00'))
 
-stereo = (a.vso.Source('STEREO_A') &
-          a.Instrument('EUVI') &
-          a.Time('2010-08-19', '2010-08-19T00:10:00'))
 aia = (a.Instrument('AIA') &
        a.Sample(24 * u.hour) &
-       a.Time('2010-08-19', '2010-08-19T00:10:00'))
-wave = a.Wavelength(17 * u.nm, 18 * u.nm)
+       a.Time('2011-11-01', '2011-11-02'))
+
+wave = a.Wavelength(19.5 * u.nm, 19.5 * u.nm)
 
-res = Fido.search(wave, aia | stereo)
+res = Fido.search(wave, aia | euvi)
 files = Fido.fetch(res)
 
 ######################################################################
-# Create a map for each image.
+# Create a map for each image, after making sure to sort by the
+# appropriate name attribute (i.e., "AIA" and "EUVI") so that the
+# order is reliable.
 
-map_aia, map_stereo = sunpy.map.Map(sorted(files))
+map_list = sunpy.map.Map(files)
+map_list.sort(key=lambda m: m.detector)
+map_aia, map_euvi = map_list
 
-# We downsample these maps to reduce memory consumption, you can comment this
-# out.
-map_aia = map_aia.resample((512, 512) * u.pix)
-map_stereo = map_stereo.resample((512, 512) * u.pix)
+# We downsample these maps to reduce memory consumption, but you can
+# comment this out.
+out_shape = (512, 512)
+map_aia = map_aia.resample(out_shape * u.pix)
+map_euvi = map_euvi.resample(out_shape * u.pix)
 
 fig = plt.figure()
 ax1 = fig.add_subplot(1, 2, 1, projection=map_aia)
 map_aia.plot(axes=ax1)
-ax2 = fig.add_subplot(1, 2, 2, projection=map_stereo)
-map_stereo.plot(axes=ax2)
+ax2 = fig.add_subplot(1, 2, 2, projection=map_euvi)
+map_euvi.plot(axes=ax2)
 
 ######################################################################
-# We now need to construct an output WCS. Because we want to downsample
-# the image (for performance) we build a custom header using
-# ``sunpy.map.make_fitswcs_header`` but we use a lot of the ``map_aia``
-# properties to do it. We use the reference coordinate from the AIA image,
-# and make the scale 4x larger to compensate for the fact we are making
-# the resolution 4x lower.
+# We now need to construct an output WCS. We build a custom header using
+# :func:`sunpy.map.make_fitswcs_header` but we use a lot of the ``map_aia``
+# properties to do it.
 
-out_shape = (512, 512)
 out_header = sunpy.map.make_fitswcs_header(
     out_shape,
     map_aia.reference_coordinate,
-    scale=u.Quantity(map_aia.scale)*4,
+    scale=u.Quantity(map_aia.scale),
     instrument="EUVI",
     observatory="AIA Observer",
-    wavelength=map_stereo.wavelength
+    wavelength=map_euvi.wavelength
 )
 
 ######################################################################
@@ -86,41 +92,40 @@
 out_wcs.heliographic_observer = map_aia.reference_coordinate.observer
 
 ######################################################################
-# We can now reproject the STEREO map to this output `~astropy.wcs.WCS`.
+# We can now reproject the EUVI map to this output `~astropy.wcs.WCS`.
 # Here we are using the fastest but least accurate method of reprojection,
-# `reproject.reproject_interp`, a more accurate but slower method is
-# `reproject.reproject_adaptive`.
+# :func:`reproject.reproject_interp`. A more accurate but slower method is
+# :func:`reproject.reproject_adaptive`.
 
-output, footprint = reproject_interp(map_stereo, out_wcs, out_shape)
+output, footprint = reproject_interp(map_euvi, out_wcs, out_shape)
 
 ######################################################################
-# We can now plot the STEREO image as seen from the position of SDO, next
-# to the AIA image.
+# We can now plot the STEREO/EUVI image as seen from the position of
+# SDO, next to the AIA image.
 
 outmap = sunpy.map.Map(output, out_header)
-outmap.plot_settings = map_stereo.plot_settings
+outmap.plot_settings = map_euvi.plot_settings
 
 fig = plt.figure()
 ax1 = fig.add_subplot(1, 2, 1, projection=map_aia)
 map_aia.plot(axes=ax1)
 ax2 = fig.add_subplot(1, 2, 2, projection=outmap)
-outmap.plot(axes=ax2)
+outmap.plot(axes=ax2, title='EUVI image as seen from SDO')
 
 ######################################################################
 # AIA as Seen from Mars
 # =====================
 #
-# We can also change the observer of the AIA image to any observer
-# coordinate. SunPy provides a function which can get the observer
-# coordinate for any known body. In this example we are going to use Mars.
+# The new observer coordinate doesn't have to be associated with an
+# existing Map. SunPy provides a function which can get the location
+# coordinate for any known body. In this example, we use Mars.
 
 mars = get_body_heliographic_stonyhurst('mars', map_aia.date)
 
 ######################################################################
-# We now generate a target WCS, to do this we need to generate a reference
-# coordinate, which is similar to the aia frame, but scaled down by 4x and
-# with the observer at Mars. To do this we generate a new reference
-# coordinate.
+# To generate a target WCS, we first need an appropriate reference
+# coordinate, which is similar to the one for AIA, except now with
+# the observer at Mars.
 
 mars_ref_coord = SkyCoord(map_aia.reference_coordinate.Tx,
                           map_aia.reference_coordinate.Ty,
@@ -129,21 +134,20 @@
                           frame="helioprojective")
 
 ######################################################################
-# then a header
+# We then create the WCS header.
 
-out_shape = (512, 512)
 mars_header = sunpy.map.make_fitswcs_header(
     out_shape,
     mars_ref_coord,
-    scale=u.Quantity(map_aia.scale)*4,
+    scale=u.Quantity(map_aia.scale),
     rotation_matrix=map_aia.rotation_matrix,
     instrument="AIA",
     wavelength=map_aia.wavelength
 )
 
 ######################################################################
-# Once again we need to generate a `~astropy.wcs.WCS` and then manually
-# set the observer location.
+# Once again we need to generate a `~astropy.wcs.WCS` object and then
+# manually set the observer location.
 
 mars_wcs = WCS(mars_header)
 mars_wcs.heliographic_observer = mars
@@ -163,7 +167,7 @@
 outmap.draw_grid(color='w')
 
 ax2 = fig.add_subplot(1, 2, 2, projection=outmap)
-outmap.plot(axes=ax2)
+outmap.plot(axes=ax2, title='AIA observation as seen from Mars')
 outmap.draw_grid(color='w')
 
 plt.show()


Test patch: