GithubHelp home page GithubHelp logo

mihirtripathi97 / slam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jinshisai/slam

0.0 0.0 0.0 167.2 MB

Spectral Line Analysis/Modeling

License: GNU General Public License v3.0

Python 100.00%

slam's Introduction

Documentation Status

SLAM: Spectral Line Analysis/Modeling

SLAM (Spectral Line Analysis/Modeling) is a python library to analyze/model spectral line data especially obtained with radio telescopes. The current main package, pvanalysis, is to derive the rotational velocity as a function of radius and fit the profile with a power-law function. The detail of the method is presented in Aso et al. 2015, Sai et al. 2020 and the reference therein. More analysis tools will be coming in future.

Demo and Usage

The file example.py will help to find how to use pvanalysis.

git clone https://github.com/jinshisai/SLAM
cd SLAM
python example.py

To keep the package updated, type the command below in the directory SLAM, always before you use.

git pull

Also, setting the path in .bashrc (or .zshrc etc.) will be useful.

export PYTHONPATH=${PYTHONPATH}:/YOUR_PATH_TO/SLAM

Features

pvanalysis can do the following things.

  • Get edge and ridge points in the directions of positional and velocity axes from a FITS file of a position-velocity diagram.
  • Write out the derived points in text files.
  • Fit the derived points with the Keplerian, single power-law, or double power-law functions, using the MCMC method (emcee).
  • Systemic velocity Vsys can also be a free parameter.
  • Get the central stellar mass calculated from the best-fit functions, in addition to the fitting parameters.
  • Plot the derived points and best-fit functions on the position-velocity diagram in the linear or logR-logV planes.

Requirement

  • astropy
  • copy
  • corner
  • emcee
  • dynesty
  • math
  • matplotlib
  • mpl_toolkits
  • numpy
  • scipy

Installation

Download from https://github.com/jinshisai/SLAM or git clone.

git clone https://github.com/jinshisai/SLAM

Note

  • Edge/ridge x is derived by xcut in dv steps. Edge/ridge v is derived by vcut in bmaj / 2 steps.
  • The derived points are removed (1) before the maximum value, (2) in the opposite quadrant, and (3) before the cross of xcut and vcut results. These removing operations can be switched on/off by nanbeforemax, nanopposite, and nanbeforecross, respectively, in get_edgeridge. Default is True for all the three.
  • Each 1D profile of xcut and vcut are also provided as outname_pvfit_xcut.pdf and outname_pvfit_vcut.pdf.
  • In outname.edge.dat and outname.ridge.dat files, xcut results have dv=0, and vcut results have dx=0.
  • The double power-law fitting, fit_edgeridge, uses chi2 = ((x - Xmodel(v)) / dx)^2 + ((v - Vmodel(x)) / dv)^2. Vmodel = sgn(x) Vb (|x|/Rb)^-p, where p=pin for |x| < Rb and p=pin+dp for |x| > Rb. Xmodel(v) is the inverse function of Vmodel(x).
  • dx and dv are the fitting undertainty for 'gaussian' ridge, the uncertainty propagated from the image noise for 'mean' ridge, and the image noise divided by the emission gradient for edge.
  • Min, Mout, and Mb are stellar masses calculated from the best-fit model at the innermost, outermost, and Rb radii, respectively. When p is not 0.5, these masses are just for reference.

Authors

  • Jinshi Sai
    • Affiliation: Academia Sinica Institute of Astronomy and Astrophysics
    • E-mail: [email protected]
  • Yusuke Aso

License

"SLAM" is under GNU General Public License Version 3.

slam's People

Contributors

yusukeaso-astron avatar jinshisai avatar

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.