Skip to content

Commit

Permalink
calc_feh method might be used with custom solar chemical composition.
Browse files Browse the repository at this point in the history
  • Loading branch information
cespenar committed Jul 13, 2022
1 parent 90fa6bf commit 5a14ae8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion astero_sdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.3'
__version__ = '0.1.4'
25 changes: 16 additions & 9 deletions astero_sdb/star.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,26 +621,34 @@ def periods_range(self,
return p_min, p_max

@staticmethod
def calc_feh(z: float) -> float:
def calc_feh(z: float,
solar_h1: float = 0.7154,
solar_h2: float = 1.43e-5,
solar_he3: float = 4.49e-5,
solar_he4: float = 0.2702551) -> float:
"""Calculates [Fe/H] from metallicity.
Assumes solar chemical composition from Asplund et al. (2009).
By default, assumes solar chemical composition from
Asplund et al. (2009).
Parameters
----------
z : float
Metallicity.
solar_h1 : float, optional
Solar H1 abundance. Default: 0.7154.
solar_h2 : float, optional
Solar deuterium abundance. Default: 1.43e-5.
solar_he3 : float, optional
Solar He3 abundance. Default: 4.49e-5.
solar_he4 : float, optional
Solar He4 abundance. Default: 0.2702551.
Returns
----------
float
Calculated [Fe/H].
"""

solar_h1 = 0.7154
solar_h2 = 1.43e-5
solar_he3 = 4.49e-5
solar_he4 = 0.2702551

solar_x = solar_h1 + solar_h2
solar_y = solar_he3 + solar_he4
solar_z = 1.0 - solar_x - solar_y
Expand All @@ -651,8 +659,7 @@ def calc_feh(z: float) -> float:
def chi2_single(x_model: np.array,
x_obs: float,
sigma: float) -> np.ndarray:
"""Calculates a single component of chi^2
function.
"""Calculates a single component of chi^2 function.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'astero_sdb'
version = '0.1.3'
version = '0.1.4'
description = 'Tools for asteroseismology of sdB stars using MESA and GYRE models'
readme = 'README.md'
authors = [{ name = 'Jakub Ostrowski', email = '[email protected]' }]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='astero_sdb',
version='0.1.3',
version='0.1.4',
description='Tools for asteroseismology of sdB stars using MESA and GYRE models.',
url='https://github.com/cespenar/astero_sdb',
author='Jakub Ostrowski',
Expand Down

0 comments on commit 5a14ae8

Please sign in to comment.