.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_arf_rmf_srm.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_arf_rmf_srm.py: Generating and plotting ARFs, RMFs, and SRMs ============================================ Script showing a quick example how to plot the Ancillary Response Function (ARF), Redistribution Matrix Function (RMF), and the Spectral Response Matrix (SRM) of a FOXSI-4 telescope. The chosen telescope is Telescope 2 with photon path: * Thermal blanket -> Marshall 10-shell X-7 -> Al (0.015") -> CdTe4 .. GENERATED FROM PYTHON SOURCE LINES 13-22 .. code-block:: Python import astropy.units as u from matplotlib.colors import LogNorm import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import response_tools.responses as responses .. GENERATED FROM PYTHON SOURCE LINES 23-100 A note on usage and user options -------------------------------- One great thing about the unit-awareness of the inputs/outputs is that you can pass any reasonable input units and they'll be converted for you so you don't need to worry about conversion factors throughout your code to use the functions. As other examples will likely go into more detail than here, to generate a telescope response you only need to make a few core decisions related to the **FOXSI-4 observation** and the data in which the user is interested. .. raw:: html .. role:: colour :colour:`Please look over the FOXSI-4 observation resources to add` :colour:`more context as to how a user might decide on their choice` :colour:`of the following parameters. Additionally, look over the` :colour:`FOXSI-4 instrumentation resources when deciding which` :colour:`functions to use.` These crucial choices will be: * **A source location** to obtain: * An off axis angle. * A detector region. * **A time range during the flight**. * **An energy array** *(sometimes)*. For more detail on choices: * **An off axis angle** (input: ``off_axis_angle``): * For Ancillary Response Function (ARF) code. * Astropy.units unit convertable to arc-minutes. * **A detector region** (for CdTe, input: ``region`` xor ``pitch``): * For CdTe Redistribution Matrix Function (RMF) code. * Of course, this should be consistent with the off axis angle being used. * Use either, not both, inputs: * An integer for ``region`` input in [0,1,2]. * Astropy.units unit convertable to micrometers for ``pitch`` input in [60 um,80 um,100 um]. * **A time range during the flight** (input: ``time_range``): * For Ancillary Response Function (ARF) code. * *Input ``time_range`` will change to something more readable after some time calibration:* * E.g., converted to use UTC time strings. * Inputs in functions that reference the flight: * E.g., in ``response_tools.responses.foxsi4_telescope2_flight_arf``. * Astropy.units unit convertable to seconds: * Launch: 0 s. * Observation start: 100 s. * Observation end: 461 s. * **An energy array** (input: ``mid_energies``): * For Ancillary Response Function (ARF) code. * Astropy.units unit convertable to keV. * Input should come from the RMF. * The RMF defines the energy resolution/sampling of the detector. .. GENERATED FROM PYTHON SOURCE LINES 103-110 Generating response products ---------------------------- Let's define some of these parameters as an example. Our user will assume the source our user is interested in is on-axis: * at 0 arc-minutes, region-0, a pitch of 60 um. .. GENERATED FROM PYTHON SOURCE LINES 110-115 .. code-block:: Python # set up the ARF with the RMF information then make the SRM user_off_axis_angle = 0 << u.arcmin user_region = 0 # equivalent to defining ``user_pitch=60<` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_arf_rmf_srm.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_arf_rmf_srm.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_