xspec Documentation (v1.1.2)

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

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

<img width=800, align="left", src="../images/OI_SiII.png" />

Python Dependencies

Here are the list of Python dependencies that I know of:

  • numpy
  • astropy (latest release; best to clone from github)
  • specutils (latest release; best to clone from github)
  • PyQt4
  • xastropy (duh; unfortunately this might have some extra dependencies..)

Spectral File

The module readwrite.py reads in many formats into a Spectrum1D Class. This includes:

  • LowRedux output
  • HIRedux 1D output
  • HST formats
  • MagE, ESI, etc.

gzipped files are perfectly fine

Generically, the following data formats (all FITS files) are supported:

  1. Flux in f.fits or F.fits file
    • Wavelengths are parsed from the header
    • A neighboring e.fits (or E.fits) file is searched for and input as Error if found
  2. Flux, Error, Wavelength in multi-extension FITS file
  3. Flux, Error, Wavelength in a Binary Table (extension=1)
    • Supported Flux tags: ['SPEC', 'FLUX','FLAM','FX', 'FLUXSTIS', 'FLUX_OPT', 'fl']
    • Supported Error tags: ['ERROR','ERR','SIGMA_FLUX','FLAM_SIG', 'SIGMA_UP', 'ERRSTIS', 'FLUXERR', 'er']
    • Supported Ivar tags: ['IVAR', 'IVAR_OPT']
    • Supported Wavelength tags: ['WAVE','WAVELENGTH','LAMBDA','LOGLAM', 'WAVESTIS', 'WAVE_OPT', 'wa']

The spectrum file used below is part of the xastropy documentation.


In [1]:
import imp
xa_path = imp.find_module('xastropy')[1]
spec_fil = xa_path+'/../docs/data/UM669_nF.fits.gz'

Launching the GUI

I recommend the command line approach, but you can launch from ipython too.

From within ipython or equivalent

from xastropy.xguis import spec_guis as xxsg

reload(xxsg)
xxsg.run_xspec(spec_fil)

From the command line (recommended)

I recommend you generate an alias like this:

alias xspec 'python ~/xastropy/xastropy/xguis/spec_guis.py 1'

Then it is as simple as:

> xspec filename 

Here are the current command-line options:

> xspec -h
usage: spec_guis.py [-h] [-zsys ZSYS] [--un_norm] flag file

Parse for XSpec

positional arguments:
  flag        GUI flag (ignored)
  file        Spectral file

optional arguments:
  -h, --help  show this help message and exit
  -zsys ZSYS  System Redshift
  --un_norm   Spectrum is NOT normalized

Setting the window edges (mouse+keystroke)

  • l -- Set left edge of window
  • r -- Set right edge of window
  • t -- Set top edge of window
  • b -- Set bottom edge of window
  • Z -- Set bottom edge to 0.
  • W -- View full spectrum
  • s,s -- Set a zoom-in window at 2 mouse positions

Zoom in/out Wavelength

  • i -- Zoom in on cursor
  • I -- Zoom in extra fast
  • o -- Zoom out
  • O -- Zoom out extra fast

Zoom out Flux

  • Y -- Zoom out

Pan

  • [ -- Pan left
  • { -- Pan left extra
  • ] -- Pan right
  • } -- Pan right extra

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)
    • Choose the rest wavelength

Marking Doublets

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

Velocity plot

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


Simple Analysis

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
  2. And then another "E" at the other edge (also at the continuum)
  3. 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
  2. And then another "EN" at the other edge (also at the continuum)
  3. 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}$

In [ ]: