Repository: sunpy/sunpy

Issue:
User suggested Postel projections
<!--
We know asking good questions takes effort, and we appreciate your time.
Thank you.

Please be aware that everyone has to follow our code of conduct:
https://sunpy.org/coc

These comments are hidden when you submit this github issue.

Please have a search on our GitHub repository to see if a similar issue has already been posted.
If a similar issue is closed, have a quick look to see if you are satisfied by the resolution.
If not please go ahead and open an issue!
-->

### Description

<!--
Provide a general description of the feature you would like.
If you prefer, you can also suggest a draft design or API.
-->
A user at the AAS / SPD SunPy Workshop expressed the desire for Postel projections of the Sun, i.e., [https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection](https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) . This issue is submitted to record this request on their behalf.


Discussion:
Example script that can be transformed into a gallery example (currently requires the dev branch):
```python
import matplotlib.pyplot as plt
import reproject

import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.wcs import WCS

import sunpy.map
from sunpy.data.sample import AIA_171_IMAGE

# Load the sample AIA image
aia_map = sunpy.map.Map(AIA_171_IMAGE)

# Fix the plotting scale
aia_map.plot_settings['norm'].vmin = 0
aia_map.plot_settings['norm'].vmax = 10000

# Define the origin for the Postel projection
origin_hpc = SkyCoord(735*u.arcsec, -340*u.arcsec, frame=aia_map.coordinate_frame)
origin = origin_hpc.heliographic_stonyhurst

# Define the new WCS
out_shape = (750, 750)
out_header = sunpy.map.make_fitswcs_header(
    out_shape,
    origin,
    scale=[0.4, 0.4]*u.deg/u.pix,
    projection_code="ARC"
)
out_wcs = WCS(out_header)

# Reproject the AIA image to the new WCS
output, _ = reproject.reproject_interp(aia_map, out_wcs, out_shape)

# Create the reprojected Map
out_map = sunpy.map.Map(output, out_header)
out_map.plot_settings = aia_map.plot_settings

fig = plt.figure(figsize=(8, 4))

# Plot the original AIA map
ax = fig.add_subplot(1, 2, 1, projection=aia_map)
aia_map.plot(axes=ax)
aia_map.draw_grid(axes=ax, color='blue')
aia_map.draw_limb(axes=ax, color='blue')
ax.plot_coord(origin, 'o', color='red', fillstyle='none', markersize=20)

# Plot the reprojected map
ax = fig.add_subplot(1, 2, 2, projection=out_map)
out_map.plot(axes=ax, autoalign=True, annotate=False)
out_map.draw_grid(axes=ax, color='blue')
out_map.draw_limb(axes=ax, color='blue')
ax.set_xlim(-0.5, out_shape[1] - 0.5)
ax.set_ylim(-0.5, out_shape[0] - 0.5)
ax.set_title('Postel projection centered at ROI')

plt.show()
```
![postel_example](https://user-images.githubusercontent.com/991759/122277561-064bd400-ceb4-11eb-9986-f9d260a6145e.png)
Hello,

I was wondering if I could work on this issue.

I am not entirely sure what the objective is here. Do we want to adjust the above posted script so that it can be a standalone function that is able to take existing solar map data as an argument and re-project it into a Postel projection?

-Farhan

P.S -  I am brand new to open source development and github so please let me know if at any point I am approaching the issue incorrectly or am doing anything else that appears nonsensical.
The task here is not to create a function, but rather to create a new example for [the gallery](https://docs.sunpy.org/en/latest/generated/gallery/) from the script that I posted above.  There needs to be more narrative explaining the steps, particularly having to set the plot limits, and the plot labels need to be cleaned up some.

See [this example](https://docs.sunpy.org/en/latest/generated/gallery/map_transformations/reprojection_heliographic_stonyhurst.html) for a simpler reprojection example.
Ok sounds good. I can do a write up and clean up the labels. I am guessing [this is the spot](https://github.com/sunpy/sunpy/tree/main/examples/map_transformations) in the repository that will need a new file. I'll use the examples in there as a guide.

Resolving patch:
diff --git a/examples/map_transformations/projection_custom_origin.py b/examples/map_transformations/projection_custom_origin.py
new file mode 100644
--- /dev/null
+++ b/examples/map_transformations/projection_custom_origin.py
@@ -0,0 +1,90 @@
+"""
+=====================================================
+Reprojecting to a Map Projection with a Custom Origin
+=====================================================
+
+In this example, we show how to reproject a map to a map projection with a
+custom origin. Here, we choose the target map projection to be the
+`azimuthal equidistant projection <https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection>`__,
+also known as the Postel projection, which has useful properties relative to a
+specified origin of the projection. If a different map projection is desired,
+modifying this example is straightforward.
+
+"""
+
+import matplotlib.pyplot as plt
+
+import astropy.units as u
+from astropy.coordinates import SkyCoord
+
+import sunpy.map
+from sunpy.data.sample import AIA_171_IMAGE
+
+###############################################################################
+# We will use one of the AIA images from the sample data. We fix the range of
+# values for the Map's normalizer for a prettier image.
+
+aia_map = sunpy.map.Map(AIA_171_IMAGE)
+aia_map.plot_settings['norm'].vmin = 0
+aia_map.plot_settings['norm'].vmax = 10000
+
+###############################################################################
+# Next, we create a `~astropy.coordinates.SkyCoord` to define the custom origin
+# of the map projection. Here, we are going to center the projection at the
+# helioprojective coordinates of a particular active region. We want our map
+# projection to be in heliographic Stonyhurst coordinates, so we transform the
+# origin coordinate accordingly.
+
+origin_hpc = SkyCoord(735*u.arcsec, -340*u.arcsec, frame=aia_map.coordinate_frame)
+origin = origin_hpc.heliographic_stonyhurst
+
+###############################################################################
+# We then create a FITS-WCS header that includes our custom origin coordinate.
+# The azimuthal equidistant projection is specified by the code ``"ARC"``.
+# See :doc:`astropy:wcs/supported_projections` for the projection codes for
+# other projections.
+
+out_shape = (750, 750)
+out_header = sunpy.map.make_fitswcs_header(
+    out_shape,
+    origin,
+    scale=[0.4, 0.4]*u.deg/u.pix,
+    projection_code="ARC"
+)
+
+###############################################################################
+# We reproject the map to our FITS-WCS header and copy over the plot settings.
+
+out_map = aia_map.reproject_to(out_header)
+out_map.plot_settings = aia_map.plot_settings
+
+###############################################################################
+# Finally, we plot both the original and reprojected maps side by side.
+
+fig = plt.figure(figsize=(8, 4))
+
+# sphinx_gallery_defer_figures
+
+###############################################################################
+# Plot the original AIA map, with the active region circled in red and the
+# heliographic grid and solar limb in blue.
+
+ax = fig.add_subplot(1, 2, 1, projection=aia_map)
+aia_map.plot(axes=ax)
+aia_map.draw_grid(axes=ax, color='blue')
+aia_map.draw_limb(axes=ax, color='blue')
+ax.plot_coord(origin, 'o', color='red', fillstyle='none', markersize=20)
+
+# sphinx_gallery_defer_figures
+
+###############################################################################
+# Plot the reprojected AIA map, again with the active region circled in red and
+# the heliographic grid and solar limb in blue.
+
+ax = fig.add_subplot(1, 2, 2, projection=out_map)
+out_map.plot(axes=ax)
+out_map.draw_grid(axes=ax, color='blue')
+out_map.draw_limb(axes=ax, color='blue')
+ax.plot_coord(origin, 'o', color='red', fillstyle='none', markersize=20)
+ax.set_title('Postel projection centered at ROI', y=-0.1)
+plt.show()


Test patch: