Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
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()
Ejemplo n.º 6
0
    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)