Skip to content

Python scripts to generate mock Lyman-alpha forest; read, reduce and analyze quasar spectra from KODIAQ, XQ-100 & UVES.

License

Notifications You must be signed in to change notification settings

p-slash/qsotools

Repository files navigation

Overview

This is the source code that generates mocks, reduce high-resolution spectra and bootstrap QMLE results. It further helps reading and plotting QMLE outputs. Please cite papers Karaçaylı, Font-Ribera & Padmanabhan (2020) and Karaçaylı et al. (submitted to MNRAS).

  • Karaçaylı N. G., Font-Ribera A., Padmanabhan N., 2020, MNRAS, 497, 4742
  • Karaçaylı N. G., et al., 2021, MNRAS (submitted), arXiv

Programs

Scripts under bin folder are executable. Pass --help for arguments. The most important ones are these four scripts:

  • genKXUMocks.py reduces KODIAQ, SQUAD and XQ-100 spectra as described in the paper.
  • genDESILiteMocks.py generates DESI-lite mock spectra as described in the paper. Can also generate with quickquasars and picca file formats.
  • estP1D-FFT.py performs a rough FFT estimate for a given QMLE config file. This should be used only for a rough cross check.
  • bootstrapQMLE.py calculates bootstrap realizations for QMLE results. Individual estimates has to be saved and converted to a FITS file using convertFpbin2FITS.py. This can consume substantial memory and CPU time.

The other scripts are also helpful.

Source

  • fiducial.py contains transition lines, spectrogpraph functions, power spectrum and mean flux fitting functions and their fitters.
  • io.py handles input and output for various spectrum file formats (Binary, KODIAQ, SQUAD, XQ-100, picca and quickquasars) under an umbrella Spectrum class.
  • mocklib.py generates the mocks. Analytical functions describing the lognormal mocks are here.
  • plotter.py helps plotting QMLE results.
  • specops.py does various spectrum operations such as chunking, resampling and binning pixel statistics.
  • kodiaqviewer.py is a beta jupyter notebook class for viewing KODIAQ spectra.

Data

Please cite respective works when using anything related to data.

  • Keck Observatory Database of Ionized Absorption toward Quasars (KODIAQ) Data Release 2 (DR2) can be found on their website (Lehner et al. 2014; O’Meara et al. 2015, 2017). A summary table from VizieR is part of this package. A master file is constructed to gather as much information as possible into a single file. Visually inspected DLAs are listed in here. However, this is constructed in order to roughly mask affected regions, and is not accurate enough for precise scientific studies. It can also contain duplicate regions.
  • The Spectral Quasar Absorption Database (SQUAD) DR1 (Murphy et al. 2019) is here. The provided table is part of this package. An updated DLA table comes with caveats above.
  • XQ-100 is here. A DLA catalog is provided by Sánchez-Ramírez et al. (2016). The relevant part of it is provided here. Similarly, visually identified DLA (with same caveats) are here.

Installation

Conda installation is recommended as running setup.py can break down and/or complicate removal of this package.

Conda installation

Change the name of the environment to your taste in requirements.yml. Then create, activate and install by running

conda env create -f requirements.yml
conda activate [ENVNAME]
pip install .

This should work even for clusters.

Developer installation

Open setup.py. Change the line for package dir to package_dir={'': 'py'}, (This seems to be a bug in pip?). Follow the steps above, but run pip install -e . in the end.

Manual home installation

Warning: running python setup.py install is NOT recommended.

Install requirements pip install -r requirements.txt.

Home install is recommended. Create bin/ and lib/python directories in your $HOME. Add these to your PATH and PYTHONPATH in .bashrc (or .bash_profile, .zshrc, etc.), and restart your terminal.

export PATH="$HOME/bin:$PATH"
export PYTHONPATH="$HOME/lib/python:$PYTHONPATH"

Then, home installation is simply python setup.py install --home=$HOME.

References

  • Lehner N., O’Meara J. M., Fox A. J., Howk J. C., Prochaska J. X., Burns V., Armstrong A. A., 2014, ApJ, 788, 119
  • Murphy M. T., Kacprzak G. G., Savorgnan G. A. D., Carswell R. F., 2019, MNRAS, 482, 3458
  • O’Meara J. M., et al., 2015, AJ, 150, 111
  • O’Meara J. M., Lehner N., Howk J. C., Prochaska J. X., Fox A. J., Peeples M. S., Tumlinson J., O’Shea B. W., 2017, AJ, 154, 114
  • Sánchez-Ramírez R., et al., 2016, MNRAS, 456, 4488

DLA file tables/fN_spline_z24.fits.gz is obtained from pyigm. Following papers and links should be cited:

About

Python scripts to generate mock Lyman-alpha forest; read, reduce and analyze quasar spectra from KODIAQ, XQ-100 & UVES.

Resources

License

Stars

Watchers

Forks

Packages

No packages published