# -*- coding: utf-8 -*-
"""
Created on Sun Mar 03 13:17:52 2019

@author: FemtoMeasure
"""

import fermi_analysis.functions as fk
import numpy as np
#import matplotlib.pyplot as plt

timestamp = np.array([])
for i in np.arange(2, 29703, 300):
    mfli_data = fk.ReadMfliData(
        'C:\\Users\\FemtoMeasure\\Documents\\FermiTest\\Setup\\Run_095\\Run_095_'
        + str(i) + '.h5')
    #    print(type(mfli_data))
    timestamp = np.append(timestamp, mfli_data['timestamp'])

print(np.unique(np.diff(timestamp)))

print((timestamp[-1] - timestamp[0]) / 6e7)
예제 #2
0
        for run in run_list:  # Attention: range(11,13) executes run 11 and 12 (but not 13)
            ldm_file_path = '/home/ldm/ExperimentalData/Online4LDM/20149020/Day_5/Run_' + str(
                run) + '/rawdata/'.format(int(run))
            mfli_file_path = '/home/ldm/ExperimentalData/Online4LDM/20149020/Day_5/Run_' + str(
                run) + '/work/' + mfli + '/'.format(int(run))

            ldm_files = os.listdir(ldm_file_path)
            mfli_files = os.listdir(mfli_file_path)

            mfli_x = np.array([])
            mfli_y = np.array([])
            ldm_delay = np.array([])
            ldm_i0 = np.array([])

            for mfli_file, ldm_file in zip(mfli_files, ldm_files):
                mfli_data = fk.ReadMfliData(mfli_file_path + mfli_file)
                mfli_x = np.append(mfli_x, mfli_data[demod_str_x])
                mfli_y = np.append(mfli_y, mfli_data[demod_str_y])

                ldm_data = h5py.File(ldm_file_path + ldm_file, 'r')
                ldm_delay = np.array(
                    ldm_data['photon_source']['SeedLaser']['trls_sl_03_pos'])
                ldm_i0 = np.array(ldm_data['photon_diagnostics']['FEL01']
                                  ['I0_monitor']['iom_sh_a'])
            mfli_data_cutindex = int(round(cut_frac * np.shape(mfli_x)[0]))
            mfli_x_m = np.append(mfli_x_m,
                                 np.mean(mfli_x[mfli_data_cutindex:]))
            mfli_y_m = np.append(mfli_y_m,
                                 np.mean(mfli_y[mfli_data_cutindex:]))
            mfli_x_s = np.append(mfli_x_s, np.std(mfli_x[mfli_data_cutindex:]))
            mfli_y_s = np.append(mfli_y_s, np.std(mfli_y[mfli_data_cutindex:]))
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 02 18:17:27 2019

@author: FemtoMeasure
"""
import fermi_analysis.functions as fk
import numpy as np
import matplotlib.pyplot as plt

mfli_data = fk.ReadMfliData(
    'C:\\Users\\FemtoMeasure\\Documents\\FermiTest\\Setup\\Run_097\\Run_097_2.h5'
)
d = mfli_data['trigger']
d = np.append(0., d)
d = np.flatnonzero((d[:-1] == 0) & (d[1:] == 2))
print(np.unique(np.diff(d)))
print(mfli_data.keys())
print(mfli_data['harmonic'])
print(mfli_data['oscselect'])
print(mfli_data['timeconstant'])
print(mfli_data['order'])

print((mfli_data['timestamp'][-1] - mfli_data['timestamp'][0]) / 6e7)
fig, ax = plt.subplots(3, 1)
ax[0].plot(mfli_data['timestamp'], mfli_data['x0'])
ax[0].plot(mfli_data['timestamp'], mfli_data['y0'])
ax[1].plot(mfli_data['timestamp'], mfli_data['trigger'])
ax[1].set_ylim((-0.1, 2.1))
ax[2].plot(d)
for a in ax: