Skip to content
Snippets Groups Projects
Select Git revision
  • a959216fb080ba6a113fc021b1c257ee850e7502
  • 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

Starsphere.cpp

Blame
  • Forked from einsteinathome / graphicsframework
    Source project has a limited visibility.
    • Oliver Bock's avatar
      3d9d9818
      Added proper timing · 3d9d9818
      Oliver Bock authored
      * For sphere rotation
      * For observatory positioning
      
      Note: the original code seems to have a bug which explains a slight discrepancy between this new and the original visualisation.
      In the original code gmt_dtime() is used to get the GMT time, but this function is a mere #define of dtime() under unix, hence any
      difference of dtime() and gmt_dtime() will result in 0 instead of the real UTC/GMT offset.
      
      Note: dtime() returns local time...
      3d9d9818
      History
      Added proper timing
      Oliver Bock authored
      * For sphere rotation
      * For observatory positioning
      
      Note: the original code seems to have a bug which explains a slight discrepancy between this new and the original visualisation.
      In the original code gmt_dtime() is used to get the GMT time, but this function is a mere #define of dtime() under unix, hence any
      difference of dtime() and gmt_dtime() will result in 0 instead of the real UTC/GMT offset.
      
      Note: dtime() returns local time...
    grid_F0F1F2.py 1.68 KiB
    import pyfstat
    import numpy as np
    import matplotlib.pyplot as plt
    
    try:
        from gridcorner import gridcorner
    except ImportError:
        raise ImportError(
            "Python module 'gridcorner' not found, please install from "
            "https://gitlab.aei.uni-hannover.de/GregAshton/gridcorner")
    
    F0 = 30.0
    F1 = 1e-10
    F2 = 0
    Alpha = 1.0
    Delta = 1.5
    
    # Properties of the GW data
    sqrtSX = 1e-23
    tstart = 1000000000
    duration = 10*86400
    tend = tstart+duration
    tref = .5*(tstart+tend)
    
    depth = 20
    label = 'grid_F0F1F2'
    outdir = 'data'
    
    h0 = sqrtSX / depth
    
    data = pyfstat.Writer(
        label=label, outdir=outdir, tref=tref,
        tstart=tstart, F0=F0, F1=F1, F2=F2, duration=duration, Alpha=Alpha,
        Delta=Delta, h0=h0, sqrtSX=sqrtSX)
    data.make_data()
    
    m = 0.01
    dF0 = np.sqrt(12*m)/(np.pi*duration)
    dF1 = np.sqrt(180*m)/(np.pi*duration**2)
    dF2 = 1e-17
    N = 100
    DeltaF0 = N*dF0
    DeltaF1 = N*dF1
    DeltaF2 = N*dF2
    F0s = [F0-DeltaF0/2., F0+DeltaF0/2., dF0]
    F1s = [F1-DeltaF1/2., F1+DeltaF1/2., dF1]
    F2s = [F2-DeltaF2/2., F2+DeltaF2/2., dF2]
    Alphas = [Alpha]
    Deltas = [Delta]
    search = pyfstat.GridSearch(
        'grid_F0F1F2', 'data', data.sftfilepath, F0s, F1s,
        F2s, Alphas, Deltas, tref, tstart, tend)
    search.run()
    
    F0_vals = np.unique(search.data[:, 2]) - F0
    F1_vals = np.unique(search.data[:, 3]) - F1
    F2_vals = np.unique(search.data[:, 4]) - F2
    twoF = search.data[:, -1].reshape((len(F0_vals), len(F1_vals), len(F2_vals)))
    xyz = [F0_vals, F1_vals, F2_vals]
    labels = ['$f - f_0$', '$\dot{f} - \dot{f}_0$', '$\ddot{f} - \ddot{f}_0$',
              '$\widetilde{2\mathcal{F}}$']
    fig, axes = gridcorner(
        twoF, xyz, projection='log_mean', labels=labels, whspace=0.1, factor=1.8)
    fig.savefig('{}/{}_projection_matrix.png'.format(outdir, label))