xspec Documentation

Download this notebook.

This ipython Notebook is intended to provide documentation for the linetools GUI named XSpecGUI.

Enjoy and feel free to suggest edits/additions, etc.

Here is a screenshot of the XSpecGUI in action:

from IPython.display import Image
Image(filename="images/xspec_example.png")
_images/xspecgui_1_0.png

The example spectrum file used below is part of the linetools package.

import imp
lt_path = imp.find_module('linetools')[1]
spec_fil = lt_path+'/spectra/tests/files/PH957_f.fits'

Before Launching the GUI

If you are a Mac user, we highly recommend that you set your matplotlib backend from MacOSX to TkAgg (or another option, see backends).

Launching the GUI

From within ipython or equivalent

from linetools.guis import xspecgui as ltxsg

import imp; imp.reload(ltxsg)
ltxsg.main(spec_fil)


Overlaying Line Lists

You can overlay a series of vertical lines at standard spectral lines at any given redshift.

Setting the Line List

You must choose a line-list by clicking one.

Setting the redshift

  • Type one in
  • RMB on a spectral feature (Ctrl-click on Emulated 3-button on Macs)
    • Choose the rest wavelength

Marking Doublets

  • C – CIV
  • M – MgII
  • X – OVI
  • 4 – SiIV
  • 8 – NeVIII
  • B – Lyb/Lya

Velocity plot (Coming Soon)

Once a line list and redshift are set, type ‘v’ to launch a Velocity Plot GUI.


Simple Analysis

Gaussian Fit

You can fit a Gaussian to any single feature in the spectrum as follows: 1. Click “G” at the continuum at one edge of the feature 1. And then another “G” at the other edge (also at the continuum) 1. A simple Gaussian is fit and reported.

Equivalent Width

You can measure the rest EW of a spectral feature as follows: 1. Click “E” at the continuum at one edge of the feature 1. And then another “E” at the other edge (also at the continuum) 1. A simple boxcar integration is performed and reported.

Apparent Column Density

You can measure the apparent column via AODM as follows: 1. Click “N” at the continuum at one edge of the feature 1. And then another “EN” at the other edge (also at the continuum) 1. A simple AODM integration is performed and reported.

Ly\(\alpha\) Lines

  • “D” - Plot a DLA with \(N_{\rm HI} = 10^{20.3} \rm cm^{-2}\)
  • “R” - Plot a SLLS with \(N_{\rm HI} = 10^{19} \rm cm^{-2}\)