Giter Site home page Giter Site logo

javiserna / vsini Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 246 KB

Friendly user interface to estimate vsini, using high resolution spectra, based on Fourier's method.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
fourier-analysis spectral-lines spectroscopy stellar-rotation astronomy

vsini's Introduction

Vsini by Fourier's Method

© Javier Serna, Jesús Hernández and ARYSO group.

Hits

Please cite: DOI:10.3847/1538-4357/AC300A

This is a semi-automatic tool designed to estimate the rotational velocity (vsini), using spectral lines of high-resolution spectra. The code was developed in Python 3.7 and the GUI in Qt 5.

Overview.

TO DO

  • Add a new column with the relative error into Fourier.out
  • Pop-up notifying error in line fitting. Suggest choosing another line or report as a non-detection line.

Features!

  • Gaussian Fitting is done for the spectral line of interest (Automatic selection of the center and width of the line).

  • Automatic saving at the event file "Fourier.out". The output file contains (1) The name of the input file, (2) date, (3) time, (4) line mid-wave, (5) line width, (6) Spectral resolution, (7) Limb-Darkening coefficient, (8) vsini in km/s, (9) vsini uncertainty in km/s.

  • Plot the histogram of vsini measures.

Requirements and Dependencies

This tool is compatible with Python>2.7 on Linux, Mac, and Windows. Some packages are necessary for their proper operation.

  • git
  • Pandas
  • Matplotlib.
  • Tk
  • Scipy
  • PyQt5
  • LMFIT

In case of not having any dependency, we suggest to install it in this way:

$ sudo apt install git
$ sudo apt install python-pandas
$ sudo apt install python-matplotlib
$ sudo apt install python-tk
$ sudo apt install python-scipy
$ sudo apt install python-pyqt5
$ sudo apt install python-lmfit

If you have an environment for Python> 2.7 (e.g., anaconda). The installation could be done in this way:

~(env)$ pip install pandas
~(env)$ pip install matplotlib
~(env)$ pip install tk
~(env)$ pip install scipy
~(env)$ pip install pyqt5
~(env)$ pip install lmfit

How to use it?

First of all, we are going to create a folder where we will download the package:

$ mkdir Fourier
$ cd Fourier
$ git clone https://github.com/javiserna/vsini
$ cd vsini

and Execute:

$ python vsini.py

The graphical interface of the program will appear

Interfaz Gráfica

By default, the spectral resolution (R=22500) and limb darkening coefficient (0.6). These can be changed as the user requires.

Step 1

Please press the "Load" button to get the spectra. CSV format for the input file is required, two columns of information, "col1": Wavelength and "col2": Flux. (e.g., load our test spectra "spec_to_test.csv").

Step 2 (Spectral Line Selection)

Press the "Plot Spectrum" button to plot the input spectra.

Use the “o” key and left-click to zoom in on the line of interest, or press the "zoom to rectangle" icon.

On each side of the line, press double click (A double click displays a vertical red line). When it is done, the program performs a Gaussian fit to the spectra within the defined window. It computes the midwave of the line and width as 3 sigma level. These parameters are updated to the text boxes "Line Center" and "Line Width" in the main window, once the user presses the "q" key.

Step 3

Once the spectral line is selected, a visual inspection is necessary to check any issue (e.g., mixed lines, bad normalization, bad pixels, telluric lines, etc.). Press the "Plot Line" button, to plot the spectral line that will be used to measure vsini.

Once it is certain that the line does not present any problem. Let's continue to the next step (look at recommendations).

Last Step

By pressing the "Run" button, vsini estimation is made. In the end, the tool plots a histogram with all random estimations of vsini. by pressing the "q" key, vsini and their uncertainty are loaded at the main window. Finally, all the information is saved in the event file "Fourier.out".

Checking the Final Results

Once we have finished our measurements, then close the window and execute:

$ python results.py

This script will organize the historical measurements located in the file "Fourier.out" For the set of spectra imported and the set of lines processed by the user. Finally, the user will have a file called "results.csv" with the spectra name, vsini, and vsini uncertainty.


© Instituto de Astronomía / UNAM (Ensenada, B.C, Mexico)

15 September 2020

vsini's People

Contributors

javiserna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.