Ejemplo n.º 1
0
"""A helper script for viewing DDM data using cddm's DataViewer"""
import numpy as np
from cddm.viewer import DataViewer
import argparse
import pathlib

parser = argparse.ArgumentParser()
parser.add_argument('ddm_npy_path', type=pathlib.Path)
params = parser.parse_args()

ddm_array = np.load(params.ddm_npy_path)
# print(ddm_array)

#: inspect the data
viewer = DataViewer(semilogx=False)
viewer.set_data(ddm_array)
viewer.set_mask(k=3, angle=0, sector=10)
viewer.plot()
viewer.show()
Ejemplo n.º 2
0
fft_array, = asarrays(fft, NFRAMES_FAST)

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

    #: now perform auto correlation calculation with default parameters
    data = acorr(fft_array, n=int(NFRAMES / DT_FAST), method="fft")
    bg, var = stats(fft_array)

    for norm in range(8):

        #: perform normalization and merge data
        data_lin = normalize(data, bg, var, scale=True, norm=norm)

        if norm == 6:
            np.save(p.join(DATA_PATH, "corr_fast_linear.npy"), data_lin)

        #: perform log averaging
        x, y = log_average(data_lin, size=16)

        #: save the normalized data to numpy files
        np.save(p.join(DATA_PATH, "corr_fast_t.npy"), x * DT_FAST)
        np.save(p.join(DATA_PATH, "corr_fast_data_norm{}.npy".format(norm)), y)

    #: inspect the data
    viewer = DataViewer()
    viewer.set_data(data_lin)
    viewer.set_mask(k=25, angle=0, sector=30)
    viewer.plot()
    viewer.show()