filename = r'C:\Data\Antonio\Eitan\022rde11_T_minus15_acc__NT_plus10_don_1.sm'
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import phconvert as phc
phc.__version__
author = 'Eitan Lerner'
author_affiliation = 'UCLA'
creator = 'Antonino Ingargiola'
creator_affiliation = 'UCLA'
comment = 'A demostrative smFRET-usALEX measurement.'
sample_name = '022rde11_T_minus15_acc__NT_plus10_don_1'
dye_names = ['ATTO550', 'ATTO647N']
buffer_name = 'Transcription buffer.'
d = phc.loader.usalex_sm(filename,
donor = 0,
acceptor = 1,
alex_period = 4000,
alex_period_donor = (2850, 580),
alex_period_acceptor = (930, 2580),
excitation_wavelengths = (532e-9, 635e-9),
detection_wavelengths = (580e-9, 680e-9))
phc.plotter.alternation_hist(d)
d['comment'] = comment
d['sample'] = dict(
sample_name=sample_name,
dye_names=[n.encode() for n in dye_names],
buffer_name=buffer_name,
num_dyes = len(dye_names))
d['identity'] = dict(
author=author,
author_affiliation=author_affiliation,
creator=creator,
creator_affiliation=creator_affiliation)
Before writing to disk, we assure the file structure follows the Photon-HDF5 format:
phc.hdf5.assert_valid_photon_hdf5(d)
phc.hdf5.save_photon_hdf5(d)
d['_data_file'].close()
from pprint import pprint
filename = d['_data_file'].filename
#filename = r'C:\Data\Antonio\Eitan\022rde11_T_minus15_acc__NT_plus10_don_1_new_copy.hdf5'
h5data = phc.hdf5.load_photon_hdf5(filename)
phc.hdf5.dict_from_group(h5data.identity)
phc.hdf5.dict_from_group(h5data.setup)
pprint(phc.hdf5.dict_from_group(h5data.photon_data))