4.1.1.3.1.4. lib.simulation.MINFLUXMonteCarlo#

4.1.1.3.1.4.1. Module Contents#

4.1.1.3.1.4.1.1. Classes#

4.1.1.3.1.4.1.2. Functions#

4.1.1.3.1.4.1.3. Data#

4.1.1.3.1.4.1.4. API#

lib.simulation.MINFLUXMonteCarlo.script_name = 'basename(...)'#
lib.simulation.MINFLUXMonteCarlo.mod_fit(labels, vals, **kwargs)#
lib.simulation.MINFLUXMonteCarlo.MLE(group_labels, group_df, **kwargs)#
lib.simulation.MINFLUXMonteCarlo.process_group(group)#
lib.simulation.MINFLUXMonteCarlo.pairwise_distances_jax(positions)#
class lib.simulation.MINFLUXMonteCarlo.MCAnalysis#

Initialization

model(params, chunk)#

Model for a single chunk, i.e. N=1,

Loglikelihood(model, params, measured_model_vals)#

params to be optimized model underlying the measurement fixed_model_params specifies how was measured measured_model_vals , i.e. counts

getMLE(input_df, solver='SLSQP')#
getFisherMatrix(model, params)#
getInverseFisherMatrix(model, params)#

Returns inverse of Fisher Information Matrix. :param X: array of molecules positions

getCramerRaoBound(model, params)#

Calculates the average CRB for a given constellation of molecules. :param X: array of molecule positions, shape=(M,dim) :param pattern: pattern object :return: sigma CRB [nm]

class lib.simulation.MINFLUXMonteCarlo.MultifluxPostProcessing#

Initialization

post_process(input_dir, output_dir, visualize=True)#
class lib.simulation.MINFLUXMonteCarlo.MCSimulation#

Initialization

run(params, bootstrap_dicts)#
generate_data(param_dicts)#

MC simulation of last MINFLUX iteration

analyze(dir, bootstrap_dicts)#
_generate_params(param_dict, systems=None)#

Generate an array of configs for the simulations.

Parameters:
  • param_dict – dict Dictionary containing parameters for simulations. - ‘M0’ (int): Number of molecules per system (default: 3). - ‘P0’ (int): Parameter P (default: M^2, where M is ‘M0’). - ‘I0’ (int): Parameter I (default: 1). - ‘L0’ (int): MINFLUX L in nm (default: 70). - ‘N0’ (int): Number of systems per config (default: 5). - ‘K0’ (int): Number of tuples to simulate in each segment (default: 100). - ‘d0’ (int): Scale parameter of the system in nm (default: 30). - ‘gamma0’ (int): Average molecule brightness (default: 13). - ‘r0’ (int): Relative brightness (default: 0). - ‘alpha0’ (int): Alpha parameter (default: 1). - ‘sig_alpha0’ (int): Sigma alpha parameter (default: 0). - ‘beta0’ (int): Beta parameter (default: 0).

  • systems – numpy.ndarray, optional Array representing system configurations.

Returns:

tuple - params0 (numpy.ndarray): Array containing parameters a0, a1, and phi in (3, axis * segments * N) shape. - systems (numpy.ndarray): Updated system configurations. - phis (numpy.ndarray): Array of phase values.

Generates parameters a0, a1, and phi for simulations in (3, axis * segments * N) shape. The order of segments is two-molecule segment, single-molecule segment, and background.

Notes: - Systems need to be in units of phase and flattened array. - TODO: Add multiplication by a suitable gamma matrix that incorporates all brightnesses. - TODO: Update global I0 in a1 calculation. - Phase offset is assumed to be zero since we’re centered on the effective COM.

_generate_points(lateral_scale, num_molecules, num_systems, config='random')#

Generate positions in units of phase.

Parameters:
  • lateral_scale – float Scale parameter for lateral positions.

  • num_molecules – int Number of molecules.

  • num_systems – int Number of systems.

  • mode – str, optional Mode for position generation: ‘random’ or ‘polygon’ (default: ‘random’).

Returns:

numpy.ndarray Generated positions in units of phase.

Generates positions in units of phase based on the specified parameters and mode. If mode is ‘random’, positions are randomly distributed within the specified lateral scale. If mode is ‘polygon’, positions are distributed along a polygon within the lateral scale.

Note

positions are scaled by 4 * np.pi / LAMBDA.