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
- Conle the repository by
git clone git@github.com:kuochuanpan/mesa-mag.git
cdto the package path and install the package by
pip install .
-
Download the necessary filters (ascii format) from the SVO filter website
-
Put the filter data under
./mesa_mag/filters/
- 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()- 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)
- 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)- 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()- Please cite Pan, Ricker, & Taam (2014) and Chen, Rau, & Pan (2023).