astrosaber

Self-Absorption Baseline ExtractoR developed for systematic baseline fitting

https://github.com/astrojoni89/astrosaber

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: acs.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.8%) to scientific vocabulary

Keywords

astronomy baseline baseline-extraction hi-emission self-absorption
Last synced: 6 months ago · JSON representation ·

Repository

Self-Absorption Baseline ExtractoR developed for systematic baseline fitting

Basic Info
  • Host: GitHub
  • Owner: astrojoni89
  • License: bsd-3-clause
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 22.2 MB
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Topics
astronomy baseline baseline-extraction hi-emission self-absorption
Created about 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License Citation

README.md

astroSABER

astroSABER logo
GitHub release (latest by date) GitHub Repo stars

About

The astroSABER (Self-Absorption Baseline ExtractoR) algorithm is an automated baseline extraction routine that is designed to recover baselines of absorption features that are convoluted with HI emission spectra. It utilizes asymmetric least squares smoothing first proposed by Eilers (2004). The algorithm progresses iteratively in two cycles to obtain a smoothed baseline, the major (outer) cycle and the minor (inner) cycle executed at each iteration of the major cycle. The basis of the minor cycle is to find a solution that minimizes the penalized least squares function:

$$\begin{equation} F(\mathbf{z}) = (\mathbf{y} - \mathbf{z})^\top \mathbf{W} (\mathbf{y} - \mathbf{z}) + \lambda \mathbf{z}^\top \mathbf{D}^\top \mathbf{D} \mathbf{z} , \end{equation}$$

where $\mathbf{y}$ is the input signal (e.g., the observed \ion{H}{i} spectrum) and $\mathbf{z}$ is the asymmetrically smoothed baseline to be found. The first and second term describe the fitness of the data and the smoothness of $\mathbf{z}$ defined by the second order differential matrix $\mathbf{D}$, respectively. The parameter $\lambda$ adjusts the weight of the smoothing term. In order to correct the baseline with respect to peaks and dips in the spectrum, the asymmetry weighting matrix $\mathbf{W} = \mathrm{diag}(\mathbf{w})$ is introduced. The asymmetry weights are initialized to be $w_i=1$. After a first iteration of the minor cycle, the weights are then assigned as follows:

$$\begin{align} wi = \begin{cases} p, & yi > zi \ 1-p, & yi \leq z_i \end{cases} . \end{align}$$

The asymmetry parameter $p\in[0,1]$ is set to favor either peaks or dips while smoothing the spectra. Given both the parameters $\lambda$ and $p$, a smoothed baseline $\mathbf{z}$ is updated iteratively. Depending on $p$ and the deviation of $\mathbf{z}$ from $\mathbf{y}$ after each iteration, peaks (dips) in the spectrum will be retained while dips (peaks) will be given less weight during the smoothing.

After $n_{\mathrm{minor}}$ iterations, the minor cycle converges, such that the iteratively updated baseline $\mathbf{z}$ will not change anymore given the input spectrum $\mathbf{y}$. However, in order to effectively smooth out dips while still retaining real signal peaks in the spectra, the smoothed baseline $\mathbf{z}$ is then passed to the next iteration of the major cycle as an input (i.e. now $\mathbf{y}$) for its minor cycle smoothing.

In the case of the THOR HI data, the minor cycle has shown to already converge after three iterations. Hence, the number of minor cycle iterations has been fixed at $n_{\mathrm{minor}}=3$ in the algorithm. This parameter affects the output of astrosaber only mildly since the final smoothed baseline is mostly dependent on the number of iterations in the major cycle and on the $\lambda$ parameter that tunes the smoothing.

Installation

Dependencies

You will need the following packages to run astrosaber. We list the version of each package which we know to be compatible with astrosaber:

Download astroSABER

Download astrosaber using git $ git clone https://github.com/astrojoni89/astrosaber.git

Installing astroSABER

To install astrosaber, make sure that all dependencies are already installed and properly linked to python. We recommend using anaconda and creating a new environment. Then cd to the local directory containing astrosaber and install via pip install astrosaber or without using pip python setup.py install from within the astrosaber directory.

Getting started

You can find example scripts and a jupyter notebook for an HI self-absorption (HISA) baseline extraction run in the example directory. The data used in this example are taken from The HI/OH Recombination line survey of the inner Milky Way (THOR; Beuther et al. 2016, Wang et al. 2020).

Citing astroSABER

If you make use of this package in a publication, please consider the following citation:

``` @ARTICLE{2023A&A...679A.130S, author = {{Syed}, J. and {Beuther}, H. and {Goldsmith}, P.~F. and {Henning}, Th. and {Heyer}, M. and {Klessen}, R.~S. and {Stil}, J.~M. and {Soler}, J.~D. and {Anderson}, L.~D. and {Urquhart}, J.~S. and {Rugel}, M.~R. and {Johnston}, K.~G. and {Brunthaler}, A.}, title = "{Cold atomic gas identified by H I self-absorption. Cold atomic clouds toward giant molecular filaments}", journal = {\aap}, keywords = {ISM: clouds, ISM: atoms, ISM: molecules, radio lines: ISM, stars: formation, Astrophysics - Astrophysics of Galaxies}, year = 2023, month = nov, volume = {679}, eid = {A130}, pages = {A130}, doi = {10.1051/0004-6361/202346562}, archivePrefix = {arXiv}, eprint = {2310.02077}, primaryClass = {astro-ph.GA}, adsurl = {https://ui.adsabs.harvard.edu/abs/2023A&A...679A.130S}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} }

``` Citation courtesy of ADS.

Please also consider acknowledgements to the required packages in your work.

Feedback

We would love to get your feedback on astrosaber. If you should find that astrosaber does not perform as intended for your dataset or if you should come across bugs or have suggestions for improvement, please get into contact with us or open a new Issue or Pull request.

Owner

  • Name: Jonas Syed
  • Login: astrojoni89
  • Kind: user
  • Location: Heidelberg, Germany
  • Company: Max-Planck-Institut für Astronomie

Postdoctoral researcher working in the field of astronomy.

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: astrosaber
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Jonas
    family-names: Syed
    email: syed@mpia-hd.mpg.de
    affiliation: Max Planck Institute for Astronomy
    orcid: 'https://orcid.org/0000-0003-4322-8120'
repository-code: 'https://github.com/astrojoni89/astrosaber'
abstract: >-
  Self-Absorption Baseline ExtractoR developed for
  systematic baseline fitting.
keywords:
  - astronomy
  - radio-astronomy
  - atomic-hydrogen
  - self-absorption
license: BSD-3-Clause
version: 0.2.1
date-released: '2023-09-10'

GitHub Events

Total
  • Release event: 1
  • Delete event: 2
  • Push event: 33
  • Pull request event: 2
  • Create event: 1
Last Year
  • Release event: 1
  • Delete event: 2
  • Push event: 33
  • Pull request event: 2
  • Create event: 1

Dependencies

setup.py pypi
  • astropy *
  • matplotlib *
  • numpy *
  • scipy *
  • tqdm *