NAME
ixpemkxspec -- Generates .xcm files from a list of IXPE spectral files for faster loading of the spectra into xspec or pyxspec.
USAGE
ixpemkxspec.py specfiles [xcmname] [caldbresp] [ignore] [emin] [emax]
DESCRIPTION
ixpemkxspec first checks that there are two or more files in the given list, and if not, returns an error. It then checks the header of the second HDU of each file in the list for the keywords "DETNAM", "STOKESPR", "DATE-OBS", and "STOKESWT" that identify the input files as IXPE spectra files. For each file found that does not contain the keywords, an error is written to the log, and after all files have been checked, the program will exit without writing the output file if any files failed the check. If caldbresp is True, or if the file does not contain the keyword "RESPFILE" or the value is not a valid file, the module will look up the appropriate spectral response file for each specfile based on the values of DATE-OBS, DETNAM, and STOKESWT. Otherwise, the filename given by the "RESPFILE" keyword in the specfile header will be used as the spectral response file for the given specfile. The program sorts the files by DETNAM, and writes each spectrum file and its corresponding spectral response file to the output file. If ignore is true, then instructions are written to the file for xspec to ignore energies less than emin and greater than emax.
PARAMETERS
- specfiles* (str)
- A list of spectral file names given as a comma-separated list or within a text file given by @filename.
- xcmname (str)
- Optional names of the xspec file to be generated. A separate file for pyxspec will also be created at the same time (default: ixpexspec.xcm and ixpexspec_py.xcm)
- caldbresp (Boolean)
- If
caldbresp is true, the spectral response file for each specfile will be looked up from the CALDB based on the values of DATE-OBS, DETNAM, and STOKESWT in the specfile.
If False, the module will first attempt to use the value of RESPFILE from specfile as the spectral response file name.
However, if the keyword is missing or names an invalid file, the module will attempt to look up the spectral response file in the CALDB. This option is not applicable to the pyxspec-specific xcm file due to compatibility. (default: yes)
- ignore (Boolean)
- Optional flag to control whether the generated script will instruct xspec to ignore (yes) or include (no) energies outside the specified range between
emin and emax. (default: yes)
- emin (float)
- If
ignore is true, the generated script will instruct xspec to ignore energies less than this value. (default: 2.0)
- emax (float)
- If
ignore is true, the generated script will instruct xspec to ignore energies greater than this value. (default: 8.0)
EXAMPLES
BUGS
SEE ALSO
LAST MODIFIED
Mar 2025