[ase-users] Pure python ASE viewer
Ask Hjorth Larsen
asklarsen at gmail.com
Fri Aug 16 02:24:10 CEST 2019
Dear all,
Am Mi., 14. Aug. 2019 um 20:15 Uhr schrieb Noam Bernstein via
ase-users <ase-users at listserv.fysik.dtu.dk>:
>
> Just a question for ASE users - is there any interest in a purely python viewer of ASE atomic configurations that can do prettier output than the ase-gui, but doesn't rely on a whole separate program such as rasmol, avogadro, etc)?
As Michael Walter said in another response, writing a new viewer is a
major task. So either someone must have a lot of time and energy
(which is not impossible though) and produce a very good viewer, or we
might get fragmentation with two viewers that can't quite replace each
other.
The current GUI has a few issues. I think the most important one is
that slower than the old Gtk renderer (lower framerate in animations,
interactive rotations etc.). More 'beautiful' rendering (with shiny
balls, GPU acceleration, isosurfaces etc.) would require rewriting the
rendering loop probably using a different library. If Tkinter had
good support for buffered images --- rendering onto a buffer and
blitting the buffer to the screen -- this might not be necessary since
another library could render onto that buffer. But last time I
checked I didn't find a way. Otherwise if the main display can be
GPU-accelerated and embedded into the GUI as a new widget, then that
would also perhaps be enough.
(Personally I still prefer the default simple uniformly coloured spheres)
>
> The basic idea is to use vtk to do reasonably pretty (shaded, lighting, but not ray-traced) balls and sticks for atoms/bonds, and isosurfaces (e.g. using the ase.io VASP CHGCAR reader). The GUI mostly lets you rotate and pick with the mouse, but anything more complex is done with a command line (using readline for command history and argparse for self-documenting command syntax). It can also support arbitrary resolution rendering and movie creation (internally piping into ffmpeg). I’ve been very happy with vtk’s capabilities, which make it surprisingly easy to do things that are pretty complex (e.g. that arbitrary resolution rendering, or slices through volumetric data), so it feels like this could be a tool that would support a wide range of additional features. Using python also means that there’s the possibility of running fairly arbitrary ase functions on the atoms structures from the command line.
>
> I’m working on such a tool for myself, and am just wondering how much interest there would be for me to release it in some form. If you think it would be useful (or have a well formed opinion on why it’s not likely to be an improvement over some existing tool that I missed), I’d be interested to find out.
For the time being, I would be particularly interested in a
'bottom-up' approach to plotting and rendering: We define new objects
like BandStructure, IsoSurface, ..., which focus on representing some
physical thing while providing handy I/O. And then we define simple
functions to plot them.
Imagine an object called, say, SpatialFunction, which implements
get_isosurface() which returns an IsoSurface object which has a plot()
function that could take different renderer arguments. Maybe this
sounds complicated but shortcuts can always be added later. This
would allow us to see simple cases where this approach works, and
seeing directly if/how it would be useful to integrate that kind of
rendering in the GUI.
Best regards
Ask
>
> Noam
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
More information about the ase-users
mailing list