Skip to content

Commit

Permalink
add comments edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Oct 29, 2021
1 parent 52908ee commit 8b6851a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ If you need additional filters, you can specify them using the filters parameter
Check which filters are available on the MIST website http://waps.cfa.harvard.edu/MIST/model_grids.html
This will take some time (20-30 min) and will use some space (10-30 Gb).

If you want to put those processed isochrone files in a location different from the site-packages folder of minimint, you can use the outp_prefix parameter of `download_and_prepare`. You then will need to either specify the location each time when you construct the interpolators or with the MINIMINT_DATA_PATH environment variable

Now you can use the package. In order to create an interpolator object:
* Usage

In order to create an interpolator object:

```i = minimint.Interpolator(['DECam_g','DECam_r'])```

Expand Down
22 changes: 19 additions & 3 deletions py/minimint/bolom.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@


def read_bolom(filt, iprefix):
"""
Read the bolometric corrections files for
a given filter system.
Parameters:
-----------
filt: string
Filter system/group like UBVRIplus or WISE
iprefix: string
Location of the bc correction files
"""
fs = sorted(glob.glob('%s/*%s' % (iprefix, filt)))
if len(fs) == 0:
print('Filter system %s bolometric correction not found in %s' %
(filt, iprefix))
raise RuntimeError('err')
raise RuntimeError(
'Filter system %s bolometric correction not found in %s' %
(filt, iprefix))
tmpfile = tail_head(fs[0], 5, 10)
tab0 = atpy.Table().read(tmpfile, format='ascii.fast_commented_header')
os.unlink(tmpfile)
Expand Down Expand Up @@ -92,6 +104,10 @@ def __call__(self, p):


def list_filters(path=None):
"""
Return the list of photometric filters for which the isochrones
can be constructed
"""
if path is None:
path = get_data_path()

Expand Down
26 changes: 21 additions & 5 deletions py/minimint/mist_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ def __init__(self, prefix=None):
self.neep = D['neep']

def __call__(self, mass, logage, feh):
"""
Return the theoretical isochrone values such as logL, logg, logteff
correspoding to the mass, logage and feh
"""
feh, mass, logage = [
np.atleast_1d(np.asarray(_)) for _ in [feh, mass, logage]
]
Expand Down Expand Up @@ -288,7 +292,7 @@ def __call__(self, mass, logage, feh):
return ret

def getMaxMassMS(self, logage, feh):
"""Find approximately the maximum mass on the main sequence """
"""Find the approximate value of maximum mass on the main sequence """
N = len(self.umass) - 1
i1 = 1
i2 = N - 1
Expand All @@ -311,8 +315,20 @@ def getMaxMassMS(self, logage, feh):
return self.umass[i1]

def getMaxMass(self, logage, feh):
"""Determine the maximum mass that exists on the current isochrone
"""
"""
Determine the maximum mass that exists on the current isochrone
Parameters:
-----------
logage: float
Log10 of age
feh: float
Metallicity
Returns:
--------
maxMass: float
Maximum mass on the isochrone
"""
# The algorithm is the following
# we first go over the mass grid find the right one
# by binary search
Expand Down Expand Up @@ -447,8 +463,8 @@ def FF(curi):

def __isvalid(self, mass, logage, feh, l1feh=None, checkMaxMass=False):
"""
This checks is the point is valid
"""
Checks if the point on the isochrone is valid
"""
mass = np.float64(mass)
logage = np.float64(logage)
feh = np.float64(feh)
Expand Down

0 comments on commit 8b6851a

Please sign in to comment.