Hi Steve

This occurred to me too today. Feel free to implement it if you are able, otherwise I'll look at it when I get some free time. You'd need to store some extra data in the parameters block and modify the command line to take slices (maybe in the singledatasets dict or separately in another dict?). I don't know whether slices should only apply to datasets imported separately or for all datasets.

I'm wondering whether I should have used pytables, so that the user could also use filtering when importing e.g. dsx[dsy<10]. This can be done inside veusz using filtering, but it might be better for large datasets.

I also it might be good to support some special HDF5 attributes to affect the import, e.g.

vsz_name: name to give dataset when imported
vsz_slice: slice to apply to original data
vsz_minx, _max, _miny, _maxy: range of data for 2D images

I have a slight philosophical conundrums with the importing in Veusz. It is nice to be able to import datasets one by one, giving names, such as in the HDF import when selecting datasets. It's also nice to import all the datasets at once (like HDF when selecting groups), and have the document change when the number of datasets change. The 1st idea makes it easier to make a simple GUI, whereas the second is probably more convenient for automation. The CSV import, for example, could be much nicer if the user could see what is being imported and interactively manipulate it. I suppose both options are useful. Improving the import is one of my aims, as it really seems to stop people using the program.

Thanks

Jeremy

On 09/12/13 19:08, Steve Richardson wrote:
Jeremy,

I just tried the new version, and the HDF5 import seems to be working
for me.

There is an additional feature that I think would be very useful.
Specifically, it would be great if it were possible to specify custom
slicing of the HDF5 dataset. I.e., if it were possible to specify custom
start:stop:skip indices for the datasets. This would allow users to
import only a specific subset of the data from the HDF5 dataset, which
would be quite useful for very large HDF5 files.

This could potentially also allow users to import lower dimensional
subsets of the data in HDF5 files. E.g., to get a 1D slice out of a 2D
dataset, or a 2D slice from a higher-dimension data set. For example, I
have HDF5 files with electric and magnetic fields specified on a 3D
grid. Since these are vector fields, they have an additional index which
specifies the component of the field. Thus the HDF5 dataset is actually
4D. I'd love to be able to get 1D or 2D subsets out of this dataset for
plotting.

I'm pretty new to Qt programming, but I'm going to try and see if I can
extend the HDF5 import tab to include the necessary pieces for
permitting custom slicing.

Steve



On Sun, Dec 8, 2013 at 12:29 PM, Jeremy Sanders
<[email protected] <mailto:[email protected]>> wrote:

    On 04/12/13 22:06, J Lister wrote:

        I'm really needing some HDF5 read in support in this. I know many
        aerospace engineers that would enjoy using this package, but
        cannot due
        their data being in HDF5. I would be happy to work on a plug-in or
        something, but I need more direction.


    Ok, I've added some initial HDF support using h5py. The
    implementation is inspired by Volker's, but it has the ability to
    import groups of datasets (under their original names) and
    individual datasets with any name. I think the dialog box works
    fairly nicely.

    Error bar support is currently implemented by using dataset names
    "foo (+)", "foo (-)" or "foo (+-)" for datasets to add error bars to
    dataset foo.

    You can also provide error bars with a 2D dataset using 2 or 3
    columns. In that case you should give your dataset name "bar (1D)".

    2D datasets work, but there's no way to provide the x and yrange
    yet. Maybe some syntax for the name like "bar
    (xrange=1:2,yrange=1:2)" would work, or I could allow special
    attributes. 1D text datasets also work.

    I don't have support for date datasets - I'm not sure how this
    should be done yet.

    It's pretty untested, but if you'd like to give it a try get it from
    the import_improvement branch:
    https://github.com/__jeremysanders/veusz/tree/__import_improvement
    <https://github.com/jeremysanders/veusz/tree/import_improvement>

    Jeremy



    _________________________________________________
    Veusz-discuss mailing list
    [email protected] <mailto:[email protected]>
    https://mail.gna.org/listinfo/__veusz-discuss
    <https://mail.gna.org/listinfo/veusz-discuss>




_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss



_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à