From: Bernard K. <ber...@be...> - 2005-07-25 14:44:50
|
Dear Antonio, In hdf5 you can define progressively a selected region (adding elements=20 one by one) by use of either "H5Sselect=5Felements" with H5S=5FSELECT=5FAPP= END=20 or "H5Sselect=5Fhyperslab" with H5S=5FSELECT=5FOR. Then you can read or wri= te=20 the selected elements at once with "H5Dread" or "H5Dwrite". Is there a function in pytables that use this functionality ? How would=20 you do to extract a submatrix in pytables ? Bernard|| Antonio Valentino wrote: >Alle 11:36, luned=EC 25 luglio 2005, Bernard KAPLAN ha scritto: > =20 > >>Dear all, >> =20 >> > >hi Bernard > >[...] > > =20 > >>x=3Darray([1,2,5,8]) # row index >>y=3Darray([0,3,7]) # column index >>a=3Ddata[x,y] # returns an array of size [4,3], 'data' is a pytables 2-d >>array >>data[x,y]=3D0 # set the submatrix defined by x rows and y columns to 0 >>data[x,y]=3Drand([4,3]) # update of a submatrix >>data[x,y]=3Ddata2[x,y] # copy of a submatrix from one array into another >> =20 >> > >I think that what you are asking for can't be done in an "elegant" way. >HDF5 supports hyperslabs selection that is powerfull and elegant but it=20 >requires reqular spacing in the selection, see=20 > >http://hdf.ncsa.uiuc.edu/HDF5/doc/RM=5FH5S.html#Dataspace-SelectHyperslab > >In order to use hyperslabs you have to be able to express the sub-matrix=20 >selection in terms of "start, stride, count, and block". >It seems to me that it is not your case. > > =20 > >>Sincerely, >> >>Bernard KAPLAN >> >> >> >>------------------------------------------------------- >>SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >>from IBM. Find simple to follow Roadmaps, straightforward articles, >>informative Webcasts and more! Get everything you need to get up to >>speed, fast. http://ads.osdn.com/?ad=5Fid=3D7477&alloc=5Fid=3D16492&op=3D= click >>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F >>Pytables-users mailing list >>Pyt...@li... >>https://lists.sourceforge.net/lists/listinfo/pytables-users >> =20 >> > >ciao > > =20 > |