<div dir="ltr"><div>Thanks, I just wanted to make sure there wasn't a downside I was missing.  I'll to this and add some tests, too.<br></div>Thanks!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, May 8, 2013 at 7:54 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Britton,<br>
<div class="im"><br>
On Tue, May 7, 2013 at 5:48 PM, Britton Smith <<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I'm working on some analysis that requires interpolating from some data<br>
> tables.  Normally, I would use the Unilinear, Bilinear, and<br>
> TrilinearFieldInterpolators in yt, but they only accept evenly spaced bins,<br>
> which I don't have.  It actually looks like the cython function which does<br>
> the calculation accepts the bins as arrays, which the python function<br>
> creates from the given bounds.<br>
<br>
</div>That's right, the Python code assumes evenly spaced bins.  Reading<br>
over the Cython, my initial thought was that it wouldn't allow for<br>
this, but it totally does:<br>
<br>
dx_inv = 1.0 / (x_bins[x_i+1] - x_bins[x_i])<br>
<br>
So yeah, I agree, it can handle it.  As long as the bins are correctly<br>
identified (which it does using digitize) it should be fine.<br>
<div class="im"><br>
><br>
> I'd like to change this behavior to allow me to give the bins to the python<br>
> function.  Currently, the call to create the interpolator looks like this:<br>
> BilinearInterpolator(table, boundaries, field_names)<br>
><br>
> where boundaries is (x_0, x_n, y_0, y_n) or the min/max of the x and y bins.<br>
> Would it be ok if I changed this so that boundaries can also be a pair of<br>
> arrays?  I would just have the function check and still maintain the old way<br>
> as well.  By doing it this way, it shouldn't break backward compatibility<br>
> either.  Would this be an ok solution?<br>
<br>
</div>Yup, this would be nice -- thanks.  Can you update the tests to<br>
reflect this, too?  The interpolators are tested somewhat extensively<br>
with random values.<br>
<br>
-Matt<br>
<br>
><br>
> Britton<br>
><br>
> _______________________________________________<br>
> yt-dev mailing list<br>
> <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</blockquote></div><br></div>