response_tools package
Subpackages
Submodules
response_tools.attenuation module
Code to load different attenuators.
- class response_tools.attenuation.AttOutput(filename: str, function_path: str, transmissions: ~astropy.units.quantity.Quantity, attenuation_type: str, model: bool, mid_energies: ~astropy.units.quantity.Quantity = <Quantity nan keV>, off_axis_angle: ~astropy.units.quantity.Quantity = <Quantity nan arcmin>, times: ~astropy.units.quantity.Quantity = <Quantity nan s>)[source]
Bases:
BaseOutput
Class for keeping track of attenuation response values.
- attenuation_type: str
- mid_energies: Quantity = <Quantity nan keV>
- model: bool
- off_axis_angle: Quantity = <Quantity nan arcmin>
- times: Quantity = <Quantity nan s>
- transmissions: Quantity
- response_tools.attenuation.att_al_mylar(mid_energies, file=None)[source]
Aluminized mylar transmittance interpolated to given energies.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_cmos_collimator_ratio(off_axis_angle, telescope=None, file=None)[source]
CMOS OBF filters for the SXR telescopes.
- Parameters:
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. Default: 0 arc-minutes (on axis)
telescope (int) – The focal plane position of the desired attenuator. Must be in the list [0, 1]. Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_cmos_filter(mid_energies, telescope=None, file=None)[source]
CMOS pre-filters for the SXR telescopes.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
telescope (int) – The focal plane position of the desired attenuator. Must be in the list [0, 1]. Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_cmos_obfilter(mid_energies, telescope=None, file=None)[source]
CMOS OBF filters for the SXR telescopes.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
telescope (int) – The focal plane position of the desired attenuator. Must be in the list [0, 1]. Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_foxsi4_atmosphere(mid_energies, time_range=None, file=None)[source]
Atmsopheric attenuation from and for FOXSI-4 flight data.
energy = array containing energy in keV for energies 0.01 - 30 keV. Array has 506 elements
- atmospheric_trans = array containing transmission for all energy values in energy array.
Transmission is calculated for 10284 times covering the FOXSI-4 flight. Array shape is: [10284,506] which corresponds to transmission for [time,energy]
Launch time t = 0 corresponds to index [0,*] Observation starts at t = 100s corresponds to index [2000,*] Approximate middle of observation at t = 280s corresponds to index [5600,*] End of observation at t = 461s corresponds to index [9200,*]
Units in the FITS header needs to change from keV->eV Need an array of times included -> 10,284 entries and t=0 is index 0 while t=100 is index 2000 -> final time is 100/2000 * 10284 = 514.2
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
file (str or None) – Path/name of a custom file wanting to be loaded in as the atmospheric data file.
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_pixelated(mid_energies, use_model=False, file=None)[source]
Pixelated attenuator transmittance interpolated to energies.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
use_model (bool) – Defines whether to use the measured values for the pixelated attenuator (False) or the modelled values (True). Default: False
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_sigmoid(mid_energies, l, x0, k, b)[source]
Sigmoid model for a general/fake attenuator.
The functional form of the sigmoid is:
\[(l / (1 + np.exp(-k*(mid_energies.value-x0))) + b)\]- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. Unit must be convertable to keV.
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_thermal_blanket(mid_energies, file=None)[source]
Thermal blanket transmittance interpolated to the given energies.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
- response_tools.attenuation.att_uniform_al_cdte(mid_energies, position=None, file=None)[source]
Uniform Al filter transmittance interpolated to given energies.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
position (int) – The focal plane position of the desired attenuator. Must be in the list [2, 4]. Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each transmission, the transmissions, and more. See accessible information using .contents on the output.
- Return type:
AttOutput
response_tools.detector_response module
Code to load different detector responses.
- class response_tools.detector_response.DetectorResponseOutput(filename: str, function_path: str, input_energy_edges: Quantity, output_energy_edges: Quantity, detector_response: Quantity, detector: str)[source]
Bases:
BaseOutput
Class for keeping track of effective area response values.
- detector: str
- detector_response: Quantity
- input_energy_edges: Quantity
- output_energy_edges: Quantity
- response_tools.detector_response.asset_cdte_resp(save_location=None)[source]
Plot the CdTe1, region 0, 1-hit response.
- response_tools.detector_response.asset_cmos_resp(save_location=None)[source]
Plot the CMOS responses.
- response_tools.detector_response.cdte_det_resp(cdte: int = None, region: int = None, pitch=None, side: str = 'merged', event_type: str = 'all', file=None)[source]
Return the redistribution matrix for CdTe from a given file.
Requires the cdte input and _either_ region _xor_ pitch.
Wrapper for cdte_det_resp_rmf with bookkeeping.
- Parameters:
cdte (int) – The CdTe detector number. Must be in [1,2,3,4].
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
file (str) – The file for the RMF.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
DetectorResponseOutput
- response_tools.detector_response.cdte_det_resp_rmf(file)[source]
Return the redistribution matrix for CdTe from a given file.
- Parameters:
file (str) – The file for the RMF.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
DetectorResponseOutput
- response_tools.detector_response.cmos_det_resp(file=None, telescope=None)[source]
Return the redistribution matrix for CMOS from a given file.
- Parameters:
file (str) – The file for the RMF.
telescope (int) – Either 0 or 1.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
DetectorResponseOutput
- response_tools.detector_response.col2arr_py(data)[source]
Takes a list of parameters for each energy channel from a .rmf file and returns it in the correct format [1].
This original function is taken from Sunkit-spex [2] - Tweaked to change r below to [r] since the values in data aren’t lists (e.g., NuSTAR)
[1] https://lost-contact.mit.edu/afs/physics.wisc.edu/home/craigm/lib/idl/util/vcol2arr.pro [2] https://github.com/sunpy/sunkit-spex
- Parameters:
data (array/list-like object) – One parameter’s array/list from the .rmf file.
- Return type:
A 2D numpy array of the correctly ordered input data.
Example
>>> data = FITS_rec([( 1.6 , 1.64, 1, [0] , [18] , [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), ( 1.64, 1.68, 1, [0] , [20] , [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), ( 1.68, 1.72, 2, [0,22], [20,1], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), dtype=(numpy.record, [('ENERG_LO', '>f4'), ('ENERG_HI', '>f4'), ('N_GRP', '>i2'), ('F_CHAN', '>i4', (2,)), ('N_CHAN', '>i4', (2,)), ('MATRIX', '>i4', (2,))])) # max row length of 2 so 2 columns, each row is an energy channel. >>> col2arr_py(data['F_CHAN']) array([[ 0., 0.], [ 0., 0.], [ 0., 22.]])
- response_tools.detector_response.vrmf2arr_py(data=None, n_grp_list=None, f_chan_array=None, n_chan_array=None)[source]
Takes redistribution parameters for each energy channel from a .rmf file and returns it in the correct format [1].
This original function is taken from Sunkit-spex [2].
[1] https://lost-contact.mit.edu/afs/physics.wisc.edu/home/craigm/lib/idl/spectral/vrmf2arr.pro [2] https://github.com/sunpy/sunkit-spex
- Parameters:
data (array/list-like object) – Redistribution matrix parameter array/list from the .rmf file. Units are counts per photon. Default : None
no_of_channels (int) – Number of entries is the total number of photon channels, the entries themselves show the total number of count channels to which that photon channel contributes. Default : None
f_chan_array (numpy.array) – The index of each sub-set channel from each energy bin from the .rmf file run through col2arr_py(). Default : None
n_chan_array (numpy.array) – The number of sub-set channels in each index for each energy bin from the .rmf file run through col2arr_py(). Default : None
- Returns:
A 2D numpy array of the correctly ordered input data with dimensions
of energy in the rows and channels in the columns.
Example
>>> d_rmf = 'directory/' >>> f_rmf = 'file.rmf' >>> e_lo, e_hi, ngrp, fchan, nchan, matrix = det_io._read_rmf(d_rmf+f_rmf) >>> fchan_array = nu_spec.col2arr_py(fchan) >>> nchan_array = nu_spec.col2arr_py(nchan) >>> rmf = nu_spec.vrmf2arr_py(data=matrix, n_grp_list=ngrp, f_chan_array=fchan_array, n_chan_array=nchan_array) # rows = photon/energy channels, columns = counts channels >>> rmf array([[0.00033627, 0.0007369 , 0.00113175, ..., 0. , 0. , 0. ], [0.00039195, 0.00079259, 0.00138341, ..., 0. , 0. , 0. ], [0.00042811, 0.00083381, 0.00157794, ..., 0. , 0. , 0. ], ..., [0. , 0. , 0. , ..., 0.00408081, 0.00409889, 0.00403308], [0. , 0. , 0. , ..., 0.00405333, 0.00413722, 0.00413216], [0. , 0. , 0. , ..., 0. , 0. , 0. ]])
What’s Going On?
The RMF file has the photon-to-counts conversion information in it. The martix has the photon-to-count conversion value for each count channel (column) that is involved with theach photon channel (rows). E.g., matrix = [ [a, b, c, d, e, f, …] , … ] F_chan is the starting index of contiguous counts channels that are involved with the photon channel. E.g., f_chan = [ [0, 5, 0, 0, 0, …] , … ] For the first photon channel, there are rows of counts channels starting at index 0 and 5 N_chan is the corresponding number of counts channels from each index in the f_chan array. E.g., n_chan = [ [2, 3, 0, 0, 0, …] , … ] Starting at index 0 for the first photon channel we have the first 2 matrix values, then at index 5 we have the next 3. The total of each row is the same as the n_grp_list and the number of entries in each row of the matrix entry. Putting all this together, the rmf matrix is: rmf_matrix = [ [a, b, 0, 0, 0, c , d , e, 0 , 0 , …] , … ] Index 0 (f_chan) with 2 entries (n_chan) with photon-to-counts conversion (matrix).
response_tools.effective_area module
Code to load different effective areas.
- class response_tools.effective_area.EffAreaOutput(filename: str, function_path: str, mid_energies: Quantity, off_axis_angle: Quantity, effective_areas: Quantity, optic_id: str, model: bool)[source]
Bases:
BaseOutput
Class for keeping track of effective area response values.
- effective_areas: Quantity
- mid_energies: Quantity
- model: bool
- off_axis_angle: Quantity
- optic_id: str
- response_tools.effective_area.asset_all_optics(save_location=None)[source]
Produce a figure showing all optics as an assets.
- response_tools.effective_area.asset_cmos_files(save_location=None)[source]
Plot the CMOS data to visually check.
- response_tools.effective_area.asset_cmos_plot(save_location=None)[source]
Plot the CMOS data to visually check.
- response_tools.effective_area.asset_msfc_heritage_x7_example(save_location=None)[source]
The MSFC heritage X-7 optic effective area as a simple exmaple.
- response_tools.effective_area.eff_area_cmos(mid_energies, telescope=None, file=None)[source]
Return optics paired with CMOS effective areas interpolated to the given energies.
Telescope 0: position 0, X10/FM2(?) Telescope 1: position 1, Nagoya(?)
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
telescope (int) – The focal plane position of the desired optic. Must be in the list [0, 1]. - Telescope 0 -> Position 0 -> X10/FM2 - Telescope 1 -> Position 1 -> Nagoya-SXR Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each effective area, the effective areas, and more. See accessible information using .contents on the output.
- Return type:
EffAreaOutput
- response_tools.effective_area.eff_area_cmos_telescope(mid_energies, telescope=None, file=None)[source]
Return full telescope(?) with CMOS effective areas interpolated to the given energies.
Telescope 0: position 0, X10/FM2(?) Telescope 1: position 1, Nagoya(?)
Note Will come back to this when there are off-axis angles and do 2D interp. Currently only on-axis angle so just interp across energies.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
telescope (int) – The focal plane position of the desired optic. Must be in the list [0, 1]. - Telescope 0 -> Position 0 -> X10/FM2 - Telescope 1 -> Position 1 -> Nagoya-SXR Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each effective area, the effective areas, and more. See accessible information using .contents on the output.
- Return type:
EffAreaOutput
- response_tools.effective_area.eff_area_msfc_10shell(mid_energies, off_axis_angle=<Quantity 0. arcmin>, optic_id=None, file_tilt=None, file_pan=None)[source]
Function for the heritage 10-shell FOXSI-4 optic effective areas.
The effective areas from the heritage optics do not use a theoretical or model fit, instead they use the measured data-points and interpolate where necessary.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. Default: 0 arc-minutes (on axis)
optic_id (str) – Heritage optic to be returned. Choices are “X-7” or “X-8”. Default: None
file_tilt (str or None) – Gives the ability to provide custom files for the tilt and pan information. Tilt is the off-axis angle when the optics up coincides with Solar North (“vertical”). Pan is the other angle (“horizontal”). Default: None
file_pan (str or None) – Gives the ability to provide custom files for the tilt and pan information. Tilt is the off-axis angle when the optics up coincides with Solar North (“vertical”). Pan is the other angle (“horizontal”). Default: None
- Returns:
An object containing the energies for each effective area, the off-axis angle used, the effective areas, and more. See accessible information using .contents on the output.
- Return type:
EffAreaOutput
- response_tools.effective_area.eff_area_msfc_hi_res(mid_energies, off_axis_angle=None, position=None, use_model=False, file=None)[source]
MSCF hi-res effective areas interpolated to the given energies.
This is the latest from Wayne. - older function is eff_area_msfc
Position 0: X10/FM2 Position 3: X09/FM1 Position 6: X11/FM3
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
position (int) – The focal plane position of the desired optic. Must be in the list [0, 3, 6]. - Position 0 -> X10/FM2 - Position 3 -> X09/FM1 - Position 6 -> X11/FM3 Default: None
use_model (bool) – Defines whether to use the measured values for the optic (False) or the modelled values (True). Default: False
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each effective area, the effective areas, and more. See accessible information using .contents on the output.
- Return type:
EffAreaOutput
- response_tools.effective_area.eff_area_nagoya_hxt(mid_energies, off_axis_angle=None, use_model=False, file=None)[source]
Nagoya HXR hi-res effective areas interpolated to given energies.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
use_model (bool) – Defines whether to use the measured values for the optic (False) or the modelled values (True). Default: False
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each effective area, the effective areas, and more. See accessible information using .contents on the output.
- Return type:
EffAreaOutput
- response_tools.effective_area.eff_area_nagoya_sxt(mid_energies, off_axis_angle=None, use_model=False, file=None)[source]
Nagoya SXR hi-res effective areas interpolated to given energies.
Includes the collimator and OBF too.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
use_model (bool) – Defines whether to use the measured values for the optic (False) or the modelled values (True). Default: False
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each effective area, the effective areas, and more. See accessible information using .contents on the output.
- Return type:
EffAreaOutput
response_tools.ir_plots module
response_tools.phot_spec module
Code to create photon models.
- response_tools.phot_spec.create_energy_edges()[source]
One function to handle giving out the same energies.
- response_tools.phot_spec.gaussian_blur(array, fwhm)[source]
Apply a Gaussian blur (with FWHM) to an array.
- Parameters:
array (numpy.ndarray) – Array to which apply blurring.
fwhm (int, float) – Full-width half-max of the Gaussian. must be in units of “number of bins” for the function, not anything else like energy, etc.
- response_tools.phot_spec.hxr_blur(array)[source]
Apply the FOXSI-4 HXR energy resolution to the incoming array.
- response_tools.phot_spec.hxr_res()[source]
Return the HXR energy resolution (from FOXSI-4).
0.8 keV @ 14 keV
- response_tools.phot_spec.sim_energy_edges(*_, filename=None, **__)[source]
Access energy bin edges from Morgan’s simulations.
- response_tools.phot_spec.sim_footpoints(*_, filename=None, **__)[source]
Access ONE footpoint spectrum from Morgan’s simulations.
- response_tools.phot_spec.sim_full_loop(*_, filename=None, **__)[source]
Access full loop spectrum from Morgan’s simulations.
- response_tools.phot_spec.sim_loop_top(*_, filename=None, **__)[source]
Access loop-top spectrum from Morgan’s simulations.
- response_tools.phot_spec.sxr_blur(array)[source]
Apply the FOXSI-4 SXR energy resolution to the incoming array.
response_tools.quantum_efficiency module
Code to load different quantum efficiencies.
- class response_tools.quantum_efficiency.QuantumEffOutput(filename: str, function_path: str, mid_energies: Quantity, quantum_efficiency: Quantity, detector: str)[source]
Bases:
BaseOutput
Class for keeping track of quantum efficiency response values.
- detector: str
- mid_energies: Quantity
- quantum_efficiency: Quantity
- response_tools.quantum_efficiency.qe_cmos(mid_energies, telescope=None, file=None)[source]
Return quantum efficency of CMOS detectors.
Telescope 0: position 0, X10/FM2(?) Telescope 1: position 1, Nagoya(?)
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
telescope (int) – The focal plane position of the detector of the desired quantum efficiency. Must be in the list [0, 1]. - Telescope 0 -> Position 0 - Telescope 1 -> Position 1 Default: None
file (str or None) – Gives the ability to provide custom files for the information. Default: None
- Returns:
An object containing the energies for each quantum efficency, the quantum efficencies, and more. See accessible information using .contents on the output.
- Return type:
QuantumEffOutput
response_tools.responses module
Functions to make the RMFs and ARFs.
- class response_tools.responses.Response1DOutput(filename: str, function_path: str, mid_energies: Quantity, response: Quantity, response_type: str, telescope: str, elements: tuple)[source]
Bases:
BaseOutput
Class for keeping track of 1D response response values.
- elements: tuple
- mid_energies: Quantity
- response: Quantity
- response_type: str
- telescope: str
- class response_tools.responses.Response2DOutput(filename: str, function_path: str, input_energy_edges: Quantity, output_energy_edges: Quantity, response: Quantity, response_type: str, telescope: str, elements: tuple)[source]
Bases:
BaseOutput
Class for keeping track of 2D response response values.
- elements: tuple
- input_energy_edges: Quantity
- output_energy_edges: Quantity
- response: Quantity
- response_type: str
- telescope: str
- response_tools.responses.asset_response_chain_plot(save_location=None)[source]
Plot the response chain data to visually check.
- response_tools.responses.asset_response_hit_combination_plot(save_location=None)[source]
Look at different combinations of the 1hit and 2hit responses.
- response_tools.responses.foxsi4_telescope0_arf(mid_energies, off_axis_angle)[source]
The Ancillary Response Function (ARF) for Telescope 0.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 0 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the 1D response information of Telescope 0. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope0_flight_arf(mid_energies, off_axis_angle, time_range)[source]
The flight Ancillary Response Function (ARF) for telescope 0.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 0 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 0. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope0_rmf()[source]
The Redistribution Matrix Function (RMF) for Telescope 0.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
- response_tools.responses.foxsi4_telescope1_arf(mid_energies, off_axis_angle)[source]
The Ancillary Response Function (ARF) for Telescope 1.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 1 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the 1D response information of Telescope 1. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope1_flight_arf(mid_energies, off_axis_angle, time_range)[source]
The flight Ancillary Response Function (ARF) for telescope 1.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 1 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 1. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope1_rmf()[source]
The Redistribution Matrix Function (RMF) for Telescope 1.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
- response_tools.responses.foxsi4_telescope2_arf(mid_energies, off_axis_angle)[source]
The Ancillary Response Function (ARF) for Telescope 2.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 2 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the 1D response information of Telescope 2. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope2_flight_arf(mid_energies, off_axis_angle, time_range)[source]
The flight Ancillary Response Function (ARF) for telescope 2.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 2 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 2. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope2_rmf(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
The Redistribution Matrix Function (RMF) for Telescope 2.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
- response_tools.responses.foxsi4_telescope3_arf(mid_energies, off_axis_angle=None)[source]
The Ancillary Response Function (ARF) for Telescope 3.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 3 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the 1D response information of Telescope 3. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope3_flight_arf(mid_energies, time_range, off_axis_angle=None)[source]
The flight Ancillary Response Function (ARF) for Telescope 3.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 3 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 3. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope3_rmf(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
The Redistribution Matrix Function (RMF) for Telescope 3.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
- response_tools.responses.foxsi4_telescope4_arf(mid_energies, off_axis_angle=None)[source]
The Ancillary Response Function (ARF) for Telescope 4.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 4 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the 1D response information of Telescope 4. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope4_flight_arf(mid_energies, time_range, off_axis_angle=None)[source]
The flight Ancillary Response Function (ARF) for Telescope 4.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 4 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 4. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope4_rmf(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
The Redistribution Matrix Function (RMF) for Telescope 4.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. - pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
- response_tools.responses.foxsi4_telescope5_arf(mid_energies, off_axis_angle)[source]
The Ancillary Response Function (ARF) for Telescope 5.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 5 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the 1D response information of Telescope 5. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope5_flight_arf(mid_energies, off_axis_angle, time_range)[source]
The flight Ancillary Response Function (ARF) for Telescope 5.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 5 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 5. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope5_rmf(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
The Redistribution Matrix Function (RMF) for Telescope 5.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
- response_tools.responses.foxsi4_telescope6_arf(mid_energies, off_axis_angle)[source]
The Ancillary Response Function (ARF) for Telescope 6.
DOES NOT include atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 6 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the 1D response information of Telescope 6. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope6_flight_arf(mid_energies, off_axis_angle, time_range)[source]
The flight Ancillary Response Function (ARF) for Telescope 6.
Includes atmospheric attenuation from flight.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the Telescope 6 componented are calculated. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
time_range (astropy.units.quantity.Quantity or None) – The time range the atmsopheric transmissions should be averaged over. If None, numpy.nan<<astropy.units.second, or [numpy.nan, numpy.nan]<<astropy.units.second then the full time will be considered and the output will not be averaged but a grid of the transmissions at all times and at any provided energies.
- Returns:
An object containing the 1D response information of Telescope 6. See accessible information using .contents on the output.
- Return type:
responses.Response1DOutput
- response_tools.responses.foxsi4_telescope6_rmf()[source]
The Redistribution Matrix Function (RMF) for Telescope 6.
- Return type:
None
- response_tools.responses.foxsi4_telescope_spectral_response(arf_response, rmf_response)[source]
Full Spectral Response Matrix (SRM) for a given telescope.
This function will check the Ancillary Response Function (ARF) mid_energies field and the Redistribution Matrix Function (RMF) input_energy_edges field mid-points to check they match before combining both the ARF and RMF into the Spectral Response Matrix (SRM).
This function will check both the ARF and RMF have come from the same telescope using the “telescope” field. A warning will be produce if they are different to inform the user but the function will still output the product if possible.
- Parameters:
arf_response (responses.Response1DOutput) – The Ancillary Response Function (ARF) object for a telescope.
rmf_response (responses.Response2DOutput) – The Redistribution Matrix Function (RMF) object for a telescope.
- Returns:
An object containing the 2D detector response information for a given ARF and RMF. See accessible information using .contents on the output.
- Return type:
responses.Response2DOutput
response_tools.telescope_parts module
Wrappers for position aliases for more specific functions.
- response_tools.telescope_parts.foxsi4_position0_collimator(off_axis_angle)[source]
Position 0 collimator for the optics.
- Parameters:
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the collimator ratio. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position0_detector_response()[source]
Position 0 CMOS1 detector response.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
detector_response.DetectorResponseOutput
- response_tools.telescope_parts.foxsi4_position0_obf(mid_energies)[source]
Position 0 optical blocking filter for the detector.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the OBF transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the OBF. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position0_optics(mid_energies, off_axis_angle=None)[source]
Position 0 MSFC high resolution optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 0 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the effective area information of the MSFC high resolution optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position0_prefilter(mid_energies)[source]
Position 0 pre-filter for the optics.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the pre-filter transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the pre-filter. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position1_collimator(off_axis_angle)[source]
Position 1 collimator for the optics.
- Parameters:
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the collimator ratio. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position1_detector_response()[source]
Position 1 CMOS2 detector response.
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
detector_response.DetectorResponseOutput
- response_tools.telescope_parts.foxsi4_position1_obf(mid_energies)[source]
Position 1 optical blocking filter for the detector.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the OBF transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the OBF. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position1_optics(mid_energies, off_axis_angle=None)[source]
Position 1 Nagoya high resolution optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 1 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the effective area information of the Nagoya high resolution optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position1_prefilter(mid_energies)[source]
Position 1 pre-filter for the optics.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the pre-filter transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the pre-filter. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position2_detector_response(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
Position 2 CdTe4 detector response.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
detector_response.DetectorResponseOutput
- response_tools.telescope_parts.foxsi4_position2_optics(mid_energies, off_axis_angle)[source]
Position 2 MSFC heritage X-7 optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 2 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the effective area information of the MSFC heritage X-7 optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position2_thermal_blanket(mid_energies)[source]
Position 2 thermal blanket transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thermal blanketing transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thermal blanket. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position2_uniform_al(mid_energies)[source]
Position 2 uniform Al attenuator transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the uniform Al attenuator transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the uniform Al attenuator. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position3_al_mylar(mid_energies)[source]
Position 3 thin Mylar window transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thin Mylar window transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thin Mylar window. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position3_detector_response(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
Position 3 CdTe2 detector response.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
detector_response.DetectorResponseOutput
- response_tools.telescope_parts.foxsi4_position3_optics(mid_energies, off_axis_angle=None)[source]
Position 3 MSFC high resolution optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 3 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the effective area information of the MSFC high resolution optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position3_pixelated_attenuator(mid_energies)[source]
Position 3 pixelated attenuator transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the pixelated attenuator transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the pixelated attenuator. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position3_thermal_blanket(mid_energies)[source]
Position 3 thermal blanket transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thermal blanketing transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thermal blanket. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position4_detector_response(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
Position 4 CdTe3 detector response.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
detector_response.DetectorResponseOutput
- response_tools.telescope_parts.foxsi4_position4_optics(mid_energies, off_axis_angle=None)[source]
Position 4 Nagoya high resolution optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 4 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the effective area information of the Nagoya high resolution optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position4_thermal_blanket(mid_energies)[source]
Position 4 thermal blanket transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thermal blanketing transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thermal blanket. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position4_uniform_al(mid_energies)[source]
Position 4 uniform Al attenuator transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the uniform Al attenuator transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the uniform Al attenuator. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position5_al_mylar(mid_energies)[source]
Position 5 thin Mylar window transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thin Mylar window transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thin Mylar window. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position5_detector_response(region: int = None, pitch=None, _side: str = 'merged', _event_type: str = 'all')[source]
Position 5 CdTe1 detector response.
- Parameters:
region (int) – The region of the CdTe detector required. Either provide region _xor_ pitch. The region maps onto the pitches used across the detector. - Region 0 -> 60<<astropy.units.um - Region 1 -> 80<<astropy.units.um - Region 2 -> 100<<astropy.units.um
pitch (astropy.units.quantity.Quantity) – Instead of region, it might be more usefule to specify the pitch in physical units (must b convertable to astropy.units.um). Either provide region _xor_ pitch. The pitches map onto the region input. - 60<<astropy.units.um -> Region 0 - 80<<astropy.units.um -> Region 1 - 100<<astropy.units.um -> Region 2
_side (str) – Define the side on the detector the user requires the response from. Must be in [“pt”, “merged”]. Default: “merged”
_event_type (str) – Define the type of event trigger being considered in the response. Must be in [“1hit”, “2hit”, (“all”, “mix”)]. Note: “all” and “mix” are the same but some from different naming conventions on the merged and individual detector sides. This will be fixed at some point in the future. Default: “all”
- Returns:
An object containing all the redistribution matrix information. See accessible information using .contents on the output.
- Return type:
detector_response.DetectorResponseOutput
- response_tools.telescope_parts.foxsi4_position5_optics(mid_energies, off_axis_angle)[source]
Position 5 MSFC heritage X-8 optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 5 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes.
- Returns:
An object containing the effective area information of the MSFC heritage X-8 optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position5_pixelated_attenuator(mid_energies)[source]
Position 5 pixelated attenuator transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the pixelated attenuator transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the pixelated attenuator. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position5_thermal_blanket(mid_energies)[source]
Position 5 thermal blanket transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thermal blanketing transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thermal blanket. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position6_al_mylar(mid_energies)[source]
Position 6 thin Mylar window transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thin Mylar window transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thin Mylar window. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
- response_tools.telescope_parts.foxsi4_position6_detector_response()[source]
Position 6 Timepix detector response.
Not Implemented.
- Return type:
None
- response_tools.telescope_parts.foxsi4_position6_optics(mid_energies, off_axis_angle=None)[source]
Position 6 MSFC high resolution optic effective areas.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the position 6 optics is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
off_axis_angle (astropy.units.quantity.Quantity) – The off-axis angle of the source. Unit must be convertable to arc-minutes. * Not implemented yet. *
- Returns:
An object containing the effective area information of the MSFC high resolution optic. See accessible information using .contents on the output.
- Return type:
effective_area.EffAreaOutput
- response_tools.telescope_parts.foxsi4_position6_thermal_blanket(mid_energies)[source]
Position 6 thermal blanket transmissions.
- Parameters:
mid_energies (astropy.units.quantity.Quantity) – The energies at which the thermal blanketing transmission is required. If numpy.nan<<astropy.units.keV is passed then an entry for all native file energies are returned. Unit must be convertable to keV.
- Returns:
An object containing the attenuation/transmission information of the thermal blanket. See accessible information using .contents on the output.
- Return type:
attenuation.AttOutput
response_tools.util module
Generally useful functions.
- class response_tools.util.BaseOutput(filename: str, function_path: str)[source]
Bases:
object
Class for keeping track of general response values.
- property contents
Contents of the data class.
- property fields
Just the names of the fields in the data class.
- filename: str
- function_path: str
- property print_contents
Print the contents of the data class in a nice way.
- response_tools.util.native_resolution(native_x, input_x)[source]
Providing an input for effective areas, etc., this function can help decide whether to return values to interpolate to or to just interpolate to the original x-points.
The idea here is that if we want to improve/change the logic here then we only have to do it here and not literally everywhere.
response_tools.version module
Module contents
Top level of the response-tools package.
Namespace
The base response_tools namespace includes:
- ~response_tools.contextResponseInfo
The information stored in a YAML file that includes information from the flight.
- ~response_tools.responseFilePath
The response data file location.
- ~response_tools.__version__
The current version of the code as stated in the setup script.
Examples
# importing the module is as easy as:
>>> import response_tools
# then accessing, e.g., the context information for the flight/flare
>>> print(response_tools.contextResponseInfo)
# that can be accessed like a native Python dictionary
>>> print(response_tools.contextResponseInfo["..."])