.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/deconvolving.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_gallery_deconvolving.py: ======================= Deconvolving XRT Images ======================= This example demonstrates deconvolvoing X-Ray Telescope (XRT) images using the `xrtpy.image_correction.deconvolve` function in XRTpy. .. GENERATED FROM PYTHON SOURCE LINES 9-17 .. code-block:: Python import matplotlib.pyplot as plt import sunpy.map from sunpy.net import Fido from sunpy.net import attrs as a from xrtpy.image_correction import deconvolve .. GENERATED FROM PYTHON SOURCE LINES 18-19 We will search for XRT data from the Virtual Solar Observatory (VSO) and fetch the first result. .. GENERATED FROM PYTHON SOURCE LINES 19-25 .. code-block:: Python result = Fido.search( a.Time("2012-06-05 21:58:39", "2012-06-05 21:59:00"), a.Instrument("xrt") ) data_file = Fido.fetch(result[0]) .. GENERATED FROM PYTHON SOURCE LINES 26-27 Typically most deconvolve routines use the Richardson-Lucy deconvolution algorithm. .. GENERATED FROM PYTHON SOURCE LINES 27-31 .. code-block:: Python xrt_map = sunpy.map.Map(data_file) deconv_map = deconvolve(xrt_map) .. GENERATED FROM PYTHON SOURCE LINES 32-33 To see the effects of the deconvolution we plot both the before and after images. .. GENERATED FROM PYTHON SOURCE LINES 33-46 .. code-block:: Python fig = plt.figure(figsize=(15, 10)) ax = fig.add_subplot(121, projection=xrt_map) xrt_map.plot(axes=ax, title="Original") ax1 = fig.add_subplot(122, projection=deconv_map) deconv_map.plot(axes=ax1, title="Deconvolved") ax1.coords[1].set_ticks_visible(False) ax1.coords[1].set_ticklabel_visible(False) fig.tight_layout() plt.show() .. image-sg:: /generated/gallery/images/sphx_glr_deconvolving_001.png :alt: Original, Deconvolved :srcset: /generated/gallery/images/sphx_glr_deconvolving_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 23.264 seconds) .. _sphx_glr_download_generated_gallery_deconvolving.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: deconvolving.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: deconvolving.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: deconvolving.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_