.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_atmospheric_response.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_auto_examples_plot_atmospheric_response.py: Time ranges and the atmospheric response ======================================== Script showing how a user might want to consider choosing their analysis time range in relation to the atmospheric response. Check out the `Choosing a time range `__ section in the online documentation for more details on other observational time range factors to consider. Throughout FOXSI-4's flight, there are different amounts of atmosphere in the line of sight that will attenuate the incoming X-rays. This example will show how to get to the atmopspheric response values. The example originally followed the plot produced from ``response_tools.attenuation.asset_atm()``. *Note:* The atmospheric response is included in the level 3 ARF response functions that have "flight" in their name. E.g, ``response_tools.responses.foxsi4_telescope0_flight_arf`` which will require a ``time_range`` input to work. .. GENERATED FROM PYTHON SOURCE LINES 24-36 .. code-block:: Python from astropy.time import Time from astropy.visualization import time_support import astropy.units as u from matplotlib.dates import DateFormatter import matplotlib.pyplot as plt import numpy as np from response_tools.attenuation import att_foxsi4_atmosphere time_support() .. rst-class:: sphx-glr-script-out .. code-block:: none .MplTimeConverter object at 0x7ffbb945ffe0> .. GENERATED FROM PYTHON SOURCE LINES 37-46 The function documentation -------------------------- The documentation for any function in ``response-tools`` can be found online `here `__. The ``response_tools.attenuation.att_foxsi4_atmosphere`` documentation can be found `here `__, but we can also use the ``help`` function. .. GENERATED FROM PYTHON SOURCE LINES 46-49 .. code-block:: Python help(att_foxsi4_atmosphere) .. rst-class:: sphx-glr-script-out .. code-block:: none Help on function att_foxsi4_atmosphere in module response_tools.attenuation: att_foxsi4_atmosphere(mid_energies, time_range=None, file=None) Atmsopheric attenuation from and for FOXSI-4 flight data. Parameters ---------- mid_energies : `astropy.units.quantity.Quantity` The energies at which the transmission is required. If `numpy.nan<>> from astropy.time import Time >>> import astropy.units as u # two equivalent calls to the function # using Astorpy times >>> a0 = att_foxsi4_atmosphere([np.nan]<>> a1 = att_foxsi4_atmosphere([np.nan]<`__ table, respectively. Before getting into time ranges, a user might want to only sample one energy, or several, and inspect the time profile of the attenuation. To get all times back from the function, specific times don't need to known. The function will return all times if ``numpy.nan`` is passed (but it still needs to be unit-aware). So let's get the atmsopheric transmission at 1 keV for the full flight: .. GENERATED FROM PYTHON SOURCE LINES 69-74 .. code-block:: Python energy0, time0 = [1]<`__.) Similar to what was seen for the ``time_range`` input, ``numpy.nan`` can be passed (unit-aware). Let's average over the whole time range: .. GENERATED FROM PYTHON SOURCE LINES 162-167 .. code-block:: Python energy2 = np.nan<` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_atmospheric_response.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_atmospheric_response.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_