Wow, thanks a million, this worked just fine and I think I understood at least parts of the method :)
Cheers Thomas * On Tue, 2010-10-19 at 14:20 +0200, Nadav Horesh wrote: > Of course there is an (at least one) error: * > the line should be: > > XYZ = > np.mgrid[lwrbnd[0]:uprbnd[0]:shape[0]*1j,lwrbnd[1]:uprbnd[1]:shape[1]*1j, > lwrbnd[2]:uprbnd[2]:shape[2]*1j] > On Tue, 2010-10-19 at 14:10 +0200, Nadav Horesh wrote: > >* You can aid mgrid, riughy as the follows (I may have mistakes, but the*> > >>* direction should be clear):*> >* *> >* def > >transform_3d_data_(field,lwrbnd,uprbnd): *> >* shape = field.shape *> >* > >XYZ = np.mgrid[lwrbnd[0]:uprbnd[0]:shape[0],*> >* > >lwrbnd[1]:uprbnd[1]:shape[1], lwrbnd[2]:uprbnd[2]:shape[2]] *>* ** > ** vectors = fields.reshape(-1,3) * > >* np.savetxt(np.hstack((XYZ.reshape(3,-1).T, vectors)))*> >* *> >* *> >* > >Nadav *
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
