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

HEASARC Staff Scientist Position - Applications are now being accepted for a Staff Scientist with significant experience and interest in the technical aspects of astrophysics research, to work in the High Energy Astrophysics Science Archive Research Center (HEASARC) at NASA Goddard Space Flight Center (GSFC) in Greenbelt, MD. Refer to the AAS Job register for full details.