MergeARFRMF.cContains routine to multiply an ARF and an RMF.
Multiplies the ARF and RMF structures and returns the result in the RMF structure. If there is a mismatch between energy bins returns the first inconsistent bin number.
RMF.cContains RMF manipulation routines.
Compress the vector representation of the response for a single energy and add into the RMF.
Extract from the RMF the vector representation of the response for a single energy.
Return the RMF element for the input channel and energy bin.
Return the RMF element for the input channel and energy bin when the RMF is stored in the transposed RMFchan structure.
ReadARF.cContains routine to read an ARF.
Read an ARF from the SPECRESP extension in the opened FITS file. If there are multiple SPECRESP extensions will read the ARFnumber one.
ReadPHA.cContains routine to read a PHA file.
Return either 1 or 2 depending on whether the PHAnumber'th SPECTRUM extension is a type 1 or 2 PHA type.
Return the number of spectra in the PHAnumber'th SPECTRUM extension in the opened file.
Read the PHAnumber'th SPECTRUM extension into the PHA structure. Assumes the file is opened but not necessarily positioned at the correct extension.
Read the PHAnumber'th SPECTRUM extension. Reads the spectra specified by the SpectrumNumber array into an array of PHA structures.
ReadRMF.cContains routines to read the RMF file.
Read the RMFnumber'th MATRIX (or SPECRESP MATRIX) extension into a RMF structure.
Read the EBDnumber'th EBOUNDS extension into a RMF structure.
ReturnChannel.cRoutine to return a channel given an RMF and an input energy.
Return NumberPhoton channel numbers from the input energy by drawing randum numbers from a distribution derived from the RMF.
SPio.cInternal I/O routines mainly to provide transparent handling of keywords which may be columns in type II PHA files.
Read keyword_name of type datatype into keyword_value.
Read keyword_name or type datatype into keyword_value from a type II file. Looks first for a keyword of the requested name then if ispec > 0 for an entry in a column.
Read column_name of type datatype into column_values.
Read column_name of type datatype into column_values. Will read either from a keyword, a column, or a vector element of a column as appropriate.
Write keyword_value to keyword_name.
Write keyword_value to keyword_name unless it is a column.
Returns true if not all elements of array are the same value.
Check whether the array of strings in column_values are all the same. If not set the table parameters and increment the tfield counter.
Writes column_values to column_name unless all the values are the same in which case write to a keyword. If a column is written the colnum is incremented.
Write column_values as a vector element in column_name.
SPutils.cInternal utility routines for the heasp library.
Read an ascii file of binning factors into the BinFactors structure.
Sets up a grouping array using the information in the BinFactors structure. Assumes that the grouping array has been allocated enough memory, that the binning ranges are contiguous, the start channel of a range is the channel after the end channel of the previous range, and that the first channel is 1.
Bin the input array up using the grouping data to create the output array. Mode takes four values : 1 means sum bins, 2 take the mean, 3 return the value of the first channel in the bin, and 4 return the value of the last channel in the bin.
TransposeRMF.cRoutine to transpose the RMF matrix.
Transpose the matrix in the RMF structure and output in the RMFchan structure.
WriteARF.cRoutine to write an ARF.
Write the ARF structure to the output FITS file. Assumes the file is open and creates a new SPECRESP extension.
WritePHA.cRoutines to write the PHA file.
Write the PHA structure to the output FITS file. Assumes the file is open and creates a new SPECTRUM extension.
Write the array of PHA structures to the output FITS file. Assumes the file is open and creates a new type II SPECTRUM extension.
WriteRMF.cRoutines to write the RMF file.
Write the MATRIX extension to the output FITS file. Assumes the file is open and creates a new extension.
Write the EBOUNDS extension to the output FITS file. Assumes the file is open and creates a new extension.