Module loader
¶
This module contains functions to load each supported data format.
Each loader function loads data from a third-party formats into a python
dictionary which has the structure of a Photon-HDF5 file.
These dictionaries can be passed to phconvert.hdf5.save_photon_hdf5()
to save the data in Photon-HDF5 format.
The loader module contains high-level functions which “fill” the dictionary with the appropriate arrays. The actual decoding of the input binary files is performed by low-level functions in other modules (smreader.py, pqreader.py, bhreader.py). When trying to decode a new file format, these modules can provide useful examples.
-
phconvert.loader.
nsalex_bh
(filename_spc, donor=4, acceptor=6, alex_period_donor=(10, 1500), alex_period_acceptor=(2000, 3500), excitation_wavelengths=(5.32e-07, 6.35e-07), detection_wavelengths=(5.8e-07, 6.8e-07), allow_missing_set=False, tcspc_num_bins=None, tcspc_unit=None)¶ Load a .spc and (optionally) .set files for ns-ALEX and return 2 dict.
The first dictionary can be passed to the
phconvert.hdf5.save_photon_hdf5()
function to save the data in Photon-HDF5 format.Returns: the first contains the main photon data (timestamps, detectors, nanotime, ...); the second contains the raw data from the .set file (it can be saved in a user group in Photon-HDF5). Return type: Two dictionaries
-
phconvert.loader.
nsalex_ht3
(filename, donor=0, acceptor=1, alex_period_donor=(150, 1500), alex_period_acceptor=(1540, 3050), excitation_wavelengths=(5.23e-07, 6.28e-07), detection_wavelengths=(5.8e-07, 6.8e-07))¶ Load a .ht3 file containing ns-ALEX data and return a dict.
This dictionary can be passed to the
phconvert.hdf5.save_photon_hdf5()
function to save the data in Photon-HDF5 format.
-
phconvert.loader.
usalex_sm
(filename, donor=0, acceptor=1, alex_period=4000, alex_offset=750, alex_period_donor=(2850, 580), alex_period_acceptor=(930, 2580), excitation_wavelengths=(5.32e-07, 6.35e-07), detection_wavelengths=(5.8e-07, 6.8e-07), software='LabVIEW Data Acquisition usALEX')¶ Load a .sm us-ALEX file and returns a dictionary.
This dictionary can be passed to the
phconvert.hdf5.save_photon_hdf5()
function to save the data in Photon-HDF5 format.