JunesDiary / magstar

A GUI based Least Square Deconvolution and Mean Longitudinal Magnetic Field Analysis Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Magstar

Description

A GUI based Least Square Deconvolution and Mean Longitudinal Magnetic Field Analysis Tool. The LSD process is done using LSDpy code from folsomcp and magnetic field determination with the help of package specpolflow. It has the following functionality:

1. Convertion of VALD line file downloaded from VALD3 in short format, to LSDpy supported input Mask format.
2. Computation of LSD profiles and viewing the profiles, for a single file or multiple files.
3. Finding the Mean Longitudinal Magnetic Field (Bz) for the LSD profiles computed.
4. Mask file functionalities like: Calculating number of lines flagged in the Mask file, Setting all flags to zero in the mask file.

Work on the following features are ongoing:

1. Display the Bz variability with phase of star.
2. Automatic flagging of mask file with te help of spectral file and vald line file.

Requirements

Following packages are required:

1. Tkinter
2. Mendeleev
3. re
4. pandas
5. os
6. shutil
7. time
8. subprocess
9. PIL
10. sys
11. astropy

Setup

Download the code above, extract it and rename the folder magstar_main to 'LSDpy'. Also download specpolflow from here: Specpolflow To run the GUI, open terminal and go to the folder you just downloaded and renamed and type:

python3 magstar.py

Operations:

For finding LSD Profile

  1. Select the Spectra files using the 'Choose Spectra' button. You can select many files or a single one too. You will get the message in the result box as: 'n Spectra Files Choosen', where n is the nu,ber of files you chose.
  2. If you have downloaded the VALD line file, choose the VALD line file by pressing 'Choose VALD File' and then convert it into lsdpy supported mask file by pressing 'Convert VALD to MASK'. Then you need to flag the lines you need in your lsd computation. If you have MASK file with lines flagged already, you can skip this step. Format of VALD File supported is short format with Radiative damping constant, Stark damping constant, Van der Waals damping constant, Landé factor choosen as options.
  3. Then choose the Mask file you wish to use by clicking button 'Choose Mask File'.
  4. Click 'Compute LSD Profile(s)' button. And it will store the LSD Profile text file(s) in the working directory, in the dataout folder. It will also store the lsd profile plots generated in the folder lsd_images. You can view the plots generated by pressing the button: 'Display generated LSD profile plots'.

Finding Mean Longitudinal Magnetic Field

If you have not used thr LSD profile computation from the GUI and wish to use your own profiles as text files, then transfer those files to the LSDpy/dataout folder and proceed as said below.

  1. Setup the specpolflow package by clicking and choosing the directory which contains specpolflow folder. Like if the specpolflow is as usr/folders/specpolflow, on selecting the path, the result folder must display: 'Specpolflow set up from: usr/folders'. This will setup your specpolflow package.
  2. For magnetic field computation, press the 'Compute Bz using Specpolflow' button and your Bz values will be displayed in the results window.

Using Other Functionalities

  1. Flagges Lines Counter: It requires first choosing the mask file by pressing 'Choose Mask File'. Pressing this button displays the follwing: Lines Flagged: {number of lines flagged} == Total Lines: {total lines} == Lines Used: {lines_flagged/total_lines * 100}
  2. Set Zero in MASK: It requires first choosing the mask file by pressing 'Choose Mask File'. Pressing this button causes the Mask file in the LSDpy folder (if any) be deleted, and saving the choosen mask file with zero flags.

About

A GUI based Least Square Deconvolution and Mean Longitudinal Magnetic Field Analysis Tool

License:MIT License


Languages

Language:Python 100.0%