[Python-apps-team] Bug#488429: mayavi2: please implement a global data range switch
frx at firenze.linux.it
Sat Jun 28 20:32:32 UTC 2008
Thanks to the resolution of bugs #478359 and #479448, I can now load
multiblock PLOT3D data files and visualize vector components! :-)
Many thanks to upstream developers and to Varun for helping out!
When visualizing multiblock data, it would be very useful to have
the possibility to obtain automatic data ranges based on *all*
loaded data blocks, rather than necessarily on the current data block.
I would like to see a "global data range" checkbox implemented.
Let me (try and) explain what I mean.
I'll consider the attached test case, a gzipped tar archive (which
includes a test PLOT3D geometry+solution pair of files, along with
a Fortran77 program that generates it):
$ tar xvzf fh_cross_testcase.tar.gz
The main window shows up.
* from menus, select File -> Load data -> PLOT3D file
* as XYZ Co-ordinate file, select `fakehurr_cross.xyz'
* as Q Solution file, select `fakehurr_cross.q'
* in the Edit PLOT3DReader properties dialog window, check "Binary
file", "Do not reduce number of outputs", "Has byte count", "Multi
grid", and "Two dimensional geometry"; *un*check "Force read", and
"I blanking"; select "little_endian" Byte order; click on the OK
* from menus, select Visualize -> Filters -> Select Output
* from menus, select Visualize -> Filters -> Extract Vector Components
* from menus, select Visualize -> Modules -> Surface (a semicircle
appears, cromatically visualizing the x component of the "momentum"
Now I would like to visualize the whole domain.
Since there's a second data block, I will need another SelectOutput
filter, with identical children:
* in the MayaVi pane, left-click on SelectOutput and then right-click;
from the popup menu, select Copy
* in the MayaVi pane, left-click on
PLOT3D:fakehurr_cross.xyz, fakehurr_cross.q and then right-click; from
the popup menu, select Paste
* in the MayaVi pane, left-click on the newly created SelectOutput and
drag the slider in MayaVi object editor pane (so that output #1 is
selected, rather than #0)
* in the TVTK Scene 1 pane, click on "View along the +Z axis" button
Now the whole domain is displayed, with the "momentum-x" scalar
But the two blocks have different automatic data ranges:
block #0: min = -0.225736364722 max = 0.000902647909243
block #1: min = -0.000902647909243 max = 0.225736364722
As a consequence, the visualization appears as if the data were
discontinuous, which are not! One block is mainly red, the other
one is mainly blue...
Let's manually cure this flaw:
* in the MayaVi pane, left-click on one Modules item, and uncheck "Use
default range" in the Scalar LUT / LUT Manager subtab (MayaVi object
editor pane); set -0.225736364722 and 0.225736364722 as data range
* do the same for the other Modules item
Now the visualization shows two consistent half-domains and it is
clear that the data are _not_ discontinous.
OK, what I would like to see implemented is a "Global range" checkbox
in the LUT managers (next to the "Use default range" checkbox): if the
user checks this "Global range" checkbox, MayaVi2 should compute the
default range by taking *all* loaded outputs (of the same data source!)
into account, rather than only the local one.
With this checkbox the above scenario could be cured automatically
(rather than manually).
Of course, if the user unchecks this "Global range" checkbox, the
current behavior would still be followed.
I don't know how exactly this feature can be implemented, since
I have not (yet) studied MayaVi2 source code.
Maybe the PLOT3D data source object should create and update
a list of minima and maxima of its currently loaded outputs,
one pair for each SelectOutput filter that extracts data from it:
this pair is updated whenever the corresponding SelectOutput filter
changes selected output and is discarded as soon as the filter
is deleted. When a LUT Manager needs to compute a global range,
it can ask to the PLOT3D data source object, which will return
the minimum of the minima and the maximum of the maxima.
OK, maybe I am completely off-track... ;-)
Anyway, whatever the implementation details, I hope this feature
is not too hard to add.
Please forward this wishlist bug report to upstream.
Thanks in advance.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages mayavi2 depends on:
ii libc6 2.7-10 GNU C Library: Shared libraries
ii python 2.5.2-1 An interactive high-level object-o
ii python-central 0.6.7 register and build utility for Pyt
ii python-enthought-traits 2.0.4-2 Manifest typing and reactive progr
ii python-enthought-traits-ui 2.0.4-3 User interface related modules for
ii python-numpy 1:1.1.0-1 Numerical Python adds a fast array
ii python-pkg-resources 0.6c8-3 Package Discovery and Resource Acc
ii python-vtk 5.0.4-1+b1 Python bindings for VTK
ii python-wxgtk2.6 184.108.40.206.2-2 wxWidgets Cross-platform C++ GUI t
ii python2.5 2.5.2-6 An interactive high-level object-o
mayavi2 recommends no packages.
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 44979 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20080628/7a8a2eca/attachment-0001.bin
More information about the Python-apps-team