Skip to content
Snippets Groups Projects
Select Git revision
  • c52dc124409a5b00d9e7b5beaa4f4b361f2a9fd6
  • master default
  • mingw_gcc44
  • release_ABP1_012
  • release_ABP1_008
  • release_ABP1_006
  • release_ABP1_007
  • release_ABP1_005
  • release_ABP1_004
  • release_ABP1_003
  • pre_release_0.15
  • release_ABP1_001
  • release_ABP1_002
  • pre_release_0.13
  • pre_release_0.14
  • pre_release_0.11
  • pre_release_0.12
  • pre_release_0.10
  • pre_release_0.09
  • pre_release_0.08
20 results

AbstractGraphicsEngine.h

Blame
  • Forked from einsteinathome / graphicsframework
    Source project has a limited visibility.
    • Oliver Bock's avatar
      c52dc124
      Fixing windoze window issue (move/resize) · c52dc124
      Oliver Bock authored
      * Windoze "resets" the OpenGL context when SetVideoMode is called - ergo, we need to reinitialize the context
      * Added a switch (recycle) to initialize() to distinguish between one-off and recurring actions
      c52dc124
      History
      Fixing windoze window issue (move/resize)
      Oliver Bock authored
      * Windoze "resets" the OpenGL context when SetVideoMode is called - ergo, we need to reinitialize the context
      * Added a switch (recycle) to initialize() to distinguish between one-off and recurring actions
    test_2d_plot.py 1.03 KiB
    from pykat import finesse
    from pykat.utilities.optics.gaussian_beams import gauss_param
    from pykat.detectors import *
    from pykat.components import *
    from pykat.commands import *
    from pykat.structs import *
    import matplotlib.image as mpimg
    from mpl_toolkits.mplot3d.axes3d import Axes3D
    
    import numpy as np
    import pylab as pl
    
    code = """
    l l1 1 0 0 n1
    s s1 10 1 n1 n2
    
    ad ad1 0 n2
    beam b1 0 n2
    maxtem 0 
    
    xaxis b1 x lin -10.0 10 100
    x2axis b1 y lin -6 6 100
    
    """
    
    kat = finesse.kat()
    
    kat.parseCommands(code)
    kat.s1.n1.q = gauss_param(w0=1e-3, z=0)
    
    out = kat.run(printout=0,printerr=0)
    
    fig = pl.figure()
    ax = fig.add_subplot(1, 1, 1, projection='3d')
    x, y = np.meshgrid(out.x, out.y)
    p = ax.plot_wireframe(x, y, out["b1"])   
    pl.xlabel(out.xlabel)
    pl.ylabel(out.ylabel)
    pl.show()
    
    pl.figure()
    extent = [np.min(out.x),np.max(out.x),np.min(out.y),np.max(out.y)]
    imgplot = pl.imshow(out["b1"], extent=extent)
    #imgplot.set_interpolation('bicubic')
    imgplot.set_interpolation('nearest')
    pl.colorbar()
    pl.xlabel(out.xlabel)
    pl.ylabel(out.ylabel)
    pl.show()