Skip to content
Snippets Groups Projects
Select Git revision
  • 587934029f09eb73d451992bc20c465a9d980a76
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
21 results

atacmds.cpp

Blame
  • test_knm.py 979 B
    from pykat import *
    from pykat.utilities.knm import knmHG, makeCouplingMatrix, plot_knm_matrix
    from pykat.utilities.maps import aperturemap
    import numpy as np
    import time
    
    q1 = beam_param(w0=5e-2, z=0)
    q2 = beam_param(w0=5e-2, z=0)
    
    aperture = 0.1
    s = 1000
    size = np.array([s, s])
    stepsize = 0.3/(size-1)
    smap = aperturemap("tilt", size, stepsize, aperture)
    
    couplings = makeCouplingMatrix(1)
    
    params = {"usepolar":True, "aperture":aperture, "epsabs": 1e-3, "epsrel": 1e-3}
    
    t0 = time.time()
    kbh = knmHG(couplings, q1, q2, method="adaptive", verbose=True, params=params)
    print time.time() - t0
    
    t0 = time.time()
    kr = knmHG(couplings, q1, q2, surface_map=smap, method="riemann", verbose=True)
    print time.time() - t0
    
    smap.generateROMWeights(isModeMatched=True, verbose=True)
    t0 = time.time()
    krm = knmHG(couplings, q1, q2, surface_map=smap, method="romhom")
    print time.time() - t0
    
    print kbh
    print kr
    print krm
    
    plot_knm_matrix(couplings, np.log10(np.abs(kbh - kr)))
    
    print params