From: <phi...@ho...> - 2005-09-02 15:28:32
|
Hi Francesc and all others pytables users/developpers, I have structured data: atmospheric pressure which depends from latitute, longitude and time. The problem is i can't use pytables Table due to the application capabilities involved to manage the file. The unique solution i have is to store each data in an array (pressure is a multidimensionnal array, time is an array, longitude is an array and latitude is an array). Then i have to use a specific attributes to retrieve the right assiocation between parameters and pressure. 1. Is there a possibility to put a multidimensionnal attributes, which can consist in the list containing the path of the parameters ([/longitude,/latitute,/time]) ? So i know the first dimension of the pressure array is the longitude, the second the latitude, the third the time and the last one the values of the pressure. I know there were a discussion and a patch about this but i don't know how to use it. 2. Would it be out of context to think about a standard way to link inside pytables, the dimension of a multidimensionnal array to the array defining the parameters values comparably to Netcdf ? Thanks a lot for your answers, regards, Philippe Collet |
From: Francesc A. <fa...@ca...> - 2005-09-05 08:53:38
|
El dv 02 de 09 del 2005 a les 17:28 +0200, en/na phi...@ho... va escriure: > Hi Francesc and all others pytables users/developpers, >=20 > I have structured data: atmospheric pressure which depends from=20 > latitute, longitude and time. > The problem is i can't use pytables Table due to the application=20 > capabilities involved to manage the file. Uh, you mean limitations specific of pytables or other kind of limitations? >=20 > The unique solution i have is to store each data in an array (pressure=20 > is a multidimensionnal array, time is an array, longitude is an array=20 > and latitude is an array). >=20 > Then i have to use a specific attributes to retrieve the right=20 > assiocation between parameters and pressure. >=20 > 1. Is there a possibility to put a multidimensionnal attributes, which=20 > can consist in the list containing the path of the parameters=20 > ([/longitude,/latitute,/time]) ? > So i know the first dimension of the pressure array is the longitude,=20 > the second the latitude, the third the time and the last one the values=20 > of the pressure. I don't know exactly what you are trying to do, but, in general, you can save any kind of python object as an attribute. However, if this object has not a direct mapping with a multimensional (or scalar) atomic (i.e. byte, char, int or float) HDF5 type, then it's pickled. > 2. Would it be out of context to think about a standard way to link=20 > inside pytables, the dimension of a multidimensionnal array to the array=20 > defining the parameters values comparably to Netcdf ? Can you be a bit more explicit on what you want exactly? Cheers, --=20 >0,0< Francesc Altet http://www.carabos.com/ V V C=E1rabos Coop. V. Enjoy Data "-" |
From: <phi...@ho...> - 2005-09-06 14:08:49
|
Francesc Altet wrote: >El dv 02 de 09 del 2005 a les 17:28 +0200, en/na >phi...@ho... va escriure: > > >>Hi Francesc and all others pytables users/developpers, >> >>I have structured data: atmospheric pressure which depends from >>latitute, longitude and time. >>The problem is i can't use pytables Table due to the application >>capabilities involved to manage the file. >> >> > >Uh, you mean limitations specific of pytables or other kind of >limitations? > > > Sorry that doesn't seem clear. No limitations of pytables. It's much more that i'm not allowed to use table. Arrays are more appreciated to achieve my goal . >>The unique solution i have is to store each data in an array (pressure >>is a multidimensionnal array, time is an array, longitude is an array >>and latitude is an array). >> >>Then i have to use a specific attributes to retrieve the right >>assiocation between parameters and pressure. >> >>1. Is there a possibility to put a multidimensionnal attributes, which >>can consist in the list containing the path of the parameters >>([/longitude,/latitute,/time]) ? >>So i know the first dimension of the pressure array is the longitude, >>the second the latitude, the third the time and the last one the values >>of the pressure. >> >> > >I don't know exactly what you are trying to do, but, in general, you can >save any kind of python object as an attribute. However, if this object >has not a direct mapping with a multimensional (or scalar) atomic (i.e. >byte, char, int or float) HDF5 type, then it's pickled. > > That could be a good starting point. I only need an ordered list containing path of each array of system parameters. For example, the attribute could be ['/parameters/longitude','/parameters/latitude','/parameters/time'] > > >>2. Would it be out of context to think about a standard way to link >>inside pytables, the dimension of a multidimensionnal array to the array >>defining the parameters values comparably to Netcdf ? >> >> > >Can you be a bit more explicit on what you want exactly? > > In fact, i'm joining Norbert Nemec in his post from 2005-01-24 11:51 to request a convention in pytables to store not only data but also a way to link the data. Here is thye situation, better represented: Longitude [0.1 0.2 0.3 0.4] Latitude [0.25 0.35 0.45 0.55] latitude ^ Pressure : [[1, 1.25 , 1.78 , 1.4], | (0.25) [3.1 , 2.4 , 1.89 , 8.2], | (0.35) [4.5 , 7.9 , 4.63 , 1], | (0.45) [1.2 , 3.7 , 4.26 , 6]] | (0.55) | longitude < --------------------------------- (0.1) (0.2) (0.3) (0.4) If i am able to know that pressure atmospheric data are store depending first from the latitude then the longitude, i can easily get the pressure given a longitude and a latitude. For example : i need the pressure for longitude 0.2 and latitude 0.45. Then pressure is 7.9. I need to build this thing with pytables. Longitude is an array of shape (4L,), latitude is an array of shape (4L,) and pressure is an array of shape (4L,4L). For the moment, with pytables, there is no system attribute(s) to know first dimension in pressure shape is latitude and second is longitude. Can you give me a something (a specific attribute for example) available in the pytables API, to declare the order of use of each parameters in the pressure array. Thanks a lot, Regards, Philippe Collet >Cheers, > > > |
From: Francesc A. <fa...@ca...> - 2005-09-06 15:53:01
|
A Tuesday 06 September 2005 16:08, phi...@ho... va escriure: > Sorry that doesn't seem clear. > No limitations of pytables. > It's much more that i'm not allowed to use table. > Arrays are more appreciated to achieve my goal . Ok. But it's a pity because using the filtering capabilities in Table objects, like: [r['pressure'] for r in table if r['latitude'] =3D=3D X and r['latitude'] = =3D=3D Y] is very powerful to do what you are willing to. > That could be a good starting point. I only need an ordered list > containing path of each array of system parameters. > For example, the attribute could be > ['/parameters/longitude','/parameters/latitude','/parameters/time'] Definitely, that could be a solution if you want to stick with arrays. > In fact, i'm joining Norbert Nemec in his post from 2005-01-24 11:51 to > request a convention in pytables to store not only data but also a way > to link the data. > > Here is thye situation, better represented: [snipped] Ok. I understand better now. With that, what you want is something similar to: pressure.where(pressure.axis.longitude =3D=3D 0.2 and pressure.axis.latitude =3D=3D 0.45 ) isn't it? Well, I must recognize that the idea is pretty nice. In addition, if values in latitude and longitude have a direct mapping into indices (as you seem to suggest), then a binary search on axis could be made so that finding the indexes should be a very fast operation. Well, I think I'll put this suggestion in our TODO file. Thanks for your detailed explanation! =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: <phi...@ho...> - 2005-09-07 15:14:09
|
Francesc Altet wrote: >A Tuesday 06 September 2005 16:08, phi...@ho... va escriure: > > >>Sorry that doesn't seem clear. >>No limitations of pytables. >>It's much more that i'm not allowed to use table. >>Arrays are more appreciated to achieve my goal . >> >> > >Ok. But it's a pity because using the filtering capabilities in Table >objects, like: > >[r['pressure'] for r in table if r['latitude'] == X and r['latitude'] == Y] > >is very powerful to do what you are willing to. > > Of course, using python list comprehension in tables is really powerfull. But i can't actually use tables. I have to use arrays. > > >>That could be a good starting point. I only need an ordered list >>containing path of each array of system parameters. >>For example, the attribute could be >>['/parameters/longitude','/parameters/latitude','/parameters/time'] >> >> > >Definitely, that could be a solution if you want to stick with arrays. > > > >>In fact, i'm joining Norbert Nemec in his post from 2005-01-24 11:51 to >>request a convention in pytables to store not only data but also a way >>to link the data. >> >>Here is thye situation, better represented: >> >> >[snipped] > >Ok. I understand better now. With that, what you want is something >similar to: > >pressure.where(pressure.axis.longitude == 0.2 and > pressure.axis.latitude == 0.45 ) > >isn't it? > >Well, I must recognize that the idea is pretty nice. In addition, if >values in latitude and longitude have a direct mapping into indices >(as you seem to suggest), then a binary search on axis could be made >so that finding the indexes should be a very fast operation. > >Well, I think I'll put this suggestion in our TODO file. > >Thanks for your detailed explanation! > > That's exactly the idea behind all. And you go further with the suggestion about the direct mapping into indices. That could be very powerfull. Thanks a lot for taking in account new improvements. Of course, i can give you a hand if you need help. Tell me when you start programming it, we can work together. If you didn't have time, i will try soon to modify pytables code with your rigths. Thanks a lot for your work. Regards, Philippe Collet |
From: Francesc A. <fa...@ca...> - 2005-09-07 16:30:19
|
A Wednesday 07 September 2005 17:12, phi...@ho... va escriure: > >Ok. I understand better now. With that, what you want is something > >similar to: > > > >pressure.where(pressure.axis.longitude =3D=3D 0.2 and > > pressure.axis.latitude =3D=3D 0.45 ) > > > > That's exactly the idea behind all. And you go further with the > suggestion about the direct mapping into indices. That could be very > powerfull. Yes. I'm thinking that this kind of approach could let the user do: pressure.where(pressure.axis.longitude > 0.2 and pressure.axis.latitude < 0.45 ) or=20 pressure.where(0.1 <=3D pressure.axis.longitude <=3D 0.2 or pressure.axis.latitude < 0.45 ) or any other boolean combination. In addition, as HDF5 supports natively boolean combinations of hyperslabs, this kind of operations will potentially be very I/O efficient. > Thanks a lot for taking in account new improvements. > Of course, i can give you a hand if you need help. > Tell me when you start programming it, we can work together. > If you didn't have time, i will try soon to modify pytables code with > your rigths. Well, we are working in other things right now, but indeed I'd like to have some spare time to implement this. Of course, you can always have a deeper look into it and if you end with something I'll be more than happy to include it in PyTables. Cheers, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Cyril G. <cyr...@fr...> - 2005-09-09 08:20:29
|
Hello World :-), That seems a very good news for the simulation methods based upon structured grid (i, j, k) mesh like finite differences in time domain. For instance in electromagnetism, people use to stock matrices X[i], Y[j], Z[k], Ex[i,j,k], Ey[i,j,k], Ez[i,j,k], Hx[i,j,k], Hy[i,j,k], Hz[i,j,k] independantly. Why ? Because during the computation, there is no need of X, Y, Z. In pytables, one can write these matrices but there is no standard way to say : The first dimension of Ex is linking to X, the second to Y and the third to Z. We could even imaging : The first dimension of Ex is linking to X[i1:i2:i3] (begin, end, step) and so on... And that 's the point, linking matrix sides to some arrays description. "netcdf" allows such a feature but netcdf is usefullless with python, and i like pytables, "very good job". It's the way to do simulation with scripting languages. Thanks for your work. Cyril. |
From: Francesc A. <fa...@ca...> - 2005-09-09 09:59:50
|
A Friday 09 September 2005 10:21, Cyril Giraudon va escriure: > That seems a very good news for the simulation methods based upon > structured grid (i, j, k) mesh like finite differences in time domain. > For instance in electromagnetism, people use to stock matrices > X[i], > Y[j], > Z[k], > Ex[i,j,k], > Ey[i,j,k], > Ez[i,j,k], > Hx[i,j,k], > Hy[i,j,k], > Hz[i,j,k] > independantly. > > Why ? Because during the computation, there is no need of X, Y, Z. All right, but if you include such information on tables *and* use compression, your datasets will not grow as much as you might think. I'd recommend to have a try on this. You may get (positively) surprised. > In pytables, one can write these matrices but there is no standard way > to say : > The first dimension of Ex is linking to X, the second to Y and the third > to Z. Yes. I've done some research and found this: http://hdf.ncsa.uiuc.edu/RFC/H5DimScales/ So, it seems that what you are asking for are Dimension Scales. Well, the good news is that the HDF group is working on implementing this. Once their job would be done, pytables can use them in a much more portable way (i.e. compatible with all HDF5 apps). > We could even imaging : > The first dimension of Ex is linking to X[i1:i2:i3] (begin, end, > step) and so on... In the design document on dimension scales above, you can go further and assign several (not just one) scales to a dimension, share scales among different dimensions (even on the same dataset), even define functions as scales would be possible. I don't know how difficult would be defining scale functions in compiled languages like C or =46ortran, but given the interpreted nature of Python that would be relatively easy. > And that 's the point, linking matrix sides to some arrays description. > "netcdf" allows such a feature but netcdf is usefullless with python, > and i like pytables, "very good job". > It's the way to do simulation with scripting languages. Thanks for the compliments :) =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Cyril G. <cyr...@fr...> - 2005-09-13 09:06:56
|
Francesc Altet a =E9crit : >Yes. I've done some research and found this: > >http://hdf.ncsa.uiuc.edu/RFC/H5DimScales/ > >So, it seems that what you are asking for are Dimension Scales. Well, >the good news is that the HDF group is working on implementing this. >Once their job would be done, pytables can use them in a much more >portable way (i.e. compatible with all HDF5 apps). > =20 > Yes, it seems to be the solution. Apparently, there's also an API : http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/d= oc/ and perhaps stable. You know, I agre woth you, "tables" could be (is) the right way to work=20 with linked arrays even with structured grid . But, you know, people of the structured grids world don't use to work=20 like this. Do they all accept to change their mind ? I can't wait for this feature in pytables. Cyril. |
From: Francesc A. <fa...@ca...> - 2005-09-13 09:35:35
|
A Tuesday 13 September 2005 11:08, Cyril Giraudon va escriure: > Francesc Altet a =E9crit : > >Yes. I've done some research and found this: > > > >http://hdf.ncsa.uiuc.edu/RFC/H5DimScales/ > > > >So, it seems that what you are asking for are Dimension Scales. Well, > >the good news is that the HDF group is working on implementing this. > >Once their job would be done, pytables can use them in a much more > >portable way (i.e. compatible with all HDF5 apps). > > Yes, it seems to be the solution. > Apparently, there's also an API : > http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/ and perhaps stable. > > You know, I agre woth you, "tables" could be (is) the right way to work > with linked arrays even with structured grid . No, perhaps tables is not the best way to solve this problem (dimension scales seems a much better approach), but they can be a solution in the interim. > But, you know, people of the structured grids world don't use to work > like this. > Do they all accept to change their mind ? Well, these people are supposed to be very experienced in their work, so I'm not going to change their mind ;) > I can't wait for this feature in pytables. Well, you know, you can help on this in several ways. =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Cyril G. <cyr...@fr...> - 2005-09-19 11:00:42
|
Francesc Altet a =E9crit : >>I can't wait for this feature in pytables. >> =20 >> > >Well, you know, you can help on this in several ways. > > =20 > Good answer. What can i do to help you ? However i haven't the time to study pytables code and write the feature. I think i can test the cvs or ... Cyril. |
From: Francesc A. <fa...@ca...> - 2005-09-19 12:27:53
|
El dl 19 de 09 del 2005 a les 13:02 +0200, en/na Cyril Giraudon va escriure: > Francesc Altet a =E9crit : > What can i do to help you ? > However i haven't the time to study pytables code and write the feature. > I think i can test the cvs or ... Well, as I said before, we don't have time neither right now. On the other hand, I consider this a *nice* thing to have, so it will eventually go into PyTables. The nice thing about PyTables is that it is a completely open source project, so anyone can hack it in case of need (i.e. you don't need to wait until someone else do what you are interested in ;). Cheers, --=20 >0,0< Francesc Altet http://www.carabos.com/ V V C=E1rabos Coop. V. Enjoy Data "-" |
From: Cyril G. <cyr...@fr...> - 2005-09-20 12:28:54
|
Francesc Altet a =E9crit : >El dl 19 de 09 del 2005 a les 13:02 +0200, en/na Cyril Giraudon va >escriure: > =20 > >>Francesc Altet a =E9crit : >>What can i do to help you ? >>However i haven't the time to study pytables code and write the feature= . >>I think i can test the cvs or ... >> =20 >> > >Well, as I said before, we don't have time neither right now. On the >other hand, I consider this a *nice* thing to have, so it will >eventually go into PyTables. > >The nice thing about PyTables is that it is a completely open source >project, so anyone can hack it in case of need (i.e. you don't need to >wait until someone else do what you are interested in ;). > >Cheers, > > =20 > Well, it's right. So, can you tell me briefly how you work. I 've seen in the source code you use pyrex.=20 What is you method ? From the hdf5 sources to pytables sources ? And if i have time .... Thank you. Cyril. |
From: Francesc A. <fa...@ca...> - 2005-09-20 15:03:40
|
A Dimarts 20 Setembre 2005 14:31, v=E0reu escriure: > Well, it's right. So, can you tell me briefly how you work. > I 've seen in the source code you use pyrex. > What is you method ? From the hdf5 sources to pytables sources ? Yes, PyTables is using Pyrex in order to link with HDF5 functions. What I'd do in order to implement dimension scales is something like: =2D Study the dimension scales API from HDF5 site: http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5ds.html Do some tests in C, if needed =2D Study the best API for PyTables: How are you going to link with DS? Are you going to support several DS per dimension? How indexing with new scales would be accessible? =2D Look at the hdf5Extension.Array object and try to attach the DS there. =2D Try to extend DS to EArray and CArray objects (should be straightforward) If you have more time and want to make your patches easily integrated in PyTables. =2D Add test units =2D Add docs All in all, it seems like a lot of work, but like everything else, that depends on your priorities :-) Cheers, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Cyril G. <cyr...@fr...> - 2005-09-22 08:53:28
|
Well, i'll do my best. However, dimension scales well be included in hdf5 with the 1.8 version (perhaps a long time). http://hdf.ncsa.uiuc.edu/HDF5/Tutor/h5dimscale.html Does a CVS version exist ? Cyril. |
From: Francesc A. <fa...@ca...> - 2005-09-22 09:48:40
|
A Dijous 22 Setembre 2005 10:55, Cyril Giraudon va escriure: > Well, i'll do my best. > However, dimension scales well be included in hdf5 with the 1.8 version > (perhaps a long time). There are snapshots of the development release (1.7.x branch) in: ftp://ftp.ncsa.uiuc.edu/HDF/pub/outgoing/hdf5/snapshots It seems that the current implementation of dimension scales are included there (hl/src directory). =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |