Skip to content
Snippets Groups Projects
Select Git revision
  • 1cb3e05dcfd6f8f1eed83c4bead05ec84741de4a
  • master default protected
  • Binary
  • add-version-information
  • os-path-join
  • develop-GA
  • timeFstatmap
  • add-higher-spindown-components
  • develop-DK
  • adds-header-to-grid-search
  • v1.3
  • v1.2
  • v1.1.2
  • v1.1.0
  • v1.0.1
15 results

semi_coherent_glitch_search_using_MCMC.py

Blame
  • Forked from Gregory Ashton / PyFstat
    Source project has a limited visibility.
    • Gregory Ashton's avatar
      89f200ed
      Renames sftfilepath -> sftfilepattern · 89f200ed
      Gregory Ashton authored
      This renames the input sftfilepath to sftfilepattern and adds
      documentation on how that should be used, i.e. a colon separated list of
      wildstring or exact matches. In globbing for all matches, the colon
      split is added in. sftfilepath is still used by `Writer` since
      an exact path is known.
      89f200ed
      History
      Renames sftfilepath -> sftfilepattern
      Gregory Ashton authored
      This renames the input sftfilepath to sftfilepattern and adds
      documentation on how that should be used, i.e. a colon separated list of
      wildstring or exact matches. In globbing for all matches, the colon
      split is added in. sftfilepath is still used by `Writer` since
      an exact path is known.
    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