def fit_edge(separation, radius=<NUM_LIT>, samples=<NUM_LIT:100>, imsize=<NUM_LIT:64>, sigma=<NUM_LIT>, axis='<STR_LIT:z>'):
terrors = []<EOL>berrors = []<EOL>crbs = []<EOL>for sep in separation:<EOL><INDENT>print('<STR_LIT:=>'*<NUM_LIT>)<EOL>print('<STR_LIT>', sep, end='<STR_LIT:U+0020>')<EOL>s = init.create_two_particle_state(imsize, radius=radius, delta=sep, sigma=<NUM_LIT>,<EOL>axis='<STR_LIT:z>', psfargs={'<STR_LIT>': (<NUM_LIT>,<NUM_LIT:1.0>,<NUM_LIT>), '<STR_LIT:error>': <NUM_LIT>},<EOL>stateargs={'<STR_LIT>': True, '<STR_LIT>': const.PAD})<EOL>d = np.array([<NUM_LIT:0>,<NUM_LIT:0.5>,<NUM_LIT:0.5>])<EOL>s.obj.pos -= d<EOL>s.reset()<EOL>bl = s.blocks_particle(<NUM_LIT:0>)<EOL>s.update(bl[<NUM_LIT:0>], np.array([s.pad+radius]))<EOL>bl = s.blocks_particle(<NUM_LIT:1>)<EOL>s.update(bl[<NUM_LIT:0>], np.array([s.pad-radius]))<EOL>if axis == '<STR_LIT:z>':<EOL><INDENT>bl = s.blocks_particle(<NUM_LIT:1>)<EOL>s.update(bl[<NUM_LIT:0>], s.state[bl[<NUM_LIT:0>]]-sep)<EOL>s.model_to_true_image()<EOL><DEDENT>if axis == '<STR_LIT>':<EOL><INDENT>bl = s.blocks_particle(<NUM_LIT:1>)<EOL>s.update(bl[<NUM_LIT:2>], s.state[bl[<NUM_LIT:2>]]+sep)<EOL>s.model_to_true_image()<EOL><DEDENT>p = s.state[s.b_pos].reshape(-<NUM_LIT:1>,<NUM_LIT:3>).copy()<EOL>print(p[<NUM_LIT:0>], p[<NUM_LIT:1>])<EOL>bl = s.explode(s.b_pos)<EOL>crbs.append(np.sqrt(np.diag(np.linalg.inv(s.fisher_information(blocks=bl)))).reshape(-<NUM_LIT:1>,<NUM_LIT:3>))<EOL>tmp_tp, tmp_bf = [],[]<EOL>for i in range(samples):<EOL><INDENT>print(i)<EOL>bench.jiggle_particles(s, pos=p, sig=<NUM_LIT>, mask=np.array([<NUM_LIT:1>,<NUM_LIT:1>,<NUM_LIT:1>]))<EOL>t = bench.trackpy(s)<EOL>b = bench.bamfpy_positions(s, sweeps=<NUM_LIT:15>)<EOL>tmp_tp.append(bench.error(s, t))<EOL>tmp_bf.append(bench.error(s, b))<EOL><DEDENT>terrors.append(tmp_tp)<EOL>berrors.append(tmp_bf)<EOL><DEDENT>return np.array(crbs), np.array(terrors), np.array(berrors)<EOL>
axis is 'z' or 'xy'
seps = np.linspace(0,2,20) 'z'
seps = np.linspace(-2,2,20) 'xy'