William James
12/21/2006 3:00:00 PM
F. Senault wrote:
> Le 21 décembre à 13:21, Bil Kleb a écrit :
>
> > William James wrote:
> >>
> >> What is the layout of the array? Something like this?
> >>
> >> [ [x1,y1,z1], [x2,y2,z2] ... ]
> >
> > No, not currently, but it could be made to look that way
> > with some zip action.
> >
> > Currently, each grid is in a separate hash that contains
> > variable_name => [ array of values ]
>
> Couldn't you make three hashes with the structure h["#{x}x#{y}"] = z ?
>
> After that, you get the keys of the coarse grid and fetch the datapoints
> of the others directly.
>
> If you format the x and y in the hash key, you can even order them içf
> needed...
I think you'd only need to make the hashes for the medium and for the
fine grid. Then you'd iterate through the points in the course grid,
checking to see if each point is in both of the hashes.
And the keys to the hashes could be arrays:
h[ [x,y] ] = z