コード例 #1
0
ファイル: auto_correlate_multi.py プロジェクト: inwwin/cddm
#: perform rfft2 and crop results, to take only first kimax and first kjmax wavenumbers.
fft = rfft2(video, kimax=KIMAX, kjmax=KJMAX)

#: you can also normalize each frame with respect to the [0,0] component of the fft
#: this it therefore equivalent to  normalize_video
#fft = normalize_fft(fft)

if __name__ == "__main__":
    import os.path as p

    #: now perform auto correlation calculation with default parameters using iterative algorithm
    data, bg, var = iacorr_multi(fft, count=NFRAMES)

    #: inspect the data
    viewer = MultitauViewer(scale=True)
    viewer.set_data(data, bg, var)
    viewer.set_mask(k=25, angle=0, sector=30)
    viewer.plot()
    viewer.show()

    #perform normalization and merge data
    fast, slow = normalize_multi(data, bg, var, scale=True)

    #: save the normalized raw data to numpy files
    np.save(p.join(DATA_PATH, "auto_correlate_multi_raw_fast.npy"), fast)
    np.save(p.join(DATA_PATH, "auto_correlate_multi_raw_slow.npy"), slow)

    x, y = log_merge(fast, slow)

    #: save the normalized merged data to numpy files
コード例 #2
0
#:perform the actual multiplication
video = multiply(video, window_video)

#: if the intesity of light source flickers you can normalize each frame to the intensity of the frame
#video = normalize_video(video)

#: perform rfft2 and crop results, to take only first kimax and first kjmax wavenumbers.
fft = rfft2(video, kimax = KIMAX, kjmax = KJMAX)

#: you can also normalize each frame with respect to the [0,0] component of the fft
#: this it therefore equivalent to  normalize_video
#fft = normalize_fft(fft)

fft = play_threaded(fft)

if __name__ == "__main__":
    import os.path as p

    #we will show live calculation with the viewer
    viewer = MultitauViewer(scale = True)
    
    #initial mask parameters
    viewer.k = 15
    viewer.sector = 30
    
    #: now perform auto correlation calculation with default parameters and show live
    data, bg, var = iccorr_multi(fft, t1, t2, period = PERIOD, viewer = viewer)


    viewer.show()