Skip to main content

A Python-based visualization tool for finding redshifts and manipulating astronomical spectra.

Project description

zHunter

zHunter is a Graphical User Interface (GUI) tool to visualize and perform basic manipulation of 1D and 2D astronomical spectra. It is originally developped to help find (hunt for) the redshift z of transient sources observed spectroscopically, hence its name. It uses Python 3.9 and is based on the pyqtgraph library for speed (as opposed to the more commonly used matplotlib).

Installation

If you use a virtual environment manager for python (which we recommend), you can create an environment specific for zHunter with:

$ conda env create -f zhunter_conda_env.yaml

Using pip

$ pip install zhunter

If you want the latest development you can switch to the dev branch and to

$ pip install .

Note: sometimes the pip installation of PyQt5 fails, in this case try to install PyQt5 with conda:

$ conda install pyqt

Launching the GUI

If the installation went smoothly, you can launch the GUI by simply typing in your terminal:

$ zhunter

You can make sure the code works by loading the 2D file ./example_data/example_2D.fits (hint: GRB redshift is around 6.3).

Usage

For a summary of the various key bindings discussed below, press h (for help).

Loading a file

To load a file, simply use the 1D File or 2D File buttons corresponding to your case. The files should be in a standard FITS format.

Hunting for a redshift

Once you've loaded a file, the hunt begins. You can move around the spectrum by left-clicking and dragging, by right-clicking and zooming or with the keys a, s, d and w.

From 2D to 1D: extracting the trace

The first thing you want to look for is the trace in the 2D; once you have it, place the red rectangle (you can adjust the width) to encase the continuum as shown below.

Looking for features

Now that you have your 2D with a good corresponding 1D, you can start looking for the easiest features to identify; these include damped Lyman-alpha absorption (DLA) as shown below circled in blue, any emission lines and common absorption lines.

Using line ratios to find the redshift

If you don't see any obvious DLA, you can scan through the spectrum to find absorption lines. While the wavelength of each absorption line may be redshifted due to the expansion of the Universe, the ratio between the wavelengths of two lines remains constant. Try to look for doublets, or lines close to each other with similar line profiles; this may indicate they originate from the same absorbing gas and therefore are related. To calculate the ratio between two wavelengths, place your cursor above the first line and press the e key, this should fill the Lambda_1 box, then move your cursor to the second line and press the q key for Lambda_2. You can then calculate the ratio by pressing the corresponding button, and by specifying an error margin you can look up the possible line ratios. If you find too many options for the line ratios, try reducing the error margin if you are confident of your lambda placements.

Adding an absorber

Finally, if you are confident you have identified the correct transitions, you can select them in the list and use the I'm feeling lucky button. This will overplot a number of transitions, indicated by vertical lines, at the correct redshift on your 1D spectrum; note that not all of these transitions need to be present in your spectrum, some have low transition probabilites but are included for completeness. The list of lines used for adding absorbers probably will evolve as we work out which ones are most relevant. This process is illustrated below.

Note: you can also add an absorber manually with the button on the top right.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zhunter-0.10.3.tar.gz (14.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zhunter-0.10.3-py3-none-any.whl (14.2 MB view details)

Uploaded Python 3

File details

Details for the file zhunter-0.10.3.tar.gz.

File metadata

  • Download URL: zhunter-0.10.3.tar.gz
  • Upload date:
  • Size: 14.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for zhunter-0.10.3.tar.gz
Algorithm Hash digest
SHA256 a040c7fe8a6600c83a14e370743eb64e3b4b2be1e98134a492b1ca9b80757405
MD5 ffddac1c965280b3a0c0c95f9163ddde
BLAKE2b-256 f17a0b029dce68dfb8514b954a61e1bef344e5d5dd63359e3cd19e59b0c8ebd9

See more details on using hashes here.

File details

Details for the file zhunter-0.10.3-py3-none-any.whl.

File metadata

  • Download URL: zhunter-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 14.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for zhunter-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8fa9202f286f8627ee1817783a05b544c13e79d64c41be20ab99947ebea96a5e
MD5 bf44f22a871de19a9e9af0d18020c95f
BLAKE2b-256 f6623fb7af403a2c568c97c570dfa1c9832d463a64670d4bc7c2dc2d6e785ba8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page