timothydmorton / isochrones

Pythonic stellar model grid access; easy MCMC fitting of stellar properties
http://isochrones.readthedocs.org
MIT License
117 stars 63 forks source link

A weird peak of lots of stars gathering around G=-3 on the isochrone #126

Open kuanweih opened 4 years ago

kuanweih commented 4 years ago

Hi,

I was generating a stellar population of FeH = -2 and age = 12Gyr and I found a weird peak of lots of stars gathering on the isochrone as shown in this plot acc_cmds.pdf The orange curve is the result of this package whereas the blue one was made by interpolating manually with scipy. The gathering of stars at around G=-3 does not seem right. I also include the histogram of the stars G mag here acc_hist_g.pdf The bump at around G=-3 might be a bit suspicious that there might be a bug somewhere.

FEH = -2
AGE = np.log10(12e9)
nsample = int(1e7)

mass_sample = ChabrierPrior().sample(nsample)
tracks = get_ichrone('mist', tracks=True, bands=['V', 'G', 'BP', 'RP'])
df = tracks.generate(mass_sample, AGE, FEH, accurate=True, return_nan=True)
df = df.dropna()
segasai commented 4 years ago

@timothydmorton Trying to dig out what's going on here (I clearly see a problem in other contexts as well)

And my analysis shows that the problem occurs due to the fact that a certain mass range get assigned the EEP=808 and gets incorrect photometry

Here is the demo

from isochrones import get_ichrone
import numpy as np
FEH = -2
AGE = np.log10(12e9)

mass = np.linspace(0.7,.9,10000)
tracks = get_ichrone('mist', tracks=True, bands=['V', 'G', 'BP', 'RP'])
df = tracks.generate(mass, AGE, FEH, accurate=True, return_nan=True)

The df shows 808 (TPAGB) for a range of masses.

Further analysis (I think) shows that the problem originates from the fact that the track for .8 Msun star has 808 EEP points ~/.isochrones/mist/tracks/MIST_v1.2_feh_m2.00_afe_p0.0_vvcrit0.4_EEPS/00080M.track.eep while the next .85 Msun star has 1710 EEP points ~/.isochrones/mist/tracks/MIST_v1.2_feh_m2.00_afe_p0.0_vvcrit0.4_EEPS/00085M.track.eep

It seems that somehow leads the interpolator to set the EEP to 808-809 for masses between .8011 and .81302 for (age=12gyr and feh=-2)

I don't see how that could be correct given the evolutionary tracks. I also currently don't have enough understanding why the interpolator is incorrect there. But I'd guess the stepping in the grid size between the 808 and 1710 points must be the reason.

timothydmorton commented 4 years ago

Hmm, thanks for checking this out, folks. I see the same thing:

Screenshot 2020-05-10 22 07 31

It looks like this is exposing an edge case that I hadn't really thought about near the borders of the grid. The interpolator is only really valid when a requested point is fully within a box of other grid points. Looking at this through the lens of evaluating the EvolutionTrackModel at a range of EEPs makes the strangeness around the edge even clearer: Screencast 2020-05-10 22-23-34 There's lots of things I'm not sure about that these plots are showing (that craziness with radius as a function of EEP can't be real, right?), but it's clear that strange things happen near discontinuities in the underlying grid.