Skip to content

kuochuanpan/mesa-mag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mesa-mag

Compute the absolute magnitude for a given filter from MESA' history file. We assume using the AB magnitude system and no extincition.

Copyright: Kuo-Chuan Pan, Hsin-Pei Chen, and Shiau-Jie Rau

Installation

Install the package

  1. Conle the repository by
git clone git@github.com:kuochuanpan/mesa-mag.git
  1. cd to the package path and install the package by
pip install .

Download filters

  1. Download the necessary filters (ascii format) from the SVO filter website

  2. Put the filter data under ./mesa_mag/filters/

Quick start

  1. Get the absolute magnitudes
import mesa_mag
import matplotlib.pyplot as plt

path   = 'mesa_job_path'
filter = 'HST_ACS_HRC.F555W.dat'
age, mag = mesa_mag.get_absolute_magnitude(path, filter)

plt.plot(age, mag)
plt.xlabel('Age [yr]')
plt.ylabel('Absolute Magnitude')
plt.xscale('log')
plt.show()
  1. Get the absolute magnitudes (without MESA)
# logL, logR, logT are solar units
age, abs_mag = mesa_mag.get_absolute_magnitude_from_raw(age, logL, logR, logT, filter_name)
  1. Get the apparent magnitude
import mesa_mag
import matplotlib.pyplot as plt

path   = 'mesa_job_path'
filter = 'HST_ACS_HRC.F555W.dat'
distance = 10 # pc
A = 0         # mag

age, app_mag = mesa_mag.get_apparent_magnitude(distance, 
                                                path, 
                                                filter,
                                                extinction=A)
  1. Get the filter information
import mesa_mag
import matplotlib.pyplot as plt

filter_name = 'HST_ACS_HRC.F555W.dat'
data = mesa_mag.load_filter(filter_name)

plt.plot(data[0],data[1])
plt.xlabel('Wavelength [nm]')
plt.ylabel('Transmission')
plt.show()

References

About

Compute the absolute magnitude for a given filter from MESA' history file.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages