prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Remove sunpy.instr.aia.aiaprep
  The `aiaprep` function should be removed from the `sunpy.instr` subpackage. Any AIA specific functionality should transition to the new [`aiapy` package](https://gitlab.com/LMSAL_HUB/aia_hub/aiapy).
  
  This is part of the broader goal of moving instrument-specific functionality out of the core sunpy package and into affiliated packages.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `sunpy/instr/aia.py`
  Content:
  ```
  1 """
  2 This module provides processing routines for data captured with the AIA
  3 instrument on SDO.
  4 """
  5 import numpy as np
  6 
  7 import astropy.units as u
  8 
  9 from sunpy.map.sources.sdo import AIAMap, HMIMap
  10 
  11 __all__ = ['aiaprep']
  12 
  13 
  14 def aiaprep(aiamap):
  15     """
  16     Processes a level 1 `~sunpy.map.sources.sdo.AIAMap` into a level 1.5
  17     `~sunpy.map.sources.sdo.AIAMap`.
  18 
  19     Rotates, scales and translates the image so that solar North is aligned
  20     with the y axis, each pixel is 0.6 arcsec across, and the center of the
  21     Sun is at the center of the image. The actual transformation is done by Map's `~sunpy.map.mapbase.GenericMap.rotate` method.
  22 
  23     This function is similar in functionality to ``aia_prep`` in SSWIDL, but
  24     it does not use the same transformation to rotate the image and it handles
  25     the meta data differently. It should therefore not be expected to produce
  26     the same results.
  27 
  28     Parameters
  29     ----------
  30     aiamap : `~sunpy.map.sources.sdo.AIAMap`
  31         A `sunpy.map.Map` from AIA.
  32 
  33     Returns
  34     -------
  35     `~sunpy.map.sources.sdo.AIAMap`:
  36         A level 1.5 copy of `~sunpy.map.sources.sdo.AIAMap`.
  37 
  38     Notes
  39     -----
  40     This routine modifies the header information to the standard PCi_j WCS
  41     formalism. The FITS header resulting in saving a file after this
  42     procedure will therefore differ from the original file.
  43     """
  44 
  45     if not isinstance(aiamap, (AIAMap, HMIMap)):
  46         raise ValueError("Input must be an AIAMap or HMIMap.")
  47 
  48     # Target scale is 0.6 arcsec/pixel, but this needs to be adjusted if the map
  49     # has already been rescaled.
  50     if ((aiamap.scale[0] / 0.6).round() != 1.0 * u.arcsec / u.pix
  51             and aiamap.data.shape != (4096, 4096)):
  52         scale = (aiamap.scale[0] / 0.6).round() * 0.6 * u.arcsec
  53     else:
  54         scale = 0.6 * u.arcsec  # pragma: no cover # can't test this because it needs a full res image
  55     scale_factor = aiamap.scale[0] / scale
  56 
  57     tempmap = aiamap.rotate(recenter=True, scale=scale_factor.value, missing=aiamap.min())
  58 
  59     # extract center from padded aiamap.rotate output
  60     # crpix1 and crpix2 will be equal (recenter=True), as aiaprep does not work with submaps
  61     center = np.floor(tempmap.meta['crpix1'])
  62     range_side = (center + np.array([-1, 1]) * aiamap.data.shape[0] / 2) * u.pix
  63     newmap = tempmap.submap(u.Quantity([range_side[0], range_side[0]]),
  64                             u.Quantity([range_side[1], range_side[1]]))
  65 
  66     newmap.meta['r_sun'] = newmap.meta['rsun_obs'] / newmap.meta['cdelt1']
  67     newmap.meta['lvl_num'] = 1.5
  68     newmap.meta['bitpix'] = -64
  69 
  70     return newmap
  71
  ```
  --- 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/sunpy/instr/aia.py b/sunpy/instr/aia.py
  --- a/sunpy/instr/aia.py
  +++ b/sunpy/instr/aia.py
  @@ -7,10 +7,13 @@
   import astropy.units as u
   
   from sunpy.map.sources.sdo import AIAMap, HMIMap
  +from sunpy.util.decorators import deprecated
   
   __all__ = ['aiaprep']
   
   
  +@deprecated("2.0", alternative="`register` in aiapy (https://aiapy.readthedocs.io) for converting \
  +AIA images to level 1.5")
   def aiaprep(aiamap):
       """
       Processes a level 1 `~sunpy.map.sources.sdo.AIAMap` into a level 1.5
  @@ -18,7 +21,8 @@
   
       Rotates, scales and translates the image so that solar North is aligned
       with the y axis, each pixel is 0.6 arcsec across, and the center of the
  -    Sun is at the center of the image. The actual transformation is done by Map's `~sunpy.map.mapbase.GenericMap.rotate` method.
  +    Sun is at the center of the image. The actual transformation is done by Map's
  +    `~sunpy.map.mapbase.GenericMap.rotate` method.
   
       This function is similar in functionality to ``aia_prep`` in SSWIDL, but
       it does not use the same transformation to rotate the image and it handles
  
verification_info: {"golden_diff": "diff --git a/sunpy/instr/aia.py b/sunpy/instr/aia.py\n--- a/sunpy/instr/aia.py\n+++ b/sunpy/instr/aia.py\n@@ -7,10 +7,13 @@\n import astropy.units as u\n \n from sunpy.map.sources.sdo import AIAMap, HMIMap\n+from sunpy.util.decorators import deprecated\n \n __all__ = ['aiaprep']\n \n \n+@deprecated(\"2.0\", alternative=\"`register` in aiapy (https://aiapy.readthedocs.io) for converting \\\n+AIA images to level 1.5\")\n def aiaprep(aiamap):\n     \"\"\"\n     Processes a level 1 `~sunpy.map.sources.sdo.AIAMap` into a level 1.5\n@@ -18,7 +21,8 @@\n \n     Rotates, scales and translates the image so that solar North is aligned\n     with the y axis, each pixel is 0.6 arcsec across, and the center of the\n-    Sun is at the center of the image. The actual transformation is done by Map's `~sunpy.map.mapbase.GenericMap.rotate` method.\n+    Sun is at the center of the image. The actual transformation is done by Map's\n+    `~sunpy.map.mapbase.GenericMap.rotate` method.\n \n     This function is similar in functionality to ``aia_prep`` in SSWIDL, but\n     it does not use the same transformation to rotate the image and it handles\n", "issue": "Remove sunpy.instr.aia.aiaprep\nThe `aiaprep` function should be removed from the `sunpy.instr` subpackage. Any AIA specific functionality should transition to the new [`aiapy` package](https://gitlab.com/LMSAL_HUB/aia_hub/aiapy).\r\n\r\nThis is part of the broader goal of moving instrument-specific functionality out of the core sunpy package and into affiliated packages.\n", "before_files": [{"content": "\"\"\"\nThis module provides processing routines for data captured with the AIA\ninstrument on SDO.\n\"\"\"\nimport numpy as np\n\nimport astropy.units as u\n\nfrom sunpy.map.sources.sdo import AIAMap, HMIMap\n\n__all__ = ['aiaprep']\n\n\ndef aiaprep(aiamap):\n    \"\"\"\n    Processes a level 1 `~sunpy.map.sources.sdo.AIAMap` into a level 1.5\n    `~sunpy.map.sources.sdo.AIAMap`.\n\n    Rotates, scales and translates the image so that solar North is aligned\n    with the y axis, each pixel is 0.6 arcsec across, and the center of the\n    Sun is at the center of the image. The actual transformation is done by Map's `~sunpy.map.mapbase.GenericMap.rotate` method.\n\n    This function is similar in functionality to ``aia_prep`` in SSWIDL, but\n    it does not use the same transformation to rotate the image and it handles\n    the meta data differently. It should therefore not be expected to produce\n    the same results.\n\n    Parameters\n    ----------\n    aiamap : `~sunpy.map.sources.sdo.AIAMap`\n        A `sunpy.map.Map` from AIA.\n\n    Returns\n    -------\n    `~sunpy.map.sources.sdo.AIAMap`:\n        A level 1.5 copy of `~sunpy.map.sources.sdo.AIAMap`.\n\n    Notes\n    -----\n    This routine modifies the header information to the standard PCi_j WCS\n    formalism. The FITS header resulting in saving a file after this\n    procedure will therefore differ from the original file.\n    \"\"\"\n\n    if not isinstance(aiamap, (AIAMap, HMIMap)):\n        raise ValueError(\"Input must be an AIAMap or HMIMap.\")\n\n    # Target scale is 0.6 arcsec/pixel, but this needs to be adjusted if the map\n    # has already been rescaled.\n    if ((aiamap.scale[0] / 0.6).round() != 1.0 * u.arcsec / u.pix\n            and aiamap.data.shape != (4096, 4096)):\n        scale = (aiamap.scale[0] / 0.6).round() * 0.6 * u.arcsec\n    else:\n        scale = 0.6 * u.arcsec  # pragma: no cover # can't test this because it needs a full res image\n    scale_factor = aiamap.scale[0] / scale\n\n    tempmap = aiamap.rotate(recenter=True, scale=scale_factor.value, missing=aiamap.min())\n\n    # extract center from padded aiamap.rotate output\n    # crpix1 and crpix2 will be equal (recenter=True), as aiaprep does not work with submaps\n    center = np.floor(tempmap.meta['crpix1'])\n    range_side = (center + np.array([-1, 1]) * aiamap.data.shape[0] / 2) * u.pix\n    newmap = tempmap.submap(u.Quantity([range_side[0], range_side[0]]),\n                            u.Quantity([range_side[1], range_side[1]]))\n\n    newmap.meta['r_sun'] = newmap.meta['rsun_obs'] / newmap.meta['cdelt1']\n    newmap.meta['lvl_num'] = 1.5\n    newmap.meta['bitpix'] = -64\n\n    return newmap\n", "path": "sunpy/instr/aia.py"}], "after_files": [{"content": "\"\"\"\nThis module provides processing routines for data captured with the AIA\ninstrument on SDO.\n\"\"\"\nimport numpy as np\n\nimport astropy.units as u\n\nfrom sunpy.map.sources.sdo import AIAMap, HMIMap\nfrom sunpy.util.decorators import deprecated\n\n__all__ = ['aiaprep']\n\n\n@deprecated(\"2.0\", alternative=\"`register` in aiapy (https://aiapy.readthedocs.io) for converting \\\nAIA images to level 1.5\")\ndef aiaprep(aiamap):\n    \"\"\"\n    Processes a level 1 `~sunpy.map.sources.sdo.AIAMap` into a level 1.5\n    `~sunpy.map.sources.sdo.AIAMap`.\n\n    Rotates, scales and translates the image so that solar North is aligned\n    with the y axis, each pixel is 0.6 arcsec across, and the center of the\n    Sun is at the center of the image. The actual transformation is done by Map's\n    `~sunpy.map.mapbase.GenericMap.rotate` method.\n\n    This function is similar in functionality to ``aia_prep`` in SSWIDL, but\n    it does not use the same transformation to rotate the image and it handles\n    the meta data differently. It should therefore not be expected to produce\n    the same results.\n\n    Parameters\n    ----------\n    aiamap : `~sunpy.map.sources.sdo.AIAMap`\n        A `sunpy.map.Map` from AIA.\n\n    Returns\n    -------\n    `~sunpy.map.sources.sdo.AIAMap`:\n        A level 1.5 copy of `~sunpy.map.sources.sdo.AIAMap`.\n\n    Notes\n    -----\n    This routine modifies the header information to the standard PCi_j WCS\n    formalism. The FITS header resulting in saving a file after this\n    procedure will therefore differ from the original file.\n    \"\"\"\n\n    if not isinstance(aiamap, (AIAMap, HMIMap)):\n        raise ValueError(\"Input must be an AIAMap or HMIMap.\")\n\n    # Target scale is 0.6 arcsec/pixel, but this needs to be adjusted if the map\n    # has already been rescaled.\n    if ((aiamap.scale[0] / 0.6).round() != 1.0 * u.arcsec / u.pix\n            and aiamap.data.shape != (4096, 4096)):\n        scale = (aiamap.scale[0] / 0.6).round() * 0.6 * u.arcsec\n    else:\n        scale = 0.6 * u.arcsec  # pragma: no cover # can't test this because it needs a full res image\n    scale_factor = aiamap.scale[0] / scale\n\n    tempmap = aiamap.rotate(recenter=True, scale=scale_factor.value, missing=aiamap.min())\n\n    # extract center from padded aiamap.rotate output\n    # crpix1 and crpix2 will be equal (recenter=True), as aiaprep does not work with submaps\n    center = np.floor(tempmap.meta['crpix1'])\n    range_side = (center + np.array([-1, 1]) * aiamap.data.shape[0] / 2) * u.pix\n    newmap = tempmap.submap(u.Quantity([range_side[0], range_side[0]]),\n                            u.Quantity([range_side[1], range_side[1]]))\n\n    newmap.meta['r_sun'] = newmap.meta['rsun_obs'] / newmap.meta['cdelt1']\n    newmap.meta['lvl_num'] = 1.5\n    newmap.meta['bitpix'] = -64\n\n    return newmap\n", "path": "sunpy/instr/aia.py"}]}