Skip to main content

Redrock redshift fitter

Project description

GitHub Actions CI Status Test Coverage Status Documentation Status

Introduction

Redshift fitting for spectroperfectionism.

Installation

To install:

git clone https://github.com/desihub/redrock
cd redrock
git clone https://github.com/desihub/redrock-templates py/redrock/templates
python setup.py install

That will install the templates with the code. Alternatively, the templates can be put elsewhere and set $RR_TEMPLATE_DIR to that location.

We recommend users see details of rrdesi before running redrock to understand the arguments in more detail.

Run:

rrdesi --help

Running Redrock on desi spectra

1) Without Archetypes:

rrdesi -i <spectra_file> -o <output_file> -d <details_file.h5>

2) With Archetypes

In archetype mode, redrock can be run either with one particular archetype file (e.g., GALAXY, QSO or STAR), or you can also provide the directory that contains archetypes for different spectral classes.

You can also define your own set of archetypes. However, users must follow the file structure of redrock archetypes. To start with, the user should clone the following repository to run redrock in Archetype mode.:

git clone https://github.com/abhi0395/new-archetypes.git

Or:

git clone https://github.com/desihub/redrock-archetypes.git

In summary, the archetypes method uses a combination of physical galaxy spectra and Legendre polynomials to construct a new set of templates and then solve for the coefficients using the bounded value least square method for a few redshifts defined by --nminima.

The method solves for the coefficients of the Legendre polynomials in each camera (b, r, z cameras of desi, --archetype-legendre-percamera keyword is introduced for that). Another argument is --archetype-legendre-prior, which can be prescribed to add a prior while solving for the coefficients (e.g. --archetype-legendre-prior 0.1). If --archetype-legendre-degree 0 is provided, the method will only use archetypes to fit the spectra; no Legendre polynomials will be used. Note that a single --archetypes-no-legendre flag will deactivate all other archetype and legendre-related flags.

If you do not want to use default values, you should separately provide those arguments without the --archetypes-no-legendre flag.

Example run (with all the default values, including per camera mode):

rrdesi -i <spectra_file> --archetypes <archetype_dir or archetype_file> -o <output_file> -d <details_file.h5>

Example run (with all the default values but without per camera mode):

rrdesi -i <spectra_file> --archetypes <archetype_dir or archetype_file> -o <output_file> -d <details_file.h5> --archetype-per-camera False

Example run (with no archetype related default values):

rrdesi -i <spectra_file> --archetypes <archetype_dir or archetype_file> -o <output_file> -d <details_file.h5> --archetypes-no-legendre

3) Archetypes + Nearest neighbours (in chi2 space) approach

Similar to archetypes (method - 2), it also looks for the nearest neighbours of the best archetypes in chi2 space, selects a few nearest neighbours (input provided by the user, --archetype-nnearest) and then constructs a new set of templates combining these archetypes and Legendre polynomials to fit the galaxy spectra as described above.

Example run:

rrdesi -i <spectra_file> --archetypes <archetype_dir or archetype_file> -o <output_file> -d  <details_file.h5> --archetype-nnearest 2

For comment or help regarding archetypes, please contact abhijeetanand2011_at_gmail_dot_com.

License

redrock is free software licensed under a 3-clause BSD-style license. For details see the LICENSE.rst file.

Stephen Bailey & David Schlegel
Lawrence Berkeley National Lab
Spring 2017

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

redrock-0.21.0.tar.gz (955.2 kB view details)

Uploaded Source

Built Distribution

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

redrock-0.21.0-py3-none-any.whl (969.3 kB view details)

Uploaded Python 3

File details

Details for the file redrock-0.21.0.tar.gz.

File metadata

  • Download URL: redrock-0.21.0.tar.gz
  • Upload date:
  • Size: 955.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for redrock-0.21.0.tar.gz
Algorithm Hash digest
SHA256 d796ff2e9a98466ad60370571c16ab3a8b54cd84720d73e18c0a1723497a12fc
MD5 a3d0da3a7e0aaf28b63c8bc8b111c968
BLAKE2b-256 299e0099fdcf442d1213c3149566924604693e32f77a8b53aaddbb9aee1fc683

See more details on using hashes here.

File details

Details for the file redrock-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: redrock-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 969.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for redrock-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7e2f3b7adcf436e1d2ec8b2d5fe21a3037418d4700974e9c8f6adc0e7c52cdf
MD5 869a16e3dbd7582a4063fe80ac9ef35a
BLAKE2b-256 4d29119447765001de23f65eb9072bd16ac6588f38369b88aa15eed1e58cc915

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