Skip to content

Commit

Permalink
fix: guess initial values for image method when edge detection method…
Browse files Browse the repository at this point in the history
… fails
  • Loading branch information
paulmueller committed Aug 23, 2019
1 parent 9090868 commit f04ff78
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
@@ -1,3 +1,6 @@
0.5.2
- fix: guess initial values for image method when edge detection
method fails
0.5.1
- maintenance release
0.5.0
Expand Down
18 changes: 12 additions & 6 deletions qpsphere/cnvnc.py
Expand Up @@ -87,12 +87,18 @@ def analyze(qpi, r0, method="edge", model="projection", edgekw={}, imagekw={},
center=c)
res.append(qpi_sim)
elif method == "image":
n0, r0, c0 = edgefit.analyze(qpi=qpi,
r0=r0,
edgekw=edgekw,
ret_center=True,
ret_edge=False,
)
try:
n0, r0, c0 = edgefit.analyze(qpi=qpi,
r0=r0,
edgekw=edgekw,
ret_center=True,
ret_edge=False,
)
except edgefit.EdgeDetectionError:
# proceed with best guess
c0 = np.array(qpi.shape) / 2
n0 = qpi["medium index"] + np.sign(np.sum(qpi.pha)) * .01

res = imagefit.analyze(qpi=qpi,
model=model,
n0=n0,
Expand Down

0 comments on commit f04ff78

Please sign in to comment.