Astero-sdB is the library containing the set of tools for asteroseismology of sdB stars using the grid of evolutionary MESA models and pulsation GYRE models calculated for the ARDASTELLA research group.
The package consists of five modules:
The module allows to read the processed grid and store it as the SdbGrid
class. The structure provides methods to extract and read evolutionary
and pulsation models.
The module contains the Star
class, which includes observational properties
of a target star. The class contains methods for fitting a star to the grid.
The tool for reading output of the GYRE pulsation code and store it in the
GyreData
class. The module is useful for any GYRE models and its application
is not limited to the sdB grid.
Various stand-alone utility functions.
The most common plots useful during fitting target stars to the grid of models. Not recommended for publication, but excellent for quick analysis of the results.
First, install the mesa_reader, which is not available in PyPi:
pip install git https://github.com/wmwolf/py_mesa_reader.git
Then, Astero-sdB can be installed using pip:
pip install git https://github.com/cespenar/astero_sdb.git
Unfortunately, the package cannot be currently uploaded to PyPI, because one of its dependencies, mesa-reader, is not yet been available on PyPi. Installing from GitHub using pip is not supported during uploading a package to PyPi or during the installation of requirements, hence the more cumbersome installation is currently required.
Astero-sdB requires Python 3.10.
from pathlib import Path
from astero_sdb.sdb_grid_reader import SdbGrid
database = Path('/Users/cespenar/sdb/sdb_grid_cpm.db')
grid_dir = Path('/Volumes/T3_2TB/sdb/grid_sdb')
g = SdbGrid(database, grid_dir)
where database
is a SQLite database containing the processed grid,
grid_dir
the directory containing compressed models, and g
is the read grid
as an SdbGrid
object.
A basic example how to find the best fit for a target star on a constrained grid:
import pandas as pd
from pathlib import Path
from astero_sdb.sdb_grid_reader import SdbGrid
from astero_sdb.star import Star
pd.options.mode.chained_assignment = None
target = Star(name='test_star',
t_eff=25790.0, t_eff_err_p=160.0, t_eff_err_m=160.0,
log_g=5.43, log_g_err_p=0.01, log_g_err_m=0.01,
frequencies_list='test_star_frequencies.txt')
database = Path('/Users/cespenar/sdb/sdb_grid_cpm.db')
grid_dir = Path('/Volumes/T3_2TB/sdb/grid_sdb')
g = SdbGrid(database, grid_dir)
conditions = \
(g.data.m_i <= 2.0) & \
(g.data.m_env <= 0.01) & \
(g.data.z_i <= 0.035)
df = g.data[conditions]
target.evaluate_chi2(df_selected=df,
grid=g,
dest_dir=grid_dir,
use_spectroscopy=True,
save_period_list=True,
period_list_name=f'{target.name}_periods.txt',
results_file_name=f'{target.name}_results.txt')
where target
contains the properties of the target star as a Star object,
database
is a SQLite database containing the processed grid,
grid_dir
the directory containing compressed models, g
is the read grid
as an SdbGrid
object, and conditions
are sample constraints imposed on the
grid.
The author was financially supported by the Polish National Science Centre grant UMO-2017/26/E/ST9/00703. The grid of models was calculated using the resources provided by Wrocław Centre for Networking and Supercomputing, grant No. 265.