prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Error in documentation for "Finding bright regions with ndimage" example.
  <!-- This comments are hidden when you submit the issue so you do not need to remove them!
  Please be sure to check out our contributing guidelines: https://github.com/sunpy/sunpy/blob/master/CONTRIBUTING.rst
  Please be sure to check out our code of conduct:
  https://github.com/sunpy/sunpy/blob/master/CODE_OF_CONDUCT.rst -->
  
  <!-- 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 bug. -->
  There seems to be an error in the documentation for the "Finding bright regions with ndimage" example.
  
  In the part where a mask is made, the surrounding text states: " We choose the criterion that the data should be at least 5% of the maximum value. " However, if you look at the code immediately below, the threshold is based off 10% the max value:
  `mask = aiamap.data < aiamap.max() * 0.10`
  
  ### Expected behavior
  <!-- What did you expect to happen. -->
  
  Documentation needs to be modified to reflect that the threshold is based off a 10% threshold. 
  
  --- 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/image_bright_regions_gallery_example.py`
  Content:
  ```
  1 # coding: utf-8
  2 """
  3 ===================================
  4 Finding bright regions with ndimage
  5 ===================================
  6 
  7 How you can to find the brightest regions in an AIA image and
  8 count the approximate number of regions of interest using ndimage.
  9 """
  10 # sphinx_gallery_thumbnail_number = 2
  11 
  12 from scipy import ndimage
  13 import matplotlib.pyplot as plt
  14 
  15 import sunpy.map
  16 from sunpy.data.sample import AIA_193_IMAGE
  17 
  18 ###############################################################################
  19 # We start with the sample data
  20 aiamap_mask = sunpy.map.Map(AIA_193_IMAGE)
  21 aiamap = sunpy.map.Map(AIA_193_IMAGE)
  22 
  23 ##############################################################################
  24 # First we make a mask, which tells us which regions are bright. We
  25 # choose the criterion that the data should be at least 5% of the maximum
  26 # value. Pixels with intensity values greater than this are included in the
  27 # mask, while all other pixels are excluded.
  28 mask = aiamap.data < aiamap.max() * 0.10
  29 
  30 ##############################################################################
  31 # Mask is a `boolean` array. It can be used to modify the original map object
  32 # without modifying the data. Once this mask attribute is set, we can plot the
  33 # image again.
  34 aiamap_mask.mask = mask
  35 plt.figure()
  36 aiamap.plot()
  37 plt.colorbar()
  38 plt.show()
  39 
  40 ##############################################################################
  41 # Only the brightest pixels remain in the image.
  42 # However, these areas are artificially broken up into small regions.
  43 # We can solve this by applying some smoothing to the image data.
  44 # Here we apply a 2D Gaussian smoothing function to the data.
  45 data2 = ndimage.gaussian_filter(aiamap.data * ~mask, 14)
  46 
  47 ##############################################################################
  48 # The issue with the filtering is that it create pixels where the values are
  49 # small (<100), so when we go on later to label this array,
  50 # we get one large region which encompasses the entire array.
  51 # If you want to see, just remove this line.
  52 data2[data2 < 100] = 0
  53 
  54 ##############################################################################
  55 # Now we will make a second SunPy map with this smoothed data.
  56 aiamap2 = sunpy.map.Map(data2, aiamap.meta)
  57 
  58 ##############################################################################
  59 # The function `label` from the `scipy.ndimage` module, counts the number of
  60 # contiguous regions in an image.
  61 labels, n = ndimage.label(aiamap2.data)
  62 
  63 ##############################################################################
  64 # Finally, we plot the smoothed bright image data, along with the estimate of
  65 # the number of distinct regions. We can see that approximately 6 distinct hot
  66 # regions are present above the 5% of the maximum level.
  67 plt.figure()
  68 ax = plt.subplot(projection=aiamap)
  69 aiamap.plot()
  70 plt.contour(labels)
  71 plt.figtext(0.3, 0.2, f'Number of regions = {n}', color='white')
  72 plt.show()
  73
  ```
  --- 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/image_bright_regions_gallery_example.py b/examples/map/image_bright_regions_gallery_example.py
  --- a/examples/map/image_bright_regions_gallery_example.py
  +++ b/examples/map/image_bright_regions_gallery_example.py
  @@ -22,7 +22,7 @@
   
   ##############################################################################
   # First we make a mask, which tells us which regions are bright. We
  -# choose the criterion that the data should be at least 5% of the maximum
  +# choose the criterion that the data should be at least 10% of the maximum
   # value. Pixels with intensity values greater than this are included in the
   # mask, while all other pixels are excluded.
   mask = aiamap.data < aiamap.max() * 0.10
  @@ -63,7 +63,7 @@
   ##############################################################################
   # Finally, we plot the smoothed bright image data, along with the estimate of
   # the number of distinct regions. We can see that approximately 6 distinct hot
  -# regions are present above the 5% of the maximum level.
  +# regions are present above the 10% of the maximum level.
   plt.figure()
   ax = plt.subplot(projection=aiamap)
   aiamap.plot()
  
verification_info: {"golden_diff": "diff --git a/examples/map/image_bright_regions_gallery_example.py b/examples/map/image_bright_regions_gallery_example.py\n--- a/examples/map/image_bright_regions_gallery_example.py\n+++ b/examples/map/image_bright_regions_gallery_example.py\n@@ -22,7 +22,7 @@\n \n ##############################################################################\n # First we make a mask, which tells us which regions are bright. We\n-# choose the criterion that the data should be at least 5% of the maximum\n+# choose the criterion that the data should be at least 10% of the maximum\n # value. Pixels with intensity values greater than this are included in the\n # mask, while all other pixels are excluded.\n mask = aiamap.data < aiamap.max() * 0.10\n@@ -63,7 +63,7 @@\n ##############################################################################\n # Finally, we plot the smoothed bright image data, along with the estimate of\n # the number of distinct regions. We can see that approximately 6 distinct hot\n-# regions are present above the 5% of the maximum level.\n+# regions are present above the 10% of the maximum level.\n plt.figure()\n ax = plt.subplot(projection=aiamap)\n aiamap.plot()\n", "issue": "Error in documentation for \"Finding bright regions with ndimage\" example.\n<!-- This comments are hidden when you submit the issue so you do not need to remove them!\r\nPlease be sure to check out our contributing guidelines: https://github.com/sunpy/sunpy/blob/master/CONTRIBUTING.rst\r\nPlease be sure to check out our code of conduct:\r\nhttps://github.com/sunpy/sunpy/blob/master/CODE_OF_CONDUCT.rst -->\r\n\r\n<!-- Please have a search on our GitHub repository to see if a similar issue has already been posted.\r\nIf a similar issue is closed, have a quick look to see if you are satisfied by the resolution.\r\nIf not please go ahead and open an issue! -->\r\n\r\n### Description\r\n<!-- Provide a general description of the bug. -->\r\nThere seems to be an error in the documentation for the \"Finding bright regions with ndimage\" example.\r\n\r\nIn the part where a mask is made, the surrounding text states: \" We choose the criterion that the data should be at least 5% of the maximum value. \" However, if you look at the code immediately below, the threshold is based off 10% the max value:\r\n`mask = aiamap.data < aiamap.max() * 0.10`\r\n\r\n### Expected behavior\r\n<!-- What did you expect to happen. -->\r\n\r\nDocumentation needs to be modified to reflect that the threshold is based off a 10% threshold. \n", "before_files": [{"content": "# coding: utf-8\n\"\"\"\n===================================\nFinding bright regions with ndimage\n===================================\n\nHow you can to find the brightest regions in an AIA image and\ncount the approximate number of regions of interest using ndimage.\n\"\"\"\n# sphinx_gallery_thumbnail_number = 2\n\nfrom scipy import ndimage\nimport matplotlib.pyplot as plt\n\nimport sunpy.map\nfrom sunpy.data.sample import AIA_193_IMAGE\n\n###############################################################################\n# We start with the sample data\naiamap_mask = sunpy.map.Map(AIA_193_IMAGE)\naiamap = sunpy.map.Map(AIA_193_IMAGE)\n\n##############################################################################\n# First we make a mask, which tells us which regions are bright. We\n# choose the criterion that the data should be at least 5% of the maximum\n# value. Pixels with intensity values greater than this are included in the\n# mask, while all other pixels are excluded.\nmask = aiamap.data < aiamap.max() * 0.10\n\n##############################################################################\n# Mask is a `boolean` array. It can be used to modify the original map object\n# without modifying the data. Once this mask attribute is set, we can plot the\n# image again.\naiamap_mask.mask = mask\nplt.figure()\naiamap.plot()\nplt.colorbar()\nplt.show()\n\n##############################################################################\n# Only the brightest pixels remain in the image.\n# However, these areas are artificially broken up into small regions.\n# We can solve this by applying some smoothing to the image data.\n# Here we apply a 2D Gaussian smoothing function to the data.\ndata2 = ndimage.gaussian_filter(aiamap.data * ~mask, 14)\n\n##############################################################################\n# The issue with the filtering is that it create pixels where the values are\n# small (<100), so when we go on later to label this array,\n# we get one large region which encompasses the entire array.\n# If you want to see, just remove this line.\ndata2[data2 < 100] = 0\n\n##############################################################################\n# Now we will make a second SunPy map with this smoothed data.\naiamap2 = sunpy.map.Map(data2, aiamap.meta)\n\n##############################################################################\n# The function `label` from the `scipy.ndimage` module, counts the number of\n# contiguous regions in an image.\nlabels, n = ndimage.label(aiamap2.data)\n\n##############################################################################\n# Finally, we plot the smoothed bright image data, along with the estimate of\n# the number of distinct regions. We can see that approximately 6 distinct hot\n# regions are present above the 5% of the maximum level.\nplt.figure()\nax = plt.subplot(projection=aiamap)\naiamap.plot()\nplt.contour(labels)\nplt.figtext(0.3, 0.2, f'Number of regions = {n}', color='white')\nplt.show()\n", "path": "examples/map/image_bright_regions_gallery_example.py"}], "after_files": [{"content": "# coding: utf-8\n\"\"\"\n===================================\nFinding bright regions with ndimage\n===================================\n\nHow you can to find the brightest regions in an AIA image and\ncount the approximate number of regions of interest using ndimage.\n\"\"\"\n# sphinx_gallery_thumbnail_number = 2\n\nfrom scipy import ndimage\nimport matplotlib.pyplot as plt\n\nimport sunpy.map\nfrom sunpy.data.sample import AIA_193_IMAGE\n\n###############################################################################\n# We start with the sample data\naiamap_mask = sunpy.map.Map(AIA_193_IMAGE)\naiamap = sunpy.map.Map(AIA_193_IMAGE)\n\n##############################################################################\n# First we make a mask, which tells us which regions are bright. We\n# choose the criterion that the data should be at least 10% of the maximum\n# value. Pixels with intensity values greater than this are included in the\n# mask, while all other pixels are excluded.\nmask = aiamap.data < aiamap.max() * 0.10\n\n##############################################################################\n# Mask is a `boolean` array. It can be used to modify the original map object\n# without modifying the data. Once this mask attribute is set, we can plot the\n# image again.\naiamap_mask.mask = mask\nplt.figure()\naiamap.plot()\nplt.colorbar()\nplt.show()\n\n##############################################################################\n# Only the brightest pixels remain in the image.\n# However, these areas are artificially broken up into small regions.\n# We can solve this by applying some smoothing to the image data.\n# Here we apply a 2D Gaussian smoothing function to the data.\ndata2 = ndimage.gaussian_filter(aiamap.data * ~mask, 14)\n\n##############################################################################\n# The issue with the filtering is that it create pixels where the values are\n# small (<100), so when we go on later to label this array,\n# we get one large region which encompasses the entire array.\n# If you want to see, just remove this line.\ndata2[data2 < 100] = 0\n\n##############################################################################\n# Now we will make a second SunPy map with this smoothed data.\naiamap2 = sunpy.map.Map(data2, aiamap.meta)\n\n##############################################################################\n# The function `label` from the `scipy.ndimage` module, counts the number of\n# contiguous regions in an image.\nlabels, n = ndimage.label(aiamap2.data)\n\n##############################################################################\n# Finally, we plot the smoothed bright image data, along with the estimate of\n# the number of distinct regions. We can see that approximately 6 distinct hot\n# regions are present above the 10% of the maximum level.\nplt.figure()\nax = plt.subplot(projection=aiamap)\naiamap.plot()\nplt.contour(labels)\nplt.figtext(0.3, 0.2, f'Number of regions = {n}', color='white')\nplt.show()\n", "path": "examples/map/image_bright_regions_gallery_example.py"}]}