def diffusion(diffusion_constant=<NUM_LIT>, exposure_time=<NUM_LIT>, samples=<NUM_LIT:200>):
radius = <NUM_LIT:5><EOL>psfsize = np.array([<NUM_LIT>, <NUM_LIT:1.0>, <NUM_LIT>])<EOL>s0 = init.create_single_particle_state(imsize=<NUM_LIT:4>*radius, <EOL>radius=radius, psfargs={'<STR_LIT>': psfsize, '<STR_LIT:error>': <NUM_LIT>})<EOL>finalimage = <NUM_LIT:0>*s0.get_model_image()[s0.inner]<EOL>position = <NUM_LIT:0>*s0.obj.pos[<NUM_LIT:0>]<EOL>for i in range(samples):<EOL><INDENT>offset = np.sqrt(<NUM_LIT:6>*diffusion_constant*exposure_time)*np.random.randn(<NUM_LIT:3>)<EOL>s0.obj.pos[<NUM_LIT:0>] = np.array(s0.image.shape)/<NUM_LIT:2> + offset<EOL>s0.reset()<EOL>finalimage += s0.get_model_image()[s0.inner]<EOL>position += s0.obj.pos[<NUM_LIT:0>]<EOL><DEDENT>finalimage /= float(samples)<EOL>position /= float(samples)<EOL>s = init.create_single_particle_state(imsize=<NUM_LIT:4>*radius, sigma=<NUM_LIT>,<EOL>radius=radius, psfargs={'<STR_LIT>': psfsize, '<STR_LIT:error>': <NUM_LIT>})<EOL>s.reset()<EOL>return s, finalimage, position<EOL>
See `diffusion_correlated` for information related to units, etc