def test1():
    import crystal.UnitCell as UC
    from crystal.Atom import Atom

    print "This test should plot some phonon isosurfaces."
    path = ExcitationSlicer.__file__.strip('__init__.pyc')
    
    cellvectors=[[3.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]
    #uc = UC.create_unitcell(cellvectors, [Atom(Z=23), Atom(Z=23)], [(0,0,0), (0.5, 0.5, 0.5)])
    uc = UC.UnitCell()
    uc.setCellVectors(cellvectors)
    uc.addAtom(Atom(Z=23), (0,0,0), '')
    uc.addAtom(Atom(Z=23), (0.5,0.5,0.5), '')
    print uc

    myplotter = VTKIsoSurfacePlotter()    
    calc = phonIsoSurfaceCalcor(unitcell=uc, tau=[1.0,0.0,0.0], plotter=myplotter)
    calc.setDataFile(path+'data/phon_out.pkl')
    calc.loadPhononData()

    print "Plot phonon eigen-energy isosurfaces."
    calc.plotEnergyIsoSurface(branchtoplot=3, energyvalues=[10,45])
    #wait for input
    input = raw_input("Finished test1.")

    return
def test2():
    import crystal.UnitCell as UC
    from crystal.Atom import Atom

    path = ExcitationSlicer.__file__.strip('__init__.pyc')
    cellvectors = [[3.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]
    #uc = UC.create_unitcell(cellvectors, [Atom(Z=23), Atom(Z=23)], [(0,0,0), (0.5, 0.5, 0.5)])
    uc = UC.UnitCell()
    uc.setCellVectors(cellvectors)
    uc.addAtom(Atom(Z=23), (0, 0, 0), '')
    uc.addAtom(Atom(Z=23), (0.5, 0.5, 0.5), '')

    #Now we want to plot the isosurface with intensity mapped on it:
    myplotter2 = VTKIsoSurfaceIntensityPlotter()

    calc2 = phonIsoSurfaceCalcor(unitcell=uc,
                                 tau=[1.0, 0.0, 0.0],
                                 plotter=myplotter2)
    calc2.setDataFile(path + 'data/phon_out.pkl')
    calc2.loadPhononData()

    calc2.plotIsoSurfaceIntensity(branchtoplot=3,
                                  atomtoplot=0,
                                  energyvalues=[30])
    #wait for input
    input = raw_input("Finished test2.")

    return
def test1():
    import crystal.UnitCell as UC
    from crystal.Atom import Atom

    print "This test should plot some phonon isosurfaces."
    path = ExcitationSlicer.__file__.strip('__init__.pyc')

    cellvectors = [[3.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]
    #uc = UC.create_unitcell(cellvectors, [Atom(Z=23), Atom(Z=23)], [(0,0,0), (0.5, 0.5, 0.5)])
    uc = UC.UnitCell()
    uc.setCellVectors(cellvectors)
    uc.addAtom(Atom(Z=23), (0, 0, 0), '')
    uc.addAtom(Atom(Z=23), (0.5, 0.5, 0.5), '')
    print uc

    myplotter = VTKIsoSurfacePlotter()
    calc = phonIsoSurfaceCalcor(unitcell=uc,
                                tau=[1.0, 0.0, 0.0],
                                plotter=myplotter)
    calc.setDataFile(path + 'data/phon_out.pkl')
    calc.loadPhononData()

    print "Plot phonon eigen-energy isosurfaces."
    calc.plotEnergyIsoSurface(branchtoplot=3, energyvalues=[10, 45])
    #wait for input
    input = raw_input("Finished test1.")

    return
def test3():
    import crystal.UnitCell as UC
    from crystal.Atom import Atom

    path = ExcitationSlicer.__file__.strip('__init__.pyc')
    cellvectors=[[3.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]
    uc = UC.UnitCell()
    uc.setCellVectors(cellvectors)
    uc.addAtom(Atom(Z=23), (0,0,0), '')
    uc.addAtom(Atom(Z=23), (0.5,0.5,0.5), '')
    myslicer = VTKPlaneSlicer()
    calc = phonIsoSurfaceCalcor(unitcell=uc, tau=[1.0,0.0,0.0], slicer=myslicer)
    calc.setDataFile(path+'data/phon_out.pkl')
    calc.loadPhononData()
    calc.plotIntensityPlaneCut(branchtoplot=3,atomtoplot=0)
    input = raw_input("Finished test3.")
    return
def test3():
    import crystal.UnitCell as UC
    from crystal.Atom import Atom

    path = ExcitationSlicer.__file__.strip('__init__.pyc')
    cellvectors = [[3.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]
    uc = UC.UnitCell()
    uc.setCellVectors(cellvectors)
    uc.addAtom(Atom(Z=23), (0, 0, 0), '')
    uc.addAtom(Atom(Z=23), (0.5, 0.5, 0.5), '')
    myslicer = VTKPlaneSlicer()
    calc = phonIsoSurfaceCalcor(unitcell=uc,
                                tau=[1.0, 0.0, 0.0],
                                slicer=myslicer)
    calc.setDataFile(path + 'data/phon_out.pkl')
    calc.loadPhononData()
    calc.plotIntensityPlaneCut(branchtoplot=3, atomtoplot=0)
    input = raw_input("Finished test3.")
    return
def test2():
    import crystal.UnitCell as UC
    from crystal.Atom import Atom

    path = ExcitationSlicer.__file__.strip('__init__.pyc')
    cellvectors=[[3.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]
    #uc = UC.create_unitcell(cellvectors, [Atom(Z=23), Atom(Z=23)], [(0,0,0), (0.5, 0.5, 0.5)])
    uc = UC.UnitCell()
    uc.setCellVectors(cellvectors)
    uc.addAtom(Atom(Z=23), (0,0,0), '')
    uc.addAtom(Atom(Z=23), (0.5,0.5,0.5), '')

    #Now we want to plot the isosurface with intensity mapped on it:
    myplotter2 = VTKIsoSurfaceIntensityPlotter()

    calc2 = phonIsoSurfaceCalcor(unitcell=uc, tau=[1.0,0.0,0.0], plotter=myplotter2)
    calc2.setDataFile(path+'data/phon_out.pkl')
    calc2.loadPhononData()

    calc2.plotIsoSurfaceIntensity(branchtoplot=3, atomtoplot=0, energyvalues=[30])
    #wait for input
    input = raw_input("Finished test2.")

    return