Package: zhunter
zHunterzHunter 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 redshiftzof transient sources observed spectroscopically, hence its name.
It usesPython 3.9and is based on thepyqtgraphlibrary for speed (as opposed to the more commonly usedmatplotlib).InstallationIf you use a virtual environment manager for python (which we recommend), you can create an environment specific forzHunter with:$ conda env create -f zhunter_conda_env.yamlUsing pip$ pip install zhunterIf you want the latest development you can switch to thedevbranch and to$ pip install .Note:sometimes the pip installation of PyQt5 fails, in this case try to install PyQt5 with conda:$ conda install pyqtLaunching the GUIIf the installation went smoothly, you can launch the GUI by simply typing in your terminal:$ zhunterYou can make sure the code works by loading the 2D file./example_data/example_2D.fits(hint: GRB redshift is around 6.3).UsageFor a summary of the various key bindings discussed below, pressh(for help).Loading a fileTo load a file, simply use the1D Fileor2D Filebuttons corresponding to your case. The files should be in a standardFITSformat.Hunting for a redshiftOnce 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 keysa,s,dandw.From 2D to 1D: extracting the traceThe 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 featuresNow 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 redshiftIf 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 theekey, this should fill theLambda_1box, then move your cursor to the second line and press theqkey forLambda_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 absorberFinally, if you are confident you have identified the correct transitions, you can select them in the list and use theI'm feeling luckybutton. 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.