Response example

The following Python example reads RMF and ARF files, removes all elements smaller than $10^{-6}$ from the RMF, multiplies the compressed RMF and the ARF, and writes out the result.

import os
from heasp import *

# read RMF and ARF
inputRMF = rmf("testin.rmf")
inputARF = arf("testin.arf")

# compress the RMF
inputRMF.compress(1.0e-6)

# if the RMF and ARF are compatible then multiply them and write
# the result adding extra keywords and extensions from testin.rmf.
if inputRMF.checkCompatibility(inputARF) == 0:
  inputRMF *= inputARF
  rmffile = "testout.rsp"
  if (os.path.exists(rmffile)): os.remove(rmffile)
  status = inputRMF.write(rmffile, "testin.rmf")
  if status != 0: print("Failed to write testout.rsp: status = ", status)




HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 28-Aug-2024 16:49:36 EDT