prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Resampling Maps in the example gallery gives a confusing example for the superpixel method
  ### Provide a general description of the issue or problem.
  
  That's a minor thing perhaps but checking this [page](https://docs.sunpy.org/en/stable/generated/gallery/map/map_resampling_and_superpixels.html) I got confused by the example for the superpixel method. 
  It says:
  `new_dimensions = u.Quantity(aia_map.dimensions) / 16`
  `aia_superpixel_map = aia_map.superpixel([new_dimensions]`
  
  The first line should be instead e.g.:
  `new_dimensions=[16,16]*u.pixel `
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/map/map_resampling_and_superpixels.py`
  Content:
  ```
  1 """
  2 ===============
  3 Resampling Maps
  4 ===============
  5 
  6 How to resample a map using the resample method, which implements interpolation, or
  7 using superpixels, which combines pixels.
  8 """
  9 import matplotlib.pyplot as plt
  10 
  11 import astropy.units as u
  12 
  13 import sunpy.data.sample
  14 import sunpy.map
  15 
  16 ###############################################################################
  17 # We start with the sample data.
  18 
  19 aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
  20 
  21 ##############################################################################
  22 # To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,
  23 # specifying the new dimensions in pixels. By default, this method uses linear interpolation
  24 # but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').
  25 
  26 new_dimensions = [40, 40] * u.pixel
  27 aia_resampled_map = aia_map.resample(new_dimensions)
  28 
  29 ##############################################################################
  30 # Let's plot the result.
  31 
  32 fig = plt.figure()
  33 ax = fig.add_subplot(projection=aia_resampled_map)
  34 aia_resampled_map.plot(axes=ax)
  35 plt.show()
  36 
  37 ##############################################################################
  38 # Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.
  39 # This can be used to increase the signal to noise ratio by reducing the
  40 # resolution of the image by combining pixels. This means that the new dimension
  41 # must divide the original size exactly.
  42 # For example you can reduce the AIA map resolution by a factor of 16.
  43 
  44 new_dimensions = u.Quantity(aia_map.dimensions) / 16
  45 aia_superpixel_map = aia_map.superpixel(new_dimensions)
  46 
  47 ##############################################################################
  48 # Let's plot the result.
  49 
  50 fig = plt.figure()
  51 ax = fig.add_subplot(projection=aia_superpixel_map)
  52 aia_superpixel_map.plot(axes=ax)
  53 plt.show()
  54
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/map/map_resampling_and_superpixels.py b/examples/map/map_resampling_and_superpixels.py
  --- a/examples/map/map_resampling_and_superpixels.py
  +++ b/examples/map/map_resampling_and_superpixels.py
  @@ -13,15 +13,16 @@
   import sunpy.data.sample
   import sunpy.map
   
  -###############################################################################
  +##############################################################################
   # We start with the sample data.
   
   aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
   
   ##############################################################################
  -# To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,
  -# specifying the new dimensions in pixels. By default, this method uses linear interpolation
  -# but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').
  +# To reduce the angular resolution of the map, you can use the
  +# :meth:`~sunpy.map.GenericMap.resample` method, specifying the new dimensions
  +# in pixels. By default, this method uses linear interpolation but this can be
  +# changed with the ``method`` argument ('nearest', 'linear' or 'spline').
   
   new_dimensions = [40, 40] * u.pixel
   aia_resampled_map = aia_map.resample(new_dimensions)
  @@ -35,14 +36,15 @@
   plt.show()
   
   ##############################################################################
  -# Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.
  -# This can be used to increase the signal to noise ratio by reducing the
  -# resolution of the image by combining pixels. This means that the new dimension
  -# must divide the original size exactly.
  -# For example you can reduce the AIA map resolution by a factor of 16.
  -
  -new_dimensions = u.Quantity(aia_map.dimensions) / 16
  -aia_superpixel_map = aia_map.superpixel(new_dimensions)
  +# Another way to reduce the angular resolution of the map is by using the
  +# :meth:`~sunpy.map.GenericMap.superpixel` method, which combines pixels.
  +# The superpixel dimensions do not need to be square, and the intensity of
  +# each superpixel defaults to the sum of the constituent pixels. For example,
  +# you can reduce the AIA map resolution by a factor of 16 by specifying 16x16
  +# superpixels.
  +
  +superpixel_size = [16, 16] * u.pixel
  +aia_superpixel_map = aia_map.superpixel(superpixel_size)
   
   ##############################################################################
   # Let's plot the result.
  
verification_info: {"golden_diff": "diff --git a/examples/map/map_resampling_and_superpixels.py b/examples/map/map_resampling_and_superpixels.py\n--- a/examples/map/map_resampling_and_superpixels.py\n+++ b/examples/map/map_resampling_and_superpixels.py\n@@ -13,15 +13,16 @@\n import sunpy.data.sample\n import sunpy.map\n \n-###############################################################################\n+##############################################################################\n # We start with the sample data.\n \n aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)\n \n ##############################################################################\n-# To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,\n-# specifying the new dimensions in pixels. By default, this method uses linear interpolation\n-# but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n+# To reduce the angular resolution of the map, you can use the\n+# :meth:`~sunpy.map.GenericMap.resample` method, specifying the new dimensions\n+# in pixels. By default, this method uses linear interpolation but this can be\n+# changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n \n new_dimensions = [40, 40] * u.pixel\n aia_resampled_map = aia_map.resample(new_dimensions)\n@@ -35,14 +36,15 @@\n plt.show()\n \n ##############################################################################\n-# Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.\n-# This can be used to increase the signal to noise ratio by reducing the\n-# resolution of the image by combining pixels. This means that the new dimension\n-# must divide the original size exactly.\n-# For example you can reduce the AIA map resolution by a factor of 16.\n-\n-new_dimensions = u.Quantity(aia_map.dimensions) / 16\n-aia_superpixel_map = aia_map.superpixel(new_dimensions)\n+# Another way to reduce the angular resolution of the map is by using the\n+# :meth:`~sunpy.map.GenericMap.superpixel` method, which combines pixels.\n+# The superpixel dimensions do not need to be square, and the intensity of\n+# each superpixel defaults to the sum of the constituent pixels. For example,\n+# you can reduce the AIA map resolution by a factor of 16 by specifying 16x16\n+# superpixels.\n+\n+superpixel_size = [16, 16] * u.pixel\n+aia_superpixel_map = aia_map.superpixel(superpixel_size)\n \n ##############################################################################\n # Let's plot the result.\n", "issue": "Resampling Maps in the example gallery gives a confusing example for the superpixel method\n### Provide a general description of the issue or problem.\n\nThat's a minor thing perhaps but checking this [page](https://docs.sunpy.org/en/stable/generated/gallery/map/map_resampling_and_superpixels.html) I got confused by the example for the superpixel method. \r\nIt says:\r\n`new_dimensions = u.Quantity(aia_map.dimensions) / 16`\r\n`aia_superpixel_map = aia_map.superpixel([new_dimensions]`\r\n\r\nThe first line should be instead e.g.:\r\n`new_dimensions=[16,16]*u.pixel `\n", "before_files": [{"content": "\"\"\"\n===============\nResampling Maps\n===============\n\nHow to resample a map using the resample method, which implements interpolation, or\nusing superpixels, which combines pixels.\n\"\"\"\nimport matplotlib.pyplot as plt\n\nimport astropy.units as u\n\nimport sunpy.data.sample\nimport sunpy.map\n\n###############################################################################\n# We start with the sample data.\n\naia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)\n\n##############################################################################\n# To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,\n# specifying the new dimensions in pixels. By default, this method uses linear interpolation\n# but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n\nnew_dimensions = [40, 40] * u.pixel\naia_resampled_map = aia_map.resample(new_dimensions)\n\n##############################################################################\n# Let's plot the result.\n\nfig = plt.figure()\nax = fig.add_subplot(projection=aia_resampled_map)\naia_resampled_map.plot(axes=ax)\nplt.show()\n\n##############################################################################\n# Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.\n# This can be used to increase the signal to noise ratio by reducing the\n# resolution of the image by combining pixels. This means that the new dimension\n# must divide the original size exactly.\n# For example you can reduce the AIA map resolution by a factor of 16.\n\nnew_dimensions = u.Quantity(aia_map.dimensions) / 16\naia_superpixel_map = aia_map.superpixel(new_dimensions)\n\n##############################################################################\n# Let's plot the result.\n\nfig = plt.figure()\nax = fig.add_subplot(projection=aia_superpixel_map)\naia_superpixel_map.plot(axes=ax)\nplt.show()\n", "path": "examples/map/map_resampling_and_superpixels.py"}], "after_files": [{"content": "\"\"\"\n===============\nResampling Maps\n===============\n\nHow to resample a map using the resample method, which implements interpolation, or\nusing superpixels, which combines pixels.\n\"\"\"\nimport matplotlib.pyplot as plt\n\nimport astropy.units as u\n\nimport sunpy.data.sample\nimport sunpy.map\n\n##############################################################################\n# We start with the sample data.\n\naia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)\n\n##############################################################################\n# To reduce the angular resolution of the map, you can use the\n# :meth:`~sunpy.map.GenericMap.resample` method, specifying the new dimensions\n# in pixels. By default, this method uses linear interpolation but this can be\n# changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n\nnew_dimensions = [40, 40] * u.pixel\naia_resampled_map = aia_map.resample(new_dimensions)\n\n##############################################################################\n# Let's plot the result.\n\nfig = plt.figure()\nax = fig.add_subplot(projection=aia_resampled_map)\naia_resampled_map.plot(axes=ax)\nplt.show()\n\n##############################################################################\n# Another way to reduce the angular resolution of the map is by using the\n# :meth:`~sunpy.map.GenericMap.superpixel` method, which combines pixels.\n# The superpixel dimensions do not need to be square, and the intensity of\n# each superpixel defaults to the sum of the constituent pixels. For example,\n# you can reduce the AIA map resolution by a factor of 16 by specifying 16x16\n# superpixels.\n\nsuperpixel_size = [16, 16] * u.pixel\naia_superpixel_map = aia_map.superpixel(superpixel_size)\n\n##############################################################################\n# Let's plot the result.\n\nfig = plt.figure()\nax = fig.add_subplot(projection=aia_superpixel_map)\naia_superpixel_map.plot(axes=ax)\nplt.show()\n", "path": "examples/map/map_resampling_and_superpixels.py"}]}