[Paraview] co-processing script with two datasource ...
u.utku.turuncoglu at be.itu.edu.tr
u.utku.turuncoglu at be.itu.edu.tr
Sat Jun 20 16:15:30 EDT 2015
Hi,
I am tying to run a ParaView pipeline that uses a dataset. In this case,
the dataset has both three (time,y,x) and four (time,z,y,x) dimensional
fields. In the pipeline, i am loading the same dataset twice (by changing
dimensions in the properties window) to access different variables because
i am using both 3 and 4 dimensional fields together to create final
visualisation. Until, this point everything is fine and it works.
Then, i am using co-processing plugin to export pipeline as Python script
and wrote a driver to trigger visualisation pipeline (in Python). If i use
only fields with 3 (or 4) dimension, then attached driver script works
without any problem (driver_00.py) but if i use both 3 and 4 dimensional
fields then i need to send two different dataset to DoCoProcessing routine
but i could not make it work. I tried to create two different readers like
following
# read datasets
reader1 = pvsimple.NetCDFReader(FileName=sys.argv[2])
reader1.Dimensions = '(zlev, iy, jx)'
reader1.SphericalCoordinates = False
reader2 = pvsimple.NetCDFReader(FileName=sys.argv[3])
reader2.Dimensions = '(iy, jx)'
reader2.SphericalCoordinates = False
then i tried to send both of them to coProcess
dset1 = reader1.GetClientSideObject().GetOutputDataObject(0)
dset2 = reader2.GetClientSideObject().GetOutputDataObject(0)
coProcess(dset1, dset2, time, step, sys.argv[1])
by adding extra argument to the coProcess routine and run it as follows
cpscript.RequestDataDescription(datadescription)
inputdesc1 = datadescription.GetInputDescriptionByName("input")
if inputdesc1.GetIfGridIsNecessary() == False:
return
inputdesc1.SetGrid(grid1)
datadescription.AddInput("input1")
inputdesc2 = datadescription.GetInputDescriptionByName("input1")
if inputdesc2.GetIfGridIsNecessary() == False:
return
inputdesc2.SetGrid(grid2)
cpscript.DoCoProcessing(datadescription)
but it is not working. Somehow, i need to add information about the 3 and
4 dimensional fields to data description object. Right? Anyway, my
question is that how could i send two different dataset to my
visualisation pipeline (coproc_01.py).
Thanks,
Regards,
--ufuk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: driver_00.py
Type: text/x-python-script
Size: 1608 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150620/26b94a69/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coproc_01.py
Type: text/x-python-script
Size: 11427 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150620/26b94a69/attachment-0001.bin>
More information about the ParaView
mailing list