WHATS NEW IN VERSION:
0.0.5: Minor bug fixes. Related to the use of the code as a python module.
Now also handles scalar input that is outside grid range.
For scalar input, output is also scalar.
0.0.4: To be able to handle `out of grid range' input values; the default
here is to use nearest grid point.
Now program works for input files with only one line (star).
Added function get_mass_radius() .
When run in script mode, the text output files now include radius along with mass.
Now [Fe/H] is allowed as input instead of Log(Z) in text input file.
A flag 'isfeh', which can be True or False, is introduced in the functions get_mass_radius()
and get_dnu_numax().
Finer grid spacing in age during the He core burning phase.
0.0.3:
Changes in the following files: asfgid.py and interp_grid2.ebf.
Version 0.0.1 had a bug in line 165 of asfgrid.py, which could result in wrong answers.
Also, the file interp_grid2.ebf, was of lower resolution than
required to get reliable answers.
DESCRIPTION:
asfgrid 0.0.5: computes (1) corrected delta_nu to be used in delta_nu scaling relation,
(2) correction factor f_delta_nu for delta_nu scaling
relation (see Eq 5 in Sharma et al. 2016, ApJ,822,15),
(3) mass and radius using delta_nu correction,
by interpolation over a grid.
Copyright (c) 2015 Sanjib Sharma, Dennis Stello
License: AGPL see
The interpolation grid covers all combinations of the following values of log(Z) and mass
logz=[-4.7212464 , -3.7212464 , -3.12124848, -2.92124602, -2.7212464,
-2.52124598, -2.32124678, -2.12124618, -1.92124602, -1.7212464,
-1.52124598, -1.42124622, -1.32124678]
mass=[ 0.80, 0.82, 0.84, 0.86, 0.88, 0.90, 0.92, 0.94, 0.96,
0.98, 1.00, 1.10, 1.20, 1.40, 1.60, 1.80, 2.00, 3.00, 4.0]
INSTALLATION:
1) requirements: scipy__version__ >= 0.14.0
2) Data files should be in current directory of the installed code.
If you want to put the data files that come with the program in a
different directory than where the code is installed, you need to
set the appropriate datadir path by editing line 150, which is currently
self.datadir=''
3) You will need the python ebf module to read the grid interpolation files.
These can be installed by
For non root do:
pip install ebfpy --user
For root do:
sudo pip install ebfpy
If required see http://ebfformat.sourceforge.net/
for further details on installation of ebf.
RUNNING THE CODE:
asfgrid.py is the main code. It can be run as (1) a script or as (2) a python module.
(1) ----> For script mode <-------------
To run make sure it is executable by e.g.
chmod 755 asfgrid.py
The input and output is via ascii files
Check usage with
./asfgrid.py -help
USAGE:
asfgrid.py inputfile
DESCRIPTION:
Output file name is constructed from filename with suffix .out
Input file should be ascii as follows
evstate logz teff dnu numax
1 -1.97 4659.8 8.81 92.36
1 -1.98 4903.2 13.1 157.3
First line must contain column names
Column names can be in any order but need to follow names given below
OPTIONS:
Possible input/outputs are
1) (evstate, logz, teff, dnu, numax) ->(mass,radius)
2) (evstate, logz, teff, mass, logg) ->(dnu,numax,fdnu)
3) (evstate, logz, teff, mass, logg, mini)->(dnu,numax,fdnu)
4) (evstate, feh, teff, dnu, numax) ->(mass,radius)
5) (evstate, feh, teff, mass, logg) ->(dnu,numax,fdnu)
6) (evstate, feh, teff, mass, logg, mini) ->(dnu,numax,fdnu)
(1) and (4) are typically used to go from observations to
resulting mass and radius.
The rest are typically used to go from any stellar model to
predicted dnu (corrected), numax and correction factor.
If your input is from a model that includes mass loss, where
mass For module mode <------------
python or ipython to start python. Then
>>> import asfgrid
>>> help(asfgrid)
Run example:
>>> import asfgrid
>>> evstate=[1,1]
>>> logz=[-1.97,-1.98]
>>> teff=[4659.8,4903.2]
>>> dnu=[8.81,13.1]
>>> numax=[92.36,157.3]
>>> s=asfgrid.Seism()
>>> mass,radius=s.get_mass_radius(evstate,logz,teff,dnu,numax)
>>> print mass,radius
>>> logg=s.mr2logg(mass,radius)
>>> dnu,numax,fdnu=s.get_dnu_numax(evstate,logz,teff,mass,mass,logg)
>>> print dnu,numax
DATA FILES:
dnu_grid_evstate.txt Raw stellar grid (MESA) in ascii (not used by asfgrid)
dnu_grid_evstate.ebf Raw stellar grid in ebf format (not used by asfgrid)
Column description:
evstate: Evolution state (in this file evstate has more states then used in the code)
-1=PreZAMS
0=MS
1=Subgiant+RGB
2=Stable HeCoreBurn
3=AGB
-2=between 1 and 2
mass Stellar mass (M_Sun). Since the grid has no mass loss this is the same as mini
z Metallicity
lum Luminosity (L_Sun)
teff Effecive temperature (K)
sradius Stellar radius (R_Sun)
age Age (Gyr)
model Consecutive model number
numax Numax (micro Hz) from the scaling relation using mass, radius,
teff assuming numax_Sun=3090 micro Hz
dnu_int Delta_nu (micro Hz) from sound-speed integral
dnu_sc Delta_nu (micro Hz) from the scaling relation using mass, radius,
teff assuming numax_Sun=135.1 micro Hz
dnu_frq Delta_nu (micro Hz) from fit to radial mode frequencies
dp Period spacing (s) from buoyancy integral.
central_he4 Central fraction of He4
logg Log of gravity
grid_interp1.ebf Stellar grid in format for asfgrid to interpolate in (evstate, logz, teff, mass, logg_teff)
grid_interp2.ebf Stellar grid in format for asfgrid to interpolate in (evstate, logz, teff, mass_nu, logg_teff)
Column description:
As above plus:
logg_teff A function of logg and log(teff), which is almost monotonic with age.
For logg<<4.2, logg_teff ~ log(teff).
mass_nu Mass computed from dnu-scaling relation using logg, dnu and teff