.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/effective_area.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_effective_area.py: ======================= Effective Area Analysis ======================= In this example, we will explore the effective areas for different XRT filter channels. Understanding the effective areas is important for accurately interpreting and quantifying the data. .. GENERATED FROM PYTHON SOURCE LINES 9-14 .. code-block:: Python import matplotlib.pyplot as plt import xrtpy .. GENERATED FROM PYTHON SOURCE LINES 15-18 Let us begin by defining a filter channel using its abbreviation. For example, if we want to explore the effective area for an aluminum-on-polyimide filter channel, we need to specify the relevant abbreviation. .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: Python xrt_filter = "Al-poly" .. GENERATED FROM PYTHON SOURCE LINES 22-24 `~.EffectiveAreaFundamental` allows us to accurately determine the effective area based on the specified filter channel, date, and time. .. GENERATED FROM PYTHON SOURCE LINES 24-28 .. code-block:: Python date_time = "2023-09-22T22:59:59" eaf = xrtpy.response.EffectiveAreaFundamental(xrt_filter, date_time) .. GENERATED FROM PYTHON SOURCE LINES 29-30 To actually calculate the effective area function we can call :meth:`~xrtpy.response.EffectiveAreaFundamental.effective_area`. .. GENERATED FROM PYTHON SOURCE LINES 30-34 .. code-block:: Python effective_area = eaf.effective_area() print("Effective Area:\n", effective_area) .. rst-class:: sphx-glr-script-out .. code-block:: none Effective Area: [2.78456378e-10 7.94910476e-10 2.06646295e-09 ... 8.48113833e-16 0.00000000e+00 0.00000000e+00] cm2 .. GENERATED FROM PYTHON SOURCE LINES 35-43 Differences overtime arise from an increase of the contamination layer on the CCD which blocks some of the X-rays thus reducing the effective area. For detailed information about the calculation of the XRT CCD contaminant layer thickness, you can refer to `Montana State University `__. Additional information is provided by `Narukage et. al. (2011) `__. .. GENERATED FROM PYTHON SOURCE LINES 43-50 .. code-block:: Python relative_launch_date_time = "2006-09-22T22:59:59" eaf_launch = xrtpy.response.EffectiveAreaFundamental( xrt_filter, relative_launch_date_time ) launch_effective_area = eaf_launch.effective_area() .. GENERATED FROM PYTHON SOURCE LINES 51-52 Finally, we can plot how the effective area has changed over time. .. GENERATED FROM PYTHON SOURCE LINES 52-76 .. code-block:: Python plt.figure() plt.plot( eaf.wavelength, effective_area, label=f"{date_time}", ) plt.plot( eaf.wavelength, launch_effective_area, label=f"{relative_launch_date_time}", ) plt.title("XRT Effective Area - Al-Poly") plt.xlabel("Wavelength (Å)") plt.ylabel("Effective Area ($cm^{2}$)") plt.legend() plt.xlim(0, 60) plt.grid(color="lightgrey") plt.tight_layout() plt.show() .. image-sg:: /generated/gallery/images/sphx_glr_effective_area_001.png :alt: XRT Effective Area - Al-Poly :srcset: /generated/gallery/images/sphx_glr_effective_area_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.412 seconds) .. _sphx_glr_download_generated_gallery_effective_area.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: effective_area.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: effective_area.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: effective_area.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_