Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PARSEC/COLIBRI + MIST stellar model support #60

Merged
merged 4 commits into from
Feb 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions beast/physicsmodel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@
# 't_isochrones', 't_spectra', 't_priors', 't_seds' ]

def make_iso_table(outname, logtmin=6.0, logtmax=10.13, dlogt=0.05,
z=[0.019], trackVersion=2.3):
""" Generate a proper table directly from the PADOVA website
z=[0.0152], trackVersion=2.3, oiso=None):
"""
a spectral grid will be generated using the stellar parameters by
interpolation of the isochrones and the generation of spectra into the
physical units

Parameters
----------
Expand All @@ -71,26 +74,22 @@ def make_iso_table(outname, logtmin=6.0, logtmax=10.13, dlogt=0.05,
log-age step to request

z: float or sequence
list of metalicity values
list of metalicity values, where default (Z=0.152) is adopted Z_sun
for PARSEC/COLIBRI models

Returns
-------
outname: str
file into which save the table of isochrones (any format eztables
can handle)
"""
oiso = isochrone.PadovaWeb()
t = oiso._get_t_isochrones(max(6.0, logtmin), min(10.13, logtmax),
dlogt, z, trackVersion)
t.header['NAME'] = '{0} Isochrones'.\
format('_'.join(outname.split('_')[:-1]))

# Isochrone filtering, check that no AGB stars are removed
if trackVersion < 2.7:
cond = '~((logL > 3.) & (M_act < 1.) & (log10(M_ini / M_act) > 0.1))'
else:
cond = '~((M_ini < 12.) & (stage == 0))' # do not include Pre-MS
t = t.selectWhere('*', cond)
if oiso is None:
oiso = isochrone.PadovaWeb()
#oiso = isochrone.PadovaWeb(modeltype='parsec12s')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from Yumi's needs. It filters out PMS data points. Maybe moving that back into the PadovaWeb class as an option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this cut back into PadovaWeb, in _filter_iso_points(), but have all cuts commented out. I need to enable keyword passing (filterPMS & filterBad boolean variables) to this function so that these cuts can be optionally applied.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just document the filter function and remove the _ in front (that indicates private/don't use by convention). The important part is to tell Yumi too. It makes sense that you don't want it to be generic for all projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think filtering PMS leaves as an option is a good idea.

#oiso = isochrone.MISTWeb()

t = oiso._get_t_isochrones(max(6.0, logtmin), min(10.13, logtmax), dlogt, z)
t.header['NAME'] = '{0} Isochrones'.format('_'.join(outname.split('_')[:-1]))

t.write(outname)
return outname
Expand Down
1 change: 0 additions & 1 deletion beast/physicsmodel/prior_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,3 @@ def compute_metallicity_prior_weights(mets):
met_weights = np.full(len(mets),1.0)

return met_weights

35 changes: 35 additions & 0 deletions beast/physicsmodel/stars/ezmist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
EZMIST -- A python package that allows you to download MIST/MESA isochrones directly from their website
=======================================================================================================


This small package provides a direct interface to the MIST/MESA isochrone
webpage (http://waps.cfa.harvard.edu/MIST).
It compiles the URL needed to query the website and retrives the data into a
python variable.

This package has been tested on python 2.7 and python 3.

:version: 1
:author: MF

(this package is similar to EzPadova: https://github.com/mfouesneau/ezpadova)


EXAMPLE USAGE
-------------

* Basic example of downloading a sequence of isochrones, plotting, saving
```python
>>> r = ezmist.get_t_isochrones(6.0, 7.0, 0.05, FeH_value=0.0, theory_output='full')
>>> import pylab as plt
>>> plt.scatter(r['logT'], r['logL'], c=r['logA'], edgecolor='None')
>>> plt.show()
>>> r.write('myiso.fits')
```

Note: MIST isochrone metallicities are defined in terms of [Fe/H] (not Z)

* getting only one isochrone
```python
>>> r = ezmist.get_one_isochrones(1e7, 0.0, age_scale='linear')
```
1 change: 1 addition & 0 deletions beast/physicsmodel/stars/ezmist/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .mist import get_one_isochrone, get_t_isochrones
50 changes: 50 additions & 0 deletions beast/physicsmodel/stars/ezmist/mist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": [1.0],
"url": "http://waps.cfa.harvard.edu/MIST/interp_isos.html",
"request_url": "http://waps.cfa.harvard.edu/MIST/iso_form.php",
"download_url": "http://waps.cfa.harvard.edu/MIST/",
"query_options": ["version", "v_div_vcrit", "age_scale", "age_value", "age_range_low",
"age_range_high", "age_range_delta", "age_list", "age_type",
"FeH_value", "output_option", "theory_output", "output", "Av_value"],
"v_div_vcrit": ["vvcrit0.4", "vvcrit0.0"],
"age_scale": ["linear", "log10"],
"age_type": ["single", "range", "list", "standard"],
"age_value": "1.0",
"age_range_low": 5,
"age_range_high": 10.3,
"age_range_delta": 0.1,
"age_list": "",
"FeH_value": 0,
"output_option": ["theory", "photometry"],
"theory_output": ["basic", "full"],
"output": [
["UBVRIJHKsKp", "UBVRI + 2MASS JHKs + Kepler"],
["WashDDOuvby", "Washington + Strömgren + DDO51"],
["HST_WFC3", "HST WFC3/UVIS+IR"],
["HST_ACS_HR", "HST ACS/HRC"],
["HST_ACS_WF", "HST ACS/WFC"],
["HST_WFPC2", "HST WFPC2"],
["SDSSugriz", "SDSS"],
["CFHTugriz", "CFHT/MegaCam"],
["DECam", "DECam"],
["PanSTARRS", "PanSTARRS"],
["SkyMapper", "SkyMapper"],
["SPITZER", "Spitzer IRAC "],
["WISE", "WISE"],
["Swift", "Swift"],
["GALEX", "GALEX"],
["UKIDSS", "UKIDSS"]
],
"Av_value": 0,
"defaults": {
"version": 1.0,
"v_div_vcrit": "vvcrit0.0",
"age_scale": "log10",
"age_type": "standard",
"output_option": "theory",
"theory_output": "basic",
"output": "UBVRIJHKsKp",
"FeH_value": 0,
"Av_value": 0
}
}
Loading