Skip to main content

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

Release files for redrock 0.21.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redrock 0.21.0
File Size Uploaded
redrock-0.21.0.tar.gz 955.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for redrock 0.21.0
File Interpreter ABI Platform
redrock-0.21.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / redrock-0.21.0.tar.gz

Download URL redrock-0.21.0.tar.gz
Size 955.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d796ff2e9a98466ad60370571c16ab3a8b54cd84720d73e18c0a1723497a12fc
BLAKE2b-256 checksum
How to use checksums
299e0099fdcf442d1213c3149566924604693e32f77a8b53aaddbb9aee1fc683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / redrock-0.21.0-py3-none-any.whl

Download URL redrock-0.21.0-py3-none-any.whl
Size 969.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7e2f3b7adcf436e1d2ec8b2d5fe21a3037418d4700974e9c8f6adc0e7c52cdf
BLAKE2b-256 checksum
How to use checksums
4d29119447765001de23f65eb9072bd16ac6588f38369b88aa15eed1e58cc915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.21.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page