Git Product home page Git Product logo

redvsblue's Introduction

redvsblue

"redshift versus blueshift"
Quasar and emission line precise redshift fitting from prior

Presentation

This package aims at measuring a precise redshift given a broad redshift prior. To do so the package, for each emission line or the full spectrum:

  • Runs a coarse chi2 scan as a function of redshift, using the input PCA+boradband Legendre polynomials

  • Finds three local minima

  • Does a finer chi2 scan in each minima

  • Defines the global PCA redshift, "ZPCA" from the best minimum of the three. ZPCA is a redshift estimator biased toward the computation of the PCA.

  • The redshift of the line, "ZLINE", is defined from the maximum of the best-fit model of the line. ZLINE is a redshift estimator un-biased toward the velocity of the line, but can be biased with respect to the cosmological redshift.

Chi2 scan vs. redshift Best fit
chi2_PCA fit_PCA
chi2_MGII fit_MGII
chi2_CIII fit_CIII

Install

To install simply clone the repository, add to your PATH and to your PYTHONPATH

git clone https://github.com/londumas/redvsblue
PYTHONPATH=$PYTHONPATH:<path_to_folder>/redvsblue/py/
PATH=$PATH:<path_to_folder>/redvsblue/bin/

Run

To get all available options:

redvsblue_lineFitter.py --help

To run on SDSS data, do:

redvsblue_lineFitter.py
--out <path_to_write_output>.fits
--in-dir $BOSS_SPECTRO_REDUX/v5_13_0/
--drq DR12Q_v2_10.fits
--z-key Z_VI
--qso-pca <path_to_folder>/redvsblue/etc/rrtemplate-qso.fits

To run on DESI data, for example:

redvsblue_lineFitter.py
--out <path_to_write_output>.fits
--in-dir /project/projectdirs/desi/datachallenge/redwood/spectro/redux/redwood/spectra-64/
--drq /project/projectdirs/desi/datachallenge/redwood/spectro/redux/redwood/zcatalog-redwood-target-truth.fits
--z-key Z
--qso-pca <path_to_folder>/redvsblue/etc/rrtemplate-qso.fits
--data-format DESI
--no-extinction-correction

Output

The output is a FITS file, with one HDU per redshift type:

  • CAT, HDU=1: redshift prior
  • PCA, HDU=2: PCA redshift
  • HALPHA, HDU=3: redshift of the HALPHA line
  • HBETA, HDU=4: redshift of the HBETA line
  • MGII, HDU=5: redshift of the MGII line
  • CIII, HDU=6: redshift of the CIII line
  • CIV, HDU=7: redshift of the CIV line
  • LYA, HDU=8: redshift of the LYA line

For each best fit readshift, the code gives the following quantities:

  • ZLINE: best fit redshift of the line according to maximum of PCA

  • ZPCA: best fit redshift according to PCA

  • ZERR: redshift error

  • ZWARN: redshift warning, use ZWARN=0 for reliable redshifts

  • CHI2: chi^2 of the best fit

  • DCHI2: Delta chi^2 against a Legendre polynomial, i.e. gives the significance of the redshift

  • NPIXBLUE: number of pixel on the blue side around the prior redshift

  • NPIXRED: number of pixel on the red side around the prior redshift

  • NPIX: total number of pixels around the prior redshift

  • NPIXBLUEBEST: number of pixel on the blue side around the best redshift

  • NPIXREDBEST: number of pixel on the red side around the best redshift

  • NPIXBEST: total number of pixels around the best redshift

  • SNR: mean signal-to-noise ratio per pixel in the spectral region used for measuring the redshift

Why Red vs. Blue

RED vs BLUE, from Corridor: https://www.youtube.com/watch?v=arg_aHzviQw

Release follow the name of the queen of France

https://fr.wikipedia.org/wiki/Liste_des_reines_et_imp%C3%A9ratrices_de_France

redvsblue's People

Contributors

helion-du-mas-des-bourboux-thales avatar londumas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

redvsblue's Issues

Add more lines

LINE_0  =              1215.67 / LYA
LINE_1  =            1548.2049 / CIV(1548)
LINE_2  =             1908.734 / CIII(1909)
LINE_3  =            2796.3511 / MgII(2796)
LINE_4  =              4862.68 / Hbeta
LINE_5  =               6562.8 / Halpha

[DESI] spectrum is in different healpix

WARNING: Can not find TARGETID=260129182 in file /project/projectdirs/desi/mocks/lya_forest/develop/london/v6.0/v6.0.5/eboss-0.0/spectra-16//19/1966/spectra-16-1966.fits

Indeed, this object is in /project/projectdirs/desi/mocks/lya_forest/develop/london/v6.0/v6.0.5/eboss-0.0/spectra-16/19/1967/spectra-16-1967.fits
Is it a problem when object is on the edge and then casting float and double?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.