array2xspec module¶
Manipulate python data to produce Xspec readable files
-
array2xspec.
fake_pha
(values, energies, errors=None, prefix='fake', respfile='NONE', telescope='FAKE', instrument='FAKE', afilter='NONE', backfile='NONE', corrfile='NONE', ancrfile='NONE', syserr=0, date='2001-01-01')[source]¶ Creates a fake pha file to be read fitted with xspec
Parameters: - values (ndarray) – Values of the fake data
- energies (ndarray) – Array of bin edges for the x-axis (lenght of values + 1)
- errors (ndarray, optional) – statistical error of the fake data. Default is zero
- prefix (str, optional) – A prefix to save file as <prefix>.pha. Defauls is “fake”
Other Parameters: - date (str) – File creation date. Default is “2001-01-01”
- telescope (str) – Name of the mission/telescope
- instrument (str) – Name of the instrument used
- afilter (str) – FILTER keyword
- respfile (str) – Response file.
- backfile (str) – Background file
- corrfile (str) – CORRFILE keyword
- ancrfile (str) – ANCRFILE keyword
- syserr (float) – systematic error on data
Returns: Return type: Creates <prefix>.pha file in the current directory
-
array2xspec.
fake_rmf
(energies, prefix='fake', telescope='FAKE', instrument='FAKE', date='2001-01-01', afilter='NONE', effarea=1.0)[source]¶ Creates a dummy rmf file with a diagonal response
Parameters: - energies (ndarray) – Array of bin edges for the x-axis (lenght of values + 1)
- prefix (str, optional) – A prefix to save file as <prefix>.pha. Defauls is “fake”
Other Parameters: - date (str) – File creation date. Default is “2001-01-01”
- telescope (str) – Name of the mission/telescope
- instrument (str) – Name of the instrument used
- afilter (str) – FILTER keyword
- effarea (float) – EFFAREA keyword.
Returns: Return type: Creates <prefix>.rmf file in the current directory
-
array2xspec.
read_from_txt
(filename)[source]¶ Reads a text file to create xspec readable fits file
Parameters: filename (str) – A text files with 2 or 3 columns to read. Returns: energies, values(, erros) – The columns present in the file text Return type: ndarrays Raises: IOError
– If the files has less than 2 or more than 3 columns or is read as such due to formatting.