def onVisualizeSKB(self, event): """ Calls the visualizer to visualize the specified wavefunction. Use the approach described in http://wiki.wxpython.org/LongRunningTasks to make the Gui responsive one can use """ #print("in new" ,event.skb) spin, kpoint, band = event.skb visu_name = self.GetVisualizer() if visu_name == "None": return self.statusbar.PushStatusText( "Visualizing wavefunction (spin=%d, kpoint=%s, band=%d)" % (spin, kpoint, band)) try: visu = self.wfk.visualize_ur2(spin, kpoint, band, visu_name=visu_name) thread = awx.WorkerThread(self, target=visu) thread.start() except: awx.showErrorMessage(self)
def OnFermiSurface(self, event): """Visualize the Fermi surface with Xcrysden.""" try: visu = self.ebands.export_bxsf(".bxsf") thread = awx.WorkerThread(self, target=visu) thread.start() except Exception: awx.showErrorMessage(self)
def OnNetcdf_NcView(self, event): """Call ncview in an subprocess.""" if which("ncview") is None: return awx.showErrorMessage(self, "Cannot find ncview in $PATH") for path in self.nc_filepaths: def target(): os.system("ncview %s" % path) thread = awx.WorkerThread(self, target=target) thread.start()
def OnStructureVisualize(self, event): """"Call the visualizer to visualize the crystalline structure.""" appname = self._id2visuname[event.GetId()] try: visu = self.structure.visualize(appname=appname) thread = awx.WorkerThread(self, target=visu) thread.start() except Exception: awx.showErrorMessage(self)
def showStructure(parent, filepath): ncfile = abiopen(filepath) visu_classes = Visualizer.get_available(ext="xsf") if not visu_classes: print("Not visualizer found for extension xsf") return vname = visu_classes[0].name visu = ncfile.structure.visualize(vname) thread = awx.WorkerThread(parent, target=visu) thread.start()
def _visualize_skb(self, spin, kpoint, band): """Calls the visualizer to visualize the specified wavefunction.""" # To make the Gui responsive one can use the approach described in # http://wiki.wxpython.org/LongRunningTasks appname = self.GetVisualizer() if appname == "None": return self.statusbar.PushStatusText( "Visualizing wavefunction (spin=%d, kpoint=%s, band=%d)" % (spin, kpoint, band)) try: visu = self.wfk.visualize_ur2(spin, kpoint, band, appname=appname) thread = awx.WorkerThread(self, target=visu) thread.start() except: awx.showErrorMessage(self)