timothydmorton / isochrones

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

Explore tri-cubic interpolation #7

Closed timothydmorton closed 8 years ago

timothydmorton commented 9 years ago

Would be great to be able to implement tri-cubic interpolation if it could be of comparable efficiency as the current NDLinearInterpolator implementation.

Maybe adapting this?

syrte commented 8 years ago

Do you know what kind of interpolation do padova's web calculator use? nd-linear interpolation?


update I've checked with Padova group, they just use linear interpolation in web calculator.

syrte commented 8 years ago

I wonder if it is possible pickle the returned interpolating function to disk? We do interpolation at the first call of the star model, then save the interpolation function to disk. If possible, the slow speed would be also acceptable, as it is once for all.

Here is a post about how to pickle function.


update My discussion above is totally wrong. The problem is not generating the function. It just needs long time to calculating interpolation.

syrte commented 8 years ago

A question for discussion.

We use delaunay to do linear interpolation here, this don't require the input data to be grids. However, if we want cubic interpolation, the input data must be grid-like, right?

So you have to also change the data format if tri-cubic interpolation wanted.

timothydmorton commented 8 years ago

That's a good point-- unfortunately the nature of the available stellar models is that it won't be possible to make the data grid-like. So it's not clear to me that cubic interpolation will actually be worthwhile to pursue after all. I'll go ahead and close this issue.

syrte commented 8 years ago

It's possible to convert the available stellar models to grids. We can just do interpolation to get the values at each parameter grid to prepare the grid-like data for later interpolation.

However, if the first interpolation is linear, that would make later cubic interpolation non-sense. (And this is what we meet when using data download from padova cmd website. ) So, we can use distance weighted interpolation or something like kriging method to convert the non-grid data to grid data.

This might be quite slow, anyway it's once for all.