Re: [Numpy-discussion] Grid indexing

2011-02-28 Thread Davide
I had a similar problem some time ago, which i solved by building my own class containing an n-d array and an n-d interpolator. Then i overrided the __getitem__ special method so that i could use a fancy notation like the one you want. Inside the method i used n-d dimensional interpolation of the

Re: [Numpy-discussion] Grid indexing

2011-02-28 Thread Wolfgang Kerzendorf
I think it is possible to construct a class that takes as init function index converter functions and stores an array. That do for example linear mappings from the floats to the int. I am wondering if the numpy community would be interested in such a thing? I think the code would be very short,

Re: [Numpy-discussion] Grid indexing

2011-02-28 Thread Ian Stokes-Rees
On 2/26/11 3:36 AM, Wolfgang Kerzendorf wrote: > I have a n dimensional grid. The grids axes are linear but not > intergers. Let's say I want the value in gridcell [3.2,-5.6,0.01]. Is > there an easy way to transform the index? Do I have to write my own > class to accomplish this. Is there an

[Numpy-discussion] Grid indexing

2011-02-26 Thread Wolfgang Kerzendorf
Hello, I have a n dimensional grid. The grids axes are linear but not intergers. Let's say I want the value in gridcell [3.2,-5.6,0.01]. Is there an easy way to transform the index? Do I have to write my own class to accomplish this. Is there an easy way in numpy to accomplish this. Can I give