Skip to content

Instantly share code, notes, and snippets.

@giacomov
Created January 13, 2017 18:24
Show Gist options
  • Save giacomov/a52972e5c7983c5c7f509df396902abf to your computer and use it in GitHub Desktop.
Save giacomov/a52972e5c7983c5c7f509df396902abf to your computer and use it in GitHub Desktop.
rsps = []
phas = []
baks = []
for interval in intervals:
this_rsp = my_instrument_response_set.weight_by_counts(...)
this_pha = [this is what you are doing]
this_bak = [this is what you are doing]
rsps.append(this_rsp)
phas.append(this_pha)
baks.append(this_bak)
# Now write the RSP file
ebounds = EBOUNDS(...) # You can get what you need from the first matrix
ogip_rsps = [SPECRESP_MATRIX(this_rsp.monte_carlo_energies, this_rsp.ebounds, this_rsp.matrix) for this_rsp in rsps]
rsp2_file = FITSFile(fits_extensions=ogip_rsps)
# and so on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment