rmf class public methods

  •   rmf()
    
      rmf(const rmf& a)
    
      rmf(const string filename, const Integer RMFnumber = 1)
    
      rmf(const vector<Integer>& inNumberGroups,
          const vector<vector<Integer> >& inFirstChannelGroup,
          const vector<vector<Integer> >& inNumberChannelsGroup,
          const vector<vector<Integer> >& inOrderGroup,
          const vector<Real>& inLowEnergy, const vector<Real>& inHighEnergy,
          const vector<vector<Real> >& inMatrix, 
          const vector<Real>& inChannelLowEnergy,
          const vector<Real>& inChannelHighEnergy,
          const Integer inFirstChannel, const Real inAreaScaling,
          const Real inResponseThreshold, const map<string,string>& inKeys)
    

    Constructors. The first is the default constructor. The rest are constructor versions of the copy, read, and load methods described below.

  •  ~rmf()
    

    Default destructor.

  •  Integer read(string filename, Integer RMFnumber = 1)
    

    Read the RMF file into an object. If RMFnumber is given read from the MATRIX (or SPECRESP MATRIX) and EBOUNDS extensions with EXTVER=RMFnumber. If there is only one EBOUNDS extension then that will be used.

  •  Integer readMatrix(string filename, Integer RMFnumber = 1)
    

    Read the MATRIX (or SPECRESP MATRIX) extension from an RMF file into an object. If RMFnumber is given read from the MATRIX (or SPECRESP MATRIX) extension with EXTVER=RMFnumber.

  •  Integer readChannelBounds(string filename, Integer RMFnumber = 1)
    

    Read the EBOUNDS extension from an RMF file into an object. If RMFnumber is given read from the EBOUNDS extension with EXTVER=RMFnumber.

  •   Integer load(const vector<Integer>& inNumberGroups,
                   const vector<vector<Integer> >& inFirstChannelGroup,
                   const vector<vector<Integer> >& inNumberChannelsGroup,
                   const vector<vector<Integer> >& inOrderGroup,
                   const vector<Real>& inLowEnergy,
                   const vector<Real>& inHighEnergy,
                   const vector<vector<Real> >& inMatrix,
                   const vector<Real>& inChannelLowEnergy,
                   const vector<Real>& inChannelHighEnergy,
                   const Integer inFirstChannel, const Real inAreaScaling,
                   const Real inResponseThreshold,
                   const map<string,string>& inKeys)
    

    Load the rmf object with the required information. The inKeys map is used to set the string members with the first element being the FITS keyword name and the second the values.

  •  void initialize(const arf&)
    

    Initialize from an arf object. Copies members in common between arfs and rmfs

  •  void loadDiagonalResponse(const vector<Real>& eLow,
                               const vector<Real>& eHigh,
                               const vector<Real>& rspVals,
                               const Integer firstChan)
    

    Load the simple case of a diagonal response where the response energy and channel energy ranges are assumed to be the same and the only non-zero response values are along the diagonal and are set using the rspVals argument.

  •  rmf& operator= (const rmf&)
    
     rmf& copy(const rmf&)
    
    Deep copy.

  •  Real ElementValue(Integer Channel, Integer EnergyBin,
                       Integer GratingOrder = -999)
    

    Return the value for a particular channel, energy, and grating order. If the grating order argument is set to -999 then it is ignored.

  •  vector<Real> RowValues(Integer EnergyBin,
                            Integer GratingOrder = -999)
    

    Return the response array for a particular energy and grating order. If the grating order argument is set to -999 then it is ignored.

  •  vector<Integer> RandomChannels(const Real energy, 
                                    const Integer NumberPhotons,
                                    const vector<Real>& RandomNumber,
                                    const Integer GratingOrder = -999)
    
     vector<Integer> RandomChannels(const vector<Real>& energy, 
                                    const vector<Integer>& NumberPhotons,
                                    const vector<vector<Real> >& RandomNumber,
                                    Integer GratingOrder = -999)
    

    Use the response matrix to generate random channel numbers for photons of given energy and grating order. When using a vector of energies, NumberPhotons[i] events are generated for energy[i]. The RandomNumber input should be uniformly distributed between 0 and 1. There should be NumberPhotons[i] random numbers for energy[i]. If the grating order argument is set to -999 then it is ignored.

  •  string disp() const
    

    Display information about the response. - return as a string.

  •  void clear()
    

    Clear information from the response.

  •  void clearMatrix()
    

    Clear only the matrix information from the response.

  •  string check() const
    

    Check completeness and consistency of information in the rmf, if there is a problem then return diagnostic in string.

  •  void normalize()
    

    Normalize the rmf so it sums to 1.0 for each energy bin.

  •  void compress(const Real threshold)
    

    Compress the rmf to remove all elements below the threshold value.

  •  void uncompress()
    

    Uncompress the rmf i.e. turn it into a full rectangular matrix.

  •  Integer rebinChannels(grouping&)
    

    Rebin in channel space using the specified grouping object.

  •  Integer rebinEnergies(grouping&)
    

    Rebin in energy space using the specified grouping object.

  •  Integer shiftChannels(const Integer Start, 
                           const Integer End, const Real Shift,
                           const Real Factor = 1.0, 
                           bool useEnergyBounds = false)
    
     Integer shiftChannels(const vector<Integer>& vStart,
                           const vector<Integer>& vEnd, 
                           const vector<Real>& vShift, 
                           const vector<Real>& vFactor, 
                           bool useEnergyBounds = false)
    

    Remap the response up or down in channels. Moves response between channels Start and End by Shift channels and stretches by Factor. If useEnergyBounds is true then Shift is assumed to be in energy, otherwise in channels.

  •  Integer shiftEnergies(const Integer Start, const Integer End,
                           const Real Shift, const Real Factor)
    
     Integer shiftEnergies(const vector<Integer>& vStart,
                           const vector<Integer>& vEnd, 
                           const vector<Real>& vShift,
                           const vector<Real>& vFactor)
    

    Remap the response up or down in energies. Moves response between energy bins Start and End by Shift energy and stretches by Factor. Shift is assumed to be in energy.

  •  Integer interpolateAndMultiply(const vector<Real>& energies, 
                                    const vector<Real>& factors)
    

    Multiply by a vector which may not have the same energy binning as the response.

  •  Integer write(const string filename, const
    string sourceFilename="") const
    

    Write response to a RMF file. Note that if the output filename exists and already has MATRIX and EBOUNDS extensions then this method will write additional extensions provided that no sourceFilename is given. If sourceFilename is given then the primary HDU and any other extra HDUs are copied into the output file as well as any extra keywords or columns in the EBOUNDS and MATRIX extensions.

  •  Integer writeMatrix(const string filename) const
    

    Write the MATRIX extension to a RMF file. Note that if the output filename exists and already has a MATRIX extension then this method will write an additional extension.

  •  Integer writeChannelBounds(const string filename) const
    

    Write the EBOUNDS extension to a RMF file. Note that if the output filename exists and already has a EBOUNDS extension then these methods will write an additional extension.

  •  rmf& operator*=(const arf&)
    

    Multiply current rmf by an arf.

  •  rmf& operator*=(const Real&)
    

    Multiply current rmf by a factor.

  •  rmf& operator+=(const rmf&)
    

    Add another rmf to the current rmf.

  •  Integer checkCompatibility(const rmf&)
    

    Check compatibility with another rmf.

  •  Integer checkCompatibility(const arf&)
    

    Check compatibility with an arf.

  •  Integer convertUnits()
    

    Convert energy units from current units to keV. Valid options for the current units are keV, MeV, GeV, Hz, angstrom, cm, micron, nm.

  •  void reverseRows()
    

    Reverse the rows. This is useful if the rows are not in increasing order of energy, which xspec requires.

  •  void addRow(const vector<Real>& Response, 
                 const Real eLow, const Real eHigh)
    
     void addRow(const vector<vector<Real> >& Response, const Real eLow, 
                 const Real eHigh, const vector<Integer>& GratingOrder)
    

    Add a row to the response using an input response vector and energy range.

  •  void addRow(const vector<Integer>& fChan, const vector<Integer>& nChan,
                const vector<Real>& Response, const Real eLow, const Real eHigh)
    

    Add a row to the response using channel group format

  •  void substituteRow(const Integer RowNumber, 
                 const vector<Real>& Response)
    
     void substituteRow(const Integer RowNumber, 
                 const vector<vector<Real> >& Response, 
                 const vector<Integer>& GratingOrder)
    

    Substitute a row into the response using an input response vector and energy range.

  •  void substituteRow(const vector<Integer>& fChan, 
                 const vector<Integer>& nChan, const vector<Real>& Response, 
                 const Real eLow, const Real eHigh)
    

    Substitute a row into the response using channel group format

  •  vector<Real> multiplyByModel(const vector<Real>& model)
    

    Multiply a response by a vector and output a vector of pha values. The input vector is assumed to be on the energy binning.

  •  vector<Real> estimatedFWHM() const
    

    Return a vector containing the FWHM in channels for each energy. This does assume that the response has a well-defined main peak.

  •  vector<Real> estimatedFWHMperChannel() const
    

    Return a vector containing the FWHM in channels for each channel. This does assume that the response has a well-defined main peak.

  •  Integer NumberChannels() const
    
     Integer getNumberChannels() const
    

    Return the number of spectrum channels.

  •  Integer NumberEnergyBins() const
    
     Integer getNumberEnergyBins() const
    

    Return the number of response energies.

  •  Integer NumberTotalGroups() const
    
     Integer getNumberTotalGroups() const
    

    Return the number of response groups.

  •  Integer NumberTotalElements() const
    
     Integer getNumberTotalElements() const
    

    Return the number of response elements.


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

Last modified: Wednesday, 23-Mar-2022 21:09:01 EDT