Module helperfuncs#
A set of helper functions for identifying and filling out fields in the data
dictionary produced by phconvert.loader.loadfile_bh() and
phconvert.loader.loadfile_ptu() functions.
- phconvert.helperfuncs.fill_alex_periods(data, *args)#
Add excitation periods to
/photon_data/measurement_specs/sub-dictionary of a dictionary to be converted into a photon-HDF5 file- Parameters:
data (dict) – Data dictionary.
*args (np.ndarray) – One array per excitation period, each array must be even number of elements specifiying the star and stop time(s) for the given period.
- phconvert.helperfuncs.fill_measurement_type(data, measurement_type)#
Iterate over all photon_dataX groups and set the field
/photon_dataX/measurement_spces/measurement_typeto measuremnt_type- Parameters:
data (dict) – dictionary that will passed to
phconvert.hdf5.save_photon_hdf5().measurement_type (str) – The specified measurement type. Use “generic” if unsure.
- phconvert.helperfuncs.fill_setup(data)#
Fill setup dictioanry based on detectors_specs dictionary
- Parameters:
data (dict) – The data dictionary, will infer setup field from detectors_specs fields
- phconvert.helperfuncs.get_num_polarization(detectors_specs)#
Determine number of spectral detection types in a detectors_specs dictionary. Used to fill out field of
/setup/num_polarization_chautomatically
- phconvert.helperfuncs.get_num_spectral(detectors_specs)#
Determine number of spectral detection types in a detectors_specs dictionary. Used to fill out field of
/setup/num_spectral_chautomatically
- phconvert.helperfuncs.get_num_split(detectors_specs)#
Determine number of spectral detection types in a detectors_specs dictionary. Used to fill out field of
/setup/num_split_chautomatically
- phconvert.helperfuncs.pop_nones(data)#
Remove keys with None values in a dictionary from
loader.loadfile_function. Function should be called only after all other applicable None values have been set appropriately.Use
report_nones()to identify all None values in data dictionary. Call this and fill out all relevant fields before callingpop_nones- Parameters:
data (dict) – Dictionary from
loader.loadfile_to be converted to photon-HDF5
- phconvert.helperfuncs.report_nones(data, root='')#
Identify the fields that must be either removed or specified from a dictionary returned by the
loader.loadfile_function